ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGlossaryPresentationGUI Class Reference

Glossary presentation. More...

+ Collaboration diagram for ilGlossaryPresentationGUI:

Public Member Functions

 __construct ($export_format="", $export_dir="")
 Constructor public. More...
 
 initByRequest (array $query_params)
 Init services and this class by request params. More...
 
 injectTemplate ($tpl)
 Inject template. More...
 
 setOfflineMode ($a_offline=true)
 set offline mode (content is generated for offline package) More...
 
 offlineMode ()
 checks wether offline content generation is activated More...
 
 setOfflineDirectory ($a_dir)
 Set offline directory. More...
 
 getOfflineDirectory ()
 Get offline directory. More...
 
 executeCommand ()
 execute command More...
 
 prepareOutput ()
 
 basicPageGuiInit (\ilPageObjectGUI $a_page_gui)
 Basic page gui initialisation. More...
 
 listTerms ()
 List all terms. More...
 
 listTermByGiven ()
 list glossary terms More...
 
 getPresentationTable ()
 Get presentation table. More...
 
 applyFilter ()
 Apply filter. More...
 
 resetFilter ()
 Reset filter (note: this function existed before data table filter has been introduced. More...
 
 listDefinitions ($a_ref_id=0, $a_term_id=0, $a_get_html=false, $a_page_mode=ilPageObjectGUI::PRESENTATION)
 list definitions of a term More...
 
 showDefinitionTabs ($a_act)
 Definitions tabs. More...
 
 fullscreen ()
 show fullscreen view More...
 
 media ($a_mode="media")
 show media object More...
 
 showDownloadList ()
 show download list More...
 
 downloadExportFile ()
 send download file (xml/html) More...
 
 setLocator ($a_tree="", $a_id="")
 set Locator More...
 
 downloadFile ()
 download file of file lists More...
 
 setTabs ()
 output tabs More...
 
 getLink ( $a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
 handles links for learning module presentation More...
 
 printViewSelection ()
 Print view selection. More...
 
 initPrintViewSelectionForm ()
 Init print view selection form. More...
 
 printView ()
 Print View. More...
 
 getTabs ()
 get tabs More...
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 outputInfoScreen ()
 info screen More...
 
 chooseLetter ()
 Choose first letter. More...
 
 showTaxonomy ()
 Show taxonomy. More...
 

Protected Member Functions

 setContentStyles ()
 Set content styles. More...
 

Protected Attributes

 $ctrl
 
 $tabs_gui
 
 $access
 
 $error
 
 $nav_history
 
 $toolbar
 
 $user
 
 $help
 
 $glossary
 
 $glossary_gui
 
 $tpl
 
 $lng
 
 $tax_node
 
 $tax_id
 
 $tax
 
 $service
 
 $term_id
 
 $requested_ref_id
 
 $requested_letter
 
 $requested_def_page_id
 
 $requested_search_str
 
 $requested_file_id
 
 $requested_mob_id
 
 $requested_export_type
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

References $_GET, $DIC, $ilCtrl, $lng, $tpl, help(), initByRequest(), setOfflineDirectory(), and user().

142  {
143  global $DIC;
144 
145  $this->export_format = $export_format;
146  $this->setOfflineDirectory($export_dir);
147  $this->offline = ($export_format != "");
148  $this->access = $DIC->access();
149  $this->error = $DIC["ilErr"];
150  $this->nav_history = $DIC["ilNavigationHistory"];
151  $this->toolbar = $DIC->toolbar();
152  $this->user = $DIC->user();
153  $this->help = $DIC["ilHelp"];
154  $lng = $DIC->language();
155  $tpl = $DIC->ui()->mainTemplate();
156  $ilCtrl = $DIC->ctrl();
157  $ilTabs = $DIC->tabs();
158 
159  $this->tabs_gui = $ilTabs;
160  $this->tpl = $tpl;
161  $this->lng = $lng;
162  $this->ctrl = $ilCtrl;
163  $this->ctrl->saveParameter($this, array("ref_id", "letter", "tax_node"));
164 
165  // note: using $DIC->http()->request()->getQueryParams() here will
166  // fail, since the goto magic currently relies on setting $_GET
167  $this->initByRequest($_GET);
168  }
$_GET["client_id"]
initByRequest(array $query_params)
Init services and this class by request params.
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
help()
Definition: help.php:2
setOfflineDirectory($a_dir)
Set offline directory.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilGlossaryPresentationGUI::applyFilter ( )

Apply filter.

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

References $tabs_gui, getPresentationTable(), and listTerms().

496  {
497  $ilTabs = $this->tabs_gui;
498 
499  $prtab = $this->getPresentationTable();
500  $prtab->resetOffset();
501  $prtab->writeFilterToSession();
502  $this->listTerms();
503  }
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ basicPageGuiInit()

ilGlossaryPresentationGUI::basicPageGuiInit ( \ilPageObjectGUI  $a_page_gui)

Basic page gui initialisation.

Parameters

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

References ilObjStyleSheet\getEffectiveContentStyleId(), ilPageObjectGUI\getId(), getLink(), getOfflineDirectory(), offlineMode(), ilPageObjectGUI\setFileDownloadLink(), ilPageObjectGUI\setFullscreenLink(), ilPageObjectGUI\setOfflineDirectory(), ilPageObjectGUI\setOutputMode(), and ilPageObjectGUI\setStyleId().

Referenced by executeCommand(), and listDefinitions().

342  {
343  $a_page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
344  $this->glossary->getStyleSheetId(),
345  "glo"
346  ));
347  if (!$this->offlineMode()) {
348  $a_page_gui->setOutputMode("presentation");
349  $this->fill_on_load_code = true;
350  } else {
351  $a_page_gui->setOutputMode("offline");
352  $a_page_gui->setOfflineDirectory($this->getOfflineDirectory());
353  $this->fill_on_load_code = false;
354  }
355  if (!$this->offlineMode()) {
356  $this->ctrl->setParameter($this, "pg_id", $a_page_gui->getId());
357  }
358  $a_page_gui->setFileDownloadLink($this->getLink($this->requested_ref_id, "downloadFile"));
359  $a_page_gui->setFullscreenLink($this->getLink($this->requested_ref_id, "fullscreen"));
360  }
getOfflineDirectory()
Get offline directory.
getLink( $a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
handles links for learning module presentation
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
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 ( )

Choose first letter.

Parameters

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

References $ctrl, and $ilCtrl.

1370  {
1371  $ilCtrl = $this->ctrl;
1372 
1373  $ilCtrl->redirect($this, "listTerms");
1374  }
global $ilCtrl
Definition: ilias.php:18

◆ downloadExportFile()

ilGlossaryPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

References $access, $error, $ilErr, $lng, ilUtil\deliverFile(), and exit.

935  {
936  $ilAccess = $this->access;
938  $lng = $this->lng;
939 
940  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
941  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->error_obj->MESSAGE);
942  }
943 
944  $file = $this->glossary->getPublicExportFile($this->requested_export_type);
945  if ($this->glossary->getPublicExportFile($this->requested_export_type) != "") {
946  $dir = $this->glossary->getExportDirectory($this->requested_export_type);
947  if (is_file($dir . "/" . $file)) {
948  ilUtil::deliverFile($dir . "/" . $file, $file);
949  exit;
950  }
951  }
952  $ilErr->raiseError($this->lng->txt("file_not_found"), $ilErr->MESSAGE);
953  }
exit
Definition: login.php:29
$ilErr
Definition: raiseError.php:18
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ downloadFile()

ilGlossaryPresentationGUI::downloadFile ( )

download file of file lists

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

References $access, $error, $ilErr, $lng, and exit.

979  {
980  $ilAccess = $this->access;
982  $lng = $this->lng;
983 
984  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
985  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
986  }
987 
988  $file = explode("_", $this->requested_file_id);
989  $fileObj = new ilObjFile($file[count($file) - 1], false);
990  $fileObj->sendFile();
991  exit;
992  }
exit
Definition: login.php:29
$ilErr
Definition: raiseError.php:18

◆ executeCommand()

ilGlossaryPresentationGUI::executeCommand ( )

execute command

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

References $access, $error, $ilErr, $lng, $ret, basicPageGuiInit(), getPresentationTable(), listDefinitions(), outputInfoScreen(), prepareOutput(), and setTabs().

273  {
274  $lng = $this->lng;
275  $ilAccess = $this->access;
277 
278  $lng->loadLanguageModule("content");
279 
280  $next_class = $this->ctrl->getNextClass($this);
281  $cmd = $this->ctrl->getCmd("listTerms");
282 
283  // check write permission
284  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id) &&
285  !($ilAccess->checkAccess("visible", "", $this->requested_ref_id) &&
286  ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui"))) {
287  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
288  }
289 
290  if ($cmd != "listDefinitions") {
291  $this->prepareOutput();
292  }
293 
294  switch ($next_class) {
295  case "ilnotegui":
296  $this->setTabs();
297  $ret = $this->listDefinitions();
298  break;
299 
300  case "ilinfoscreengui":
301  $ret = $this->outputInfoScreen();
302  break;
303 
304  case "ilpresentationlisttablegui":
305  $prtab = $this->getPresentationTable();
306  $this->ctrl->forwardCommand($prtab);
307  return;
308  break;
309 
310  case "ilglossarydefpagegui":
311  $page_gui = new ilGlossaryDefPageGUI($this->requested_def_page_id);
312  $this->basicPageGuiInit($page_gui);
313  $this->ctrl->forwardCommand($page_gui);
314  break;
315 
316  default:
317  $ret = $this->$cmd();
318  break;
319  }
320  $this->tpl->printToStdout();
321  }
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
Basic page gui initialisation.
$ilErr
Definition: raiseError.php:18
Glossary definition page GUI class.
$ret
Definition: parser.php:6
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false, $a_page_mode=ilPageObjectGUI::PRESENTATION)
list definitions of a term
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ fullscreen()

ilGlossaryPresentationGUI::fullscreen ( )

show fullscreen view

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

References media().

758  {
759  $html = $this->media("fullscreen");
760  return $html;
761  }
media($a_mode="media")
show media object
+ Here is the call graph for this function:

◆ getLink()

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

handles links for learning module presentation

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

References $a_type, and offlineMode().

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

1013  {
1014  if ($a_cmd == "") {
1015  $a_cmd = "layout";
1016  }
1017  //$script = "glossary_presentation.php";
1018 
1019  // handle online links
1020  if (!$this->offlineMode()) {
1021  //$link = $script."?ref_id=".$a_ref_id;
1022  switch ($a_cmd) {
1023  case "fullscreen":
1024  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1025  $link = $this->ctrl->getLinkTarget($this, "fullscreen");
1026  break;
1027 
1028  default:
1029  $link .= "&cmd=" . $a_cmd;
1030  if ($a_frame != "") {
1031  $this->ctrl->setParameter($this, "frame", $a_frame);
1032  }
1033  if ($a_obj_id != "") {
1034  switch ($a_type) {
1035  case "MediaObject":
1036  $this->ctrl->setParameter($this, "mob_id", $a_obj_id);
1037  break;
1038 
1039  default:
1040  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1041  break;
1042  }
1043  }
1044  if ($a_type != "") {
1045  $this->ctrl->setParameter($this, "obj_type", $a_type);
1046  }
1047  $link = $this->ctrl->getLinkTarget($this, $a_cmd);
1048 // $link = str_replace("&", "&", $link);
1049  break;
1050  }
1051  } else { // handle offline links
1052  switch ($a_cmd) {
1053  case "downloadFile":
1054  break;
1055 
1056  case "fullscreen":
1057  $link = "fullscreen.html"; // id is handled by xslt
1058  break;
1059 
1060  case "layout":
1061  break;
1062 
1063  case "glossary":
1064  $link = "term_" . $a_obj_id . ".html";
1065  break;
1066 
1067  case "media":
1068  $link = "media_" . $a_obj_id . ".html";
1069  break;
1070 
1071  default:
1072  break;
1073  }
1074  }
1075  $this->ctrl->clearParameters($this);
1076  return $link;
1077  }
$a_type
Definition: workflow.php:92
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 ( )

Get offline directory.

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

Referenced by basicPageGuiInit(), and listDefinitions().

264  {
265  return $this->offline_dir;
266  }
+ Here is the caller graph for this function:

◆ getPresentationTable()

ilGlossaryPresentationGUI::getPresentationTable ( )

Get presentation table.

Parameters

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

References offlineMode().

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

480  {
481  $table = new ilPresentationListTableGUI(
482  $this,
483  "listTerms",
484  $this->glossary,
485  $this->offlineMode(),
486  $this->tax_node,
487  $this->glossary->getTaxonomyId()
488  );
489  return $table;
490  }
Term list table for presentation mode.
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 ( )

get tabs

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

References $access, $ctrl, $help, $ilCtrl, $lng, and offlineMode().

Referenced by setTabs().

1247  {
1248  $ilAccess = $this->access;
1249  $lng = $this->lng;
1250  $ilCtrl = $this->ctrl;
1251  $ilHelp = $this->help;
1252 
1253  $ilHelp->setScreenIdComponent("glo");
1254 
1255  if (!$this->offlineMode()) {
1256  if ($this->ctrl->getCmd() != "listDefinitions") {
1257  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1258  $this->tabs_gui->addTab(
1259  "terms",
1260  $lng->txt("cont_terms"),
1261  $ilCtrl->getLinkTarget($this, "listTerms")
1262  );
1263  }
1264 
1265  $this->tabs_gui->addTab(
1266  "info",
1267  $lng->txt("info_short"),
1268  $ilCtrl->getLinkTarget($this, "infoScreen")
1269  );
1270 
1271 
1272  // glossary menu
1273  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1274  $this->tabs_gui->addTab(
1275  "print_view",
1276  $lng->txt("cont_print_view"),
1277  $ilCtrl->getLinkTarget($this, "printViewSelection")
1278  );
1279 
1280  // download links
1281  if ($this->glossary->isActiveDownloads()) {
1282  $this->tabs_gui->addTab(
1283  "download",
1284  $lng->txt("download"),
1285  $ilCtrl->getLinkTarget($this, "showDownloadList")
1286  );
1287  }
1288  //}
1289  }
1290 
1291  if ($ilAccess->checkAccess("write", "", (int) $this->requested_ref_id) ||
1292  $ilAccess->checkAccess("edit_content", "", (int) $this->requested_ref_id)) {
1293  $this->tabs_gui->addNonTabbedLink(
1294  "editing_view",
1295  $lng->txt("glo_editing_view"),
1296  "ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=" . (int) $this->requested_ref_id,
1297  "_top"
1298  );
1299  }
1300  }
1301  } else {
1302  $this->tabs_gui->addTarget(
1303  "cont_back",
1304  "index.html#term_" . $this->term_id,
1305  "",
1306  ""
1307  );
1308  }
1309  }
global $ilCtrl
Definition: ilias.php:18
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 not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

References outputInfoScreen().

1317  {
1318  $this->ctrl->setCmd("showSummary");
1319  $this->ctrl->setCmdClass("ilinfoscreengui");
1320  $this->outputInfoScreen();
1321  }
+ Here is the call graph for this function:

◆ initByRequest()

ilGlossaryPresentationGUI::initByRequest ( array  $query_params)

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.

Parameters
$query_params
Exceptions
ilGlossaryException

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

References ilGlossaryTerm\_lookGlossaryID(), ilGlossaryTermReferences\isReferenced(), and user().

Referenced by __construct().

180  {
181  $this->service = new Presentation\GlossaryPresentationService(
182  $this->user,
183  $query_params,
184  $this->offline
185  );
186 
187  $request = $this->service->getRequest();
188 
189  $this->requested_ref_id = $request->getRequestedRefId();
190  $this->term_id = $request->getRequestedTermId();
191  $this->glossary_gui = $this->service->getGlossaryGUI();
192  $this->glossary = $this->service->getGlossary();
193  $this->requested_def_page_id = $request->getRequestedDefinitionPageId();
194  $this->requested_search_str = $request->getRequestedSearchString();
195  $this->requested_file_id = $request->getRequestedFileId();
196  $this->requested_mob_id = $request->getRequestedMobId();
197  $this->requested_export_type = (string) $query_params["type"];
198 
199 
200  // determine term id and check whether it is valid (belongs to
201  // current glossary or a virtual (online) sub-glossary)
202  $glo_ids = $this->glossary->getAllGlossaryIds();
203  if (!is_array($glo_ids)) {
204  $glo_ids = array($glo_ids);
205  }
206  $term_glo_id = ilGlossaryTerm::_lookGlossaryID($this->term_id);
207  if (!in_array($term_glo_id, $glo_ids) && !ilGlossaryTermReferences::isReferenced($glo_ids, $this->term_id)) {
208  if ((int) $this->term_id > 0) {
209  throw new ilGlossaryException("Term ID does not match the glossary.");
210  }
211  $this->term_id = 0;
212  }
213 
214  $this->tax_node = 0;
215  $this->tax_id = $this->glossary->getTaxonomyId();
216  if ($this->tax_id > 0 && $this->glossary->getShowTaxonomy()) {
217  $this->tax = new ilObjTaxonomy($this->tax_id);
218  }
219  $requested_tax_node = $request->getRequestedTaxNode();
220  if ((int) $requested_tax_node > 1 && $this->tax->getTree()->readRootId() != $requested_tax_node) {
221  $this->tax_node = $requested_tax_node;
222  }
223 
224  $this->requested_letter = $request->getRequestedLetter();
225  }
static isReferenced($a_glo_id, $a_term_id)
Is a term referenced by one or multiple glossaries.
user()
Definition: user.php:4
static _lookGlossaryID($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 1114 of file class.ilGlossaryPresentationGUI.php.

References $ctrl, $ilCtrl, $lng, $si, ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by printViewSelection().

1115  {
1116  $lng = $this->lng;
1117  $ilCtrl = $this->ctrl;
1118 
1119  $terms = $this->glossary->getTermList();
1120 
1121  $this->form = new ilPropertyFormGUI();
1122  //$this->form->setTarget("print_view");
1123  $this->form->setFormAction($ilCtrl->getFormAction($this));
1124 
1125  // selection type
1126  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1127  $radg->setValue("glossary");
1128 
1129  // current term
1130  if ((int) $this->term_id > 0) {
1131  $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
1132  $radg->addOption($op1);
1133  $radg->setValue("term");
1134  }
1135 
1136  // whole glossary
1137  $op2 = new ilRadioOption($lng->txt("cont_whole_glossary")
1138  . " (" . $lng->txt("cont_terms") . ": " . count($terms) . ")", "glossary");
1139  $radg->addOption($op2);
1140 
1141  // selected topic
1142  if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
1143  $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
1144  $radg->addOption($op4);
1145 
1146  // topic drop down
1147  $si = new ilTaxAssignInputGUI(
1148  $t_id,
1149  false,
1150  $lng->txt("cont_topic"),
1151  "topic",
1152  false
1153  );
1154  if ($this->tax_node > 0) {
1155  $si->setValue((int) $this->tax_node);
1156  }
1157  $op4->addSubItem($si);
1158  }
1159 
1160  // selected terms
1161  $op3 = new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
1162  $radg->addOption($op3);
1163 
1164  $nl = new ilNestedListInputGUI("", "obj_id");
1165  $op3->addSubItem($nl);
1166  //var_dump($terms);
1167  foreach ($terms as $t) {
1168  $nl->addListNode($t["id"], $t["term"], 0, false, false);
1169  }
1170 
1171  $this->form->addItem($radg);
1172 
1173  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
1174  $this->form->setPreventDoubleSubmission(false);
1175 
1176  $this->form->setTitle($lng->txt("cont_print_selection"));
1177  }
This class represents an option in a radio group.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
setValue($a_value)
Set Value.
Input GUI class for taxonomy assignments.
This class represents a (nested) list of checkboxes (could be extended for radio items, too)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ injectTemplate()

ilGlossaryPresentationGUI::injectTemplate (   $tpl)

Inject template.

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

References $tpl.

231  {
232  $this->tpl = $tpl;
233  }

◆ listDefinitions()

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

list definitions of a term

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

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

Referenced by executeCommand(), and printView().

521  {
523  $ilAccess = $this->access;
524  $lng = $this->lng;
526  $tpl = $this->tpl;
527 
528  if ($a_ref_id == 0) {
529  $ref_id = (int) $this->requested_ref_id;
530  } else {
531  $ref_id = $a_ref_id;
532  }
533  if ($a_term_id == 0) {
535  } else {
536  $term_id = $a_term_id;
537  }
538 
539  if (!$ilAccess->checkAccess("read", "", $ref_id)) {
540  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
541  }
542 
543  // tabs
544  if ($this->glossary->getPresentationMode() != "full_def" &&
545  $a_page_mode != ilPageObjectGUI::PRINTING) {
546  $this->showDefinitionTabs("term_content");
547  }
548 
549  $term = new ilGlossaryTerm($term_id);
550 
551  if (!$a_get_html) {
552  $tpl->loadStandardTemplate();
553 
554  $this->setContentStyles();
555 
556  if (!$this->offlineMode()) {
557  $this->setLocator();
558  }
559 
560  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
561  $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm());
562 
563  // advmd block
564  $cmd = null;
565  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
566  $cmd = array("edit" => $this->ctrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui", "ilobjectmetadatagui"), ""));
567  }
568  $mdgui = new ilObjectMetaDataGUI($this->glossary, "term", $term->getId());
569  $tpl->setRightContent($mdgui->getBlockHTML($cmd));
570  }
571 
572  $def_tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
573 
575  $def_tpl->setVariable("TXT_TERM", $term->getTerm());
576  $this->mobs = array();
577 
578  // toc
579  if (count($defs) > 1 && $a_page_mode == ilPageObjectGUI::PRESENTATION) {
580  $def_tpl->setCurrentBlock("toc");
581  for ($j = 1; $j <= count($defs); $j++) {
582  $def_tpl->setCurrentBlock("toc_item");
583  $def_tpl->setVariable("TOC_DEF_NR", $j);
584  $def_tpl->setVariable("TOC_DEF", $lng->txt("cont_definition"));
585  $def_tpl->parseCurrentBlock();
586  }
587  $def_tpl->setCurrentBlock("toc");
588  $def_tpl->parseCurrentBlock();
589  }
590 
591  for ($j = 0; $j < count($defs); $j++) {
592  $def = $defs[$j];
593  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
594  $this->basicPageGuiInit($page_gui);
595  $page_gui->setGlossary($this->glossary);
596  $page_gui->setOutputMode($a_page_mode);
597  $page_gui->setStyleId($this->glossary->getStyleSheetId());
598  $page = $page_gui->getPageObject();
599 
600  // internal links
601  $page->buildDom();
602 
603  if ($this->offlineMode()) {
604  $page_gui->setOutputMode("offline");
605  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
606  }
607  $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"]));
608 
609  $page_gui->setTemplateOutput(false);
610  $page_gui->setRawPageContent(true);
611  if (!$this->offlineMode()) {
612  $output = $page_gui->showPage();
613  } else {
614  $output = $page_gui->presentation($page_gui->getOutputMode());
615  }
616 
617  if (count($defs) > 1) {
618  $def_tpl->setCurrentBlock("definition_header");
619  $def_tpl->setVariable(
620  "TXT_DEFINITION",
621  $this->lng->txt("cont_definition") . " " . ($j + 1)
622  );
623  $def_tpl->setVariable("DEF_NR", ($j + 1));
624  $def_tpl->parseCurrentBlock();
625  }
626 
627  $def_tpl->setCurrentBlock("definition");
628  $def_tpl->setVariable("PAGE_CONTENT", $output);
629  $def_tpl->parseCurrentBlock();
630  }
631 
632  // display possible backlinks
633  $sources = ilInternalLink::_getSourcesOfTarget('git', $this->term_id, 0);
634 
635  if ($sources) {
636  $backlist_shown = false;
637  foreach ($sources as $src) {
638  $type = explode(':', $src['type']);
639 
640  if ($type[0] == 'lm') {
641  if ($type[1] == 'pg') {
642  $title = ilLMPageObject::_getPresentationTitle($src['id']);
643  $lm_id = ilLMObject::_lookupContObjID($src['id']);
644  $lm_title = ilObject::_lookupTitle($lm_id);
645  $def_tpl->setCurrentBlock('backlink_item');
646  $ref_ids = ilObject::_getAllReferences($lm_id);
647  $access = false;
648  foreach ($ref_ids as $rid) {
649  if ($ilAccess->checkAccess("read", "", $rid)) {
650  $access = true;
651  }
652  }
653  if ($access) {
654  $def_tpl->setCurrentBlock("backlink_item");
655  $def_tpl->setVariable("BACKLINK_LINK", ILIAS_HTTP_PATH . "/goto.php?target=" . $type[1] . "_" . $src['id']);
656  $def_tpl->setVariable("BACKLINK_ITEM", $lm_title . ": " . $title);
657  $def_tpl->parseCurrentBlock();
658  $backlist_shown = true;
659  }
660  }
661  }
662  }
663  if ($backlist_shown) {
664  $def_tpl->setCurrentBlock("backlink_list");
665  $def_tpl->setVariable("BACKLINK_TITLE", $this->lng->txt('glo_term_used_in'));
666  $def_tpl->parseCurrentBlock();
667  }
668  }
669 
670  if (!$a_get_html) {
671  $tpl->setPermanentLink("git", $term_id, "", ILIAS_HTTP_PATH .
672  "/goto.php?target=" .
673  "git" .
674  "_" . $term_id . "_" . $ref_id . "&client_id=" . CLIENT_ID);
675 
676  // show taxonomy
677  $this->showTaxonomy();
678  }
679 
680  // highlighting?
681  if ($this->requested_search_str != "" && !$this->offlineMode()) {
682  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
683  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
684  $search_string = $cache->getQuery();
685 
686  $p = new ilQueryParser($search_string);
687  $p->parse();
688 
689  $words = $p->getQuotedWords();
690  if (is_array($words)) {
691  foreach ($words as $w) {
692  ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl);
693  }
694  }
695  $this->fill_on_load_code = true;
696  }
697  $tpl->setContent($def_tpl->get());
698  if ($this->offlineMode()) {
699  return $tpl->printToString();
700  } elseif ($a_get_html) {
701  return $def_tpl->get();
702  }
703  }
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
Class ilObjectMetaDataGUI.
static getDefinitionList($a_term_id)
static
getOfflineDirectory()
Get offline directory.
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
Basic page gui initialisation.
$type
Glossary terms.
getLink( $a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
handles links for learning module presentation
setLocator($a_tree="", $a_id="")
set Locator
static _lookupTitle($a_id)
lookup object title
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _getAllReferences($a_id)
get all reference ids of object
$ilErr
Definition: raiseError.php:18
static _getInstance($a_usr_id)
Get singleton instance.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
offlineMode()
checks wether offline content generation is activated
Glossary definition page GUI class.
showDefinitionTabs($a_act)
Definitions tabs.
+ 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 422 of file class.ilGlossaryPresentationGUI.php.

References $access, $ctrl, $ilCtrl, $ilErr, $lng, $tpl, getPresentationTable(), offlineMode(), setContentStyles(), and setTabs().

Referenced by listTerms().

423  {
425  $ilAccess = $this->access;
426  $lng = $this->lng;
427  $tpl = $this->tpl;
428 
429  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
430  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
431  }
432 
433  $this->lng->loadLanguageModule("meta");
434 
435  $this->setTabs();
436 
437  // load template for table
438  // $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
439 
440  if ($this->glossary->getPresentationMode() == "full_def") {
441  $this->setContentStyles();
442  }
443 
444  $table = $this->getPresentationTable();
445 
446  if (!$this->offlineMode()) {
447  $tpl->setContent($ilCtrl->getHTML($table));
448  } else {
449  $this->tpl->setVariable("ADM_CONTENT", $table->getHTML());
450  return $this->tpl->printToString();
451  }
452  }
$ilErr
Definition: raiseError.php:18
global $ilCtrl
Definition: ilias.php:18
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 ( )

List all terms.

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

References $access, $ctrl, $error, $ilCtrl, $ilErr, $lng, $nav_history, $ret, $tabs_gui, $toolbar, listTermByGiven(), offlineMode(), ilAlphabetInputGUI\setFixDBUmlauts(), showTaxonomy(), and ilUtil\stripSlashes().

Referenced by applyFilter(), and resetFilter().

366  {
367  $ilNavigationHistory = $this->nav_history;
368  $ilAccess = $this->access;
369  $lng = $this->lng;
370  $ilToolbar = $this->toolbar;
372  $ilTabs = $this->tabs_gui;
374 
375 
376  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
377  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
378  }
379 
380  if (!$this->offlineMode()) {
381  $ilNavigationHistory->addItem(
382  $this->requested_ref_id,
383  $this->ctrl->getLinkTarget($this, "listTerms"),
384  "glo"
385  );
386 
387  // alphabetical navigation
388  $ai = new ilAlphabetInputGUI($lng->txt("glo_quick_navigation"), "first");
389 
390  $ai->setFixDBUmlauts(true);
391 
392  $first_letters = $this->glossary->getFirstLetters($this->tax_node);
393  if (!is_array($first_letters)) {
394  $first_letters = [];
395  }
396  if (!in_array($this->requested_letter, $first_letters)) {
397  $first_letters[] = ilUtil::stripSlashes($this->requested_letter);
398  }
399  $ai->setLetters($first_letters);
400 
401  $ai->setParentCommand($this, "chooseLetter");
402  $ai->setHighlighted($this->requested_letter);
403  $ilToolbar->addInputItem($ai, true);
404  }
405 
406  $ret = $this->listTermByGiven();
407  $ilCtrl->setParameter($this, "term_id", "");
408 
409  $ilTabs->activateTab("terms");
410 
411  // show taxonomy
412  $this->showTaxonomy();
413 
414  $this->tpl->setPermanentLink("glo", $this->glossary->getRefId());
415 
416  return $ret;
417  }
This class represents a text property in a property form.
$ilErr
Definition: raiseError.php:18
global $ilCtrl
Definition: ilias.php:18
setFixDBUmlauts($a_val)
Set fix db umlauts.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
offlineMode()
checks wether offline content generation is activated
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ media()

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

show media object

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

References $xml, ilMediaItem\_getMapAreasIntLinks(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), getLink(), ilUtil\getStyleSheetLocation(), ilUtil\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, offlineMode(), xslt_create(), xslt_error(), and xslt_free().

Referenced by fullscreen().

767  {
768  $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
769  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
770  $this->tpl->setVariable(
771  "LOCATION_CONTENT_STYLESHEET",
772  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())
773  );
774 
775  //$int_links = $page_object->getInternalLinks();
776  $med_links = ilMediaItem::_getMapAreasIntLinks($this->requested_mob_id);
777 
778  // later
779  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
780 
781  $link_xlm = "";
782 
783  $media_obj = new ilObjMediaObject($this->requested_mob_id);
784 
785  $xml = "<dummy>";
786  // todo: we get always the first alias now (problem if mob is used multiple
787  // times in page)
788  $xml .= $media_obj->getXML(IL_MODE_ALIAS);
789  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
790  $xml .= $link_xml;
791  $xml .= "</dummy>";
792 
793  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
794  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
795  $xh = xslt_create();
796 
797  if (!$this->offlineMode()) {
798  $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
799  $wb_path = ilUtil::getWebspaceDir("output") . "/";
800  } else {
801  $enlarge_path = "images/enlarge.svg";
802  $wb_path = "";
803  }
804 
805  $mode = $a_mode;
806 
807  $this->ctrl->setParameter($this, "obj_type", "MediaObject");
808  $fullscreen_link =
809  $this->getLink($this->requested_ref_id, "fullscreen");
810  $this->ctrl->clearParameters($this);
811 
812  $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
813  'link_params' => "ref_id=" . $this->requested_ref_id,'fullscreen_link' => $fullscreen_link,
814  'ref_id' => $this->requested_ref_id, 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
815  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
816  echo xslt_error($xh);
817  xslt_free($xh);
818 
819  // unmask user html
820  $this->tpl->setVariable("MEDIA_CONTENT", $output);
821 
822  $this->tpl->parseCurrentBlock();
823  if ($this->offlineMode()) {
824  $html = $this->tpl->get();
825  return $html;
826  }
827  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
xslt_create()
static _getMapAreasIntLinks($a_mob_id)
get all internal links of map areas of a mob
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getLink( $a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
handles links for learning module presentation
xslt_free(&$proc)
xslt_error(&$proc)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$xml
Definition: metadata.php:332
Class ilObjMediaObject.
const IL_MODE_ALIAS
offlineMode()
checks wether offline content generation is activated
const IL_MODE_OUTPUT
static getWebspaceDir($mode="filesystem")
get webspace directory
+ 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 246 of file class.ilGlossaryPresentationGUI.php.

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

247  {
248  return $this->offline;
249  }
+ Here is the caller graph for this function:

◆ outputInfoScreen()

ilGlossaryPresentationGUI::outputInfoScreen ( )

info screen

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

References $access, $tabs_gui, ilObjGlossaryGUI\addUsagesToInfo(), offlineMode(), and setTabs().

Referenced by executeCommand(), and infoScreen().

1327  {
1328  $ilAccess = $this->access;
1329  $ilTabs = $this->tabs_gui;
1330 
1331  $this->setTabs();
1332  $ilTabs->activateTab("info");
1333  $this->lng->loadLanguageModule("meta");
1334 
1335  $info = new ilInfoScreenGUI($this->glossary_gui);
1336  $info->enablePrivateNotes();
1337  //$info->enableLearningProgress();
1338 
1339  $info->enableNews();
1340  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1341  $info->enableNewsEditing();
1342  $news_set = new ilSetting("news");
1343  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1344  if ($enable_internal_rss) {
1345  $info->setBlockProperty("news", "settings", true);
1346  }
1347  }
1348 
1349  // show standard meta data section
1350  $info->addMetaDataSections($this->glossary->getId(), 0, $this->glossary->getType());
1351 
1352  ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1353 
1354  if ($this->offlineMode()) {
1355  $this->tpl->setContent($info->getHTML());
1356  return $this->tpl->get();
1357  } else {
1358  // forward the command
1359  $this->ctrl->forwardCommand($info);
1360  }
1361  }
Class ilInfoScreenGUI.
static addUsagesToInfo($info, $glo_id)
Add usages to info.
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 323 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by executeCommand().

324  {
325  $this->tpl->loadStandardTemplate();
326  $title = $this->glossary->getTitle();
327 
328  $this->tpl->setTitle($title);
329  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
330 
331  $this->setLocator();
332  }
setLocator($a_tree="", $a_id="")
set Locator
static getImagePath($img, $module_path="", $mode="output", $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 ( )

Print View.

Parameters

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

References $_POST, $access, $i, $tpl, ilObjTaxonomy\getSubTreeItems(), listDefinitions(), and ilPageObjectGUI\PRINTING.

1186  {
1187  $ilAccess = $this->access;
1188  $tpl = $this->tpl;
1189 
1190  $this->tabs_gui->setBackTarget(
1191  $this->lng->txt("back"),
1192  $this->ctrl->getLinkTarget($this, "printViewSelection")
1193  );
1194 
1195  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1196  return;
1197  }
1198 
1199  $terms = array();
1200  switch ($_POST["sel_type"]) {
1201  case "glossary":
1202  $ts = $this->glossary->getTermList();
1203  foreach ($ts as $t) {
1204  $terms[] = $t["id"];
1205  }
1206  break;
1207 
1208  case "sel_topic":
1209  $t_id = $this->glossary->getTaxonomyId();
1210  $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]);
1211  foreach ($items as $i) {
1212  if ($i["item_type"] == "term") {
1213  $terms[] = $i["item_id"];
1214  }
1215  }
1216  break;
1217 
1218  case "selection":
1219  if (is_array($_POST["obj_id"])) {
1220  $terms = $_POST["obj_id"];
1221  } else {
1222  $terms = array();
1223  }
1224  break;
1225 
1226  case "term":
1227  $terms = array($this->term_id);
1228  break;
1229  }
1230 
1231  //$tpl->addCss(ilObjStyleSheet::getContentPrintStyle());
1232  $tpl->addOnLoadCode("il.Util.print();");
1233 
1234  // determine target frames for internal links
1235 
1236  $page_content = "";
1237  foreach ($terms as $t_id) {
1238  $page_content .= $this->listDefinitions($this->requested_ref_id, $t_id, true, ilPageObjectGUI::PRINTING);
1239  }
1240  $tpl->setContent($page_content);
1241  }
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false, $a_page_mode=ilPageObjectGUI::PRESENTATION)
list definitions of a term
static getSubTreeItems($a_comp, $a_obj_id, $a_item_type, $a_tax_id, $a_node)
Get all assigned items under a node.
$_POST["username"]
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ printViewSelection()

ilGlossaryPresentationGUI::printViewSelection ( )

Print view selection.

Parameters

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

References $ctrl, $ilCtrl, $ilUser, $lng, $tabs_gui, $toolbar, $tpl, $user, ilUtil\getImagePath(), initPrintViewSelectionForm(), setTabs(), and showDefinitionTabs().

1086  {
1087  $ilUser = $this->user;
1088  $lng = $this->lng;
1089  $ilToolbar = $this->toolbar;
1090  $ilCtrl = $this->ctrl;
1091  $tpl = $this->tpl;
1092  $ilTabs = $this->tabs_gui;
1093 
1094  $ilCtrl->saveParameter($this, "term_id");
1095 
1096  if ((int) $this->term_id == 0) {
1097  $this->setTabs();
1098  $ilTabs->activateTab("print_view");
1099  } else {
1100  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
1101  $term = new ilGlossaryTerm((int) $this->term_id);
1102  $tpl->setTitle($this->lng->txt("cont_term") . ": " . $term->getTerm());
1103  $this->showDefinitionTabs("print_view");
1104  }
1105 
1106  $this->initPrintViewSelectionForm();
1107 
1108  $tpl->setContent($this->form->getHTML());
1109  }
initPrintViewSelectionForm()
Init print view selection form.
Glossary terms.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
showDefinitionTabs($a_act)
Definitions tabs.
+ Here is the call graph for this function:

◆ resetFilter()

ilGlossaryPresentationGUI::resetFilter ( )

Reset filter (note: this function existed before data table filter has been introduced.

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

References getPresentationTable(), and listTerms().

510  {
511  $prtab = $this->getPresentationTable();
512  $prtab->resetOffset();
513  $prtab->resetFilter();
514  $this->listTerms();
515  }
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ setContentStyles()

ilGlossaryPresentationGUI::setContentStyles ( )
protected

Set content styles.

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

References $tpl, ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getEffectiveContentStyleId(), ilObjStyleSheet\getSyntaxStylePath(), and offlineMode().

Referenced by listDefinitions(), and listTermByGiven().

458  {
459  $tpl = $this->tpl;
460 
461  if (!$this->offlineMode()) {
463  $this->glossary->getStyleSheetId(),
464  "glo"
465  )));
467  } else {
468  $tpl->addCss("content.css");
469  $tpl->addCss("syntaxhighlight.css");
470  }
471  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getSyntaxStylePath()
get syntax style path
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocator()

ilGlossaryPresentationGUI::setLocator (   $a_tree = "",
  $a_id = "" 
)

set Locator

Parameters
objecttree object
integerreference id public

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

Referenced by listDefinitions(), and prepareOutput().

963  {
964  $gloss_loc = new ilGlossaryLocatorGUI();
965  $gloss_loc->setMode("presentation");
966  if (!empty($this->term_id)) {
967  $term = new ilGlossaryTerm($this->term_id);
968  $gloss_loc->setTerm($term);
969  }
970  $gloss_loc->setGlossary($this->glossary);
971  //$gloss_loc->setDefinition($this->definition);
972  $gloss_loc->display();
973  }
Glossary terms.
+ Here is the caller graph for this function:

◆ setOfflineDirectory()

ilGlossaryPresentationGUI::setOfflineDirectory (   $a_dir)

Set offline directory.

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

Referenced by __construct().

255  {
256  $this->offline_dir = $a_dir;
257  }
+ Here is the caller graph for this function:

◆ setOfflineMode()

ilGlossaryPresentationGUI::setOfflineMode (   $a_offline = true)

set offline mode (content is generated for offline package)

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

239  {
240  $this->offline = $a_offline;
241  }

◆ setTabs()

ilGlossaryPresentationGUI::setTabs ( )

output tabs

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

References getTabs().

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

998  {
999  $this->getTabs();
1000  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDefinitionTabs()

ilGlossaryPresentationGUI::showDefinitionTabs (   $a_act)

Definitions tabs.

Parameters

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

References $ctrl, $help, $ilCtrl, $lng, $tabs_gui, ilGlossaryTerm\_lookGlossaryID(), and offlineMode().

Referenced by listDefinitions(), and printViewSelection().

712  {
713  $ilTabs = $this->tabs_gui;
714  $lng = $this->lng;
716  $ilHelp = $this->help;
717 
718  if (!$this->offlineMode()) {
719  $ilHelp->setScreenIdComponent("glo");
720 
721  $ilCtrl->setParameter($this, "term_id", "");
722  $back = $ilCtrl->getLinkTarget($this, "listTerms");
723  $ilCtrl->setParameter($this, "term_id", $this->term_id);
724  $ilCtrl->saveParameter($this, "term_id");
725 
726  $ilTabs->setBackTarget($this->lng->txt("obj_glo"), $back);
727 
728  $ilTabs->addTab(
729  "term_content",
730  $lng->txt("content"),
731  $ilCtrl->getLinkTarget($this, "listDefinitions")
732  );
733 
734  $ilTabs->addTab(
735  "print_view",
736  $lng->txt("print_view"),
737  $ilCtrl->getLinkTarget($this, "printViewSelection")
738  );
739 
740  $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $this->term_id);
741  if (ilGlossaryTerm::_lookGlossaryID($this->term_id) == $this->glossary->getId()) {
742  $ilTabs->addNonTabbedLink(
743  "editing_view",
744  $lng->txt("glo_editing_view"),
745  $ilCtrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui"), "listDefinitions")
746  );
747  //"ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".$this->requested_ref_id."&amp;edit_term=".$this->term_id);
748  }
749  $ilTabs->activateTab($a_act);
750  }
751  }
global $ilCtrl
Definition: ilias.php:18
static _lookGlossaryID($term_id)
get glossary id form term id
offlineMode()
checks wether offline content generation is activated
+ 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 832 of file class.ilGlossaryPresentationGUI.php.

References $access, $cols, $i, $ilErr, $lng, $size, $tabs_gui, $type, ilUtil\getImagePath(), setTabs(), and ilUtil\switchColor().

833  {
834  $ilAccess = $this->access;
835  $lng = $this->lng;
836  $ilTabs = $this->tabs_gui;
837 
838  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
839  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
840  }
841 
842  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
843 
844  $this->setTabs();
845  $ilTabs->activateTab("download");
846 
847  // set title header
848  $this->tpl->setTitle($this->glossary->getTitle());
849  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
850 
851  // create table
852  $tbl = new ilTableGUI();
853 
854  // load files templates
855  $this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
856 
857  // load template for table content data
858  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
859 
860  $export_files = array();
861  $types = array("xml", "html");
862  foreach ($types as $type) {
863  if ($this->glossary->getPublicExportFile($type) != "") {
864  $dir = $this->glossary->getExportDirectory($type);
865  if (is_file($this->glossary->getExportDirectory($type) . "/" .
866  $this->glossary->getPublicExportFile($type))) {
867  $size = filesize($this->glossary->getExportDirectory($type) . "/" .
868  $this->glossary->getPublicExportFile($type));
869  $export_files[] = array("type" => $type,
870  "file" => $this->glossary->getPublicExportFile($type),
871  "size" => $size);
872  }
873  }
874  }
875 
876  $num = 0;
877 
878  $tbl->setTitle($this->lng->txt("download"));
879 
880  $tbl->setHeaderNames(array($this->lng->txt("cont_format"),
881  $this->lng->txt("cont_file"),
882  $this->lng->txt("size"), $this->lng->txt("date"),
883  ""));
884 
885  $cols = array("format", "file", "size", "date", "download");
886  $header_params = array("ref_id" => $this->requested_ref_id,
887  "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
888  $tbl->setHeaderVars($cols, $header_params);
889  $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
890  $tbl->disable("sort");
891  // footer
892  $tbl->disable("footer");
893  $tbl->setMaxCount(count($export_files));
894 
895  $tbl->render();
896  if (count($export_files) > 0) {
897  $i = 0;
898  foreach ($export_files as $exp_file) {
899  $this->tpl->setCurrentBlock("tbl_content");
900  $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
901 
902  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
903  $this->tpl->setVariable("CSS_ROW", $css_row);
904 
905  $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
906  $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
907  $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"] . ":" . $exp_file["file"]);
908 
909  $file_arr = explode("__", $exp_file["file"]);
910  $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s", $file_arr[0]));
911 
912  $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
913  $this->ctrl->setParameter($this, "type", $exp_file["type"]);
914  $this->tpl->setVariable(
915  "LINK_DOWNLOAD",
916  $this->ctrl->getLinkTarget($this, "downloadExportFile")
917  );
918 
919  $this->tpl->parseCurrentBlock();
920  }
921  } //if is_array
922  else {
923  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
924  $this->tpl->setVariable("NUM_COLS", 5);
925  $this->tpl->parseCurrentBlock();
926  }
927 
928  //$this->tpl->show();
929  }
$size
Definition: RandomTest.php:84
$type
Class ilTableGUI.
$ilErr
Definition: raiseError.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
$cols
Definition: xhr_table.php:11
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ showTaxonomy()

ilGlossaryPresentationGUI::showTaxonomy ( )

Show taxonomy.

Exceptions
ilCtrlException

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

References $ctrl, $DIC, $tax_id, $tpl, 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().

1381  {
1382  global $DIC;
1383 
1384  $tpl = $this->tpl;
1385  $ctrl = $this->ctrl;
1386  if (!$this->offlineMode() && $this->glossary->getShowTaxonomy()) {
1387  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->glossary->getId());
1388  if (count($tax_ids) > 0) {
1389  $tax_id = $tax_ids[0];
1390  $DIC->globalScreen()->tool()->context()->current()
1391  ->addAdditionalData(
1393  true
1394  );
1395  $DIC->globalScreen()->tool()->context()->current()
1396  ->addAdditionalData(
1398  $ctrl->getCurrentClassPath()
1399  );
1400  $DIC->globalScreen()->tool()->context()->current()
1401  ->addAdditionalData(
1403  $tax_id
1404  );
1405  $DIC->globalScreen()->tool()->context()->current()
1406  ->addAdditionalData(
1408  "listTerms"
1409  );
1410  $DIC->globalScreen()->tool()->context()->current()
1411  ->addAdditionalData(
1413  "showTaxonomy"
1414  );
1415 
1416  $tax_exp = new ilTaxonomyExplorerGUI(
1417  get_class($this),
1418  "showTaxonomy",
1419  $tax_id,
1420  "ilglossarypresentationgui",
1421  "listTerms"
1422  );
1423  if (!$tax_exp->handleCommand()) {
1424  //$tpl->setLeftNavContent($tax_exp->getHTML());
1425  //$tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
1426  }
1427  return;
1428  }
1429  }
1430  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
Taxonomy explorer GUI class.
offlineMode()
checks wether offline content generation is activated
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

◆ $ctrl

◆ $error

ilGlossaryPresentationGUI::$error
protected

◆ $glossary

ilGlossaryPresentationGUI::$glossary
protected

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

◆ $glossary_gui

ilGlossaryPresentationGUI::$glossary_gui
protected

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

◆ $help

ilGlossaryPresentationGUI::$help
protected

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

Referenced by getTabs(), and showDefinitionTabs().

◆ $lng

◆ $nav_history

ilGlossaryPresentationGUI::$nav_history
protected

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

Referenced by listTerms().

◆ $requested_def_page_id

ilGlossaryPresentationGUI::$requested_def_page_id
protected

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

◆ $requested_export_type

ilGlossaryPresentationGUI::$requested_export_type
protected

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

◆ $requested_file_id

ilGlossaryPresentationGUI::$requested_file_id
protected

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

◆ $requested_letter

ilGlossaryPresentationGUI::$requested_letter
protected

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

◆ $requested_mob_id

ilGlossaryPresentationGUI::$requested_mob_id
protected

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

◆ $requested_ref_id

ilGlossaryPresentationGUI::$requested_ref_id
protected

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

◆ $requested_search_str

ilGlossaryPresentationGUI::$requested_search_str
protected

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

◆ $service

ilGlossaryPresentationGUI::$service
protected

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

◆ $tabs_gui

ilGlossaryPresentationGUI::$tabs_gui
protected

◆ $tax

ilGlossaryPresentationGUI::$tax
protected

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

◆ $tax_id

ilGlossaryPresentationGUI::$tax_id
protected

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

Referenced by showTaxonomy().

◆ $tax_node

ilGlossaryPresentationGUI::$tax_node
protected

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

◆ $term_id

ilGlossaryPresentationGUI::$term_id
protected

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

Referenced by listDefinitions().

◆ $toolbar

ilGlossaryPresentationGUI::$toolbar
protected

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

Referenced by listTerms(), and printViewSelection().

◆ $tpl

◆ $user

ilGlossaryPresentationGUI::$user
protected

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

Referenced by listDefinitions(), and printViewSelection().


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