ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilGlossaryPresentationGUI Class Reference

Class ilGlossaryPresentationGUI. More...

+ Collaboration diagram for ilGlossaryPresentationGUI:

Public Member Functions

 __construct ()
 Constructor public. 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 ()
 
 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=IL_PAGE_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...
 
 getLinkXML ($a_int_links)
 get link targets 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...
 
 download_paragraph ()
 
 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 call from inside learning module More...
 
 chooseLetter ()
 Choose first letter. More...
 
 showTaxonomy ()
 Show taxonomy. More...
 

Data Fields

 $admin_tabs
 
 $glossary
 
 $ilias
 
 $tpl
 
 $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryPresentationGUI::__construct ( )

Constructor public.

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

References $_GET, $ilCtrl, $ilias, $lng, $tpl, ilGlossaryTerm\_lookGlossaryID(), array, and ilGlossaryTermReferences\isReferenced().

37  {
38  global $lng, $ilias, $tpl, $ilCtrl, $ilTabs;
39 
40  $this->tabs_gui = $ilTabs;
41  $this->tpl = $tpl;
42  $this->lng = $lng;
43  $this->ilias = $ilias;
44  $this->ctrl = $ilCtrl;
45  $this->offline = false;
46  $this->ctrl->saveParameter($this, array("ref_id", "letter", "tax_node"));
47 
48  // Todo: check lm id
49  include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
50  $this->glossary_gui = new ilObjGlossaryGUI("", $_GET["ref_id"], true, "");
51  $this->glossary = $this->glossary_gui->object;
52 
53  // determine term id and check whether it is valid (belongs to
54  // current glossary or a virtual (online) sub-glossary)
55  $this->term_id = (int) $_GET["term_id"];
56  $glo_ids = $this->glossary->getAllGlossaryIds();
57  if (!is_array($glo_ids))
58  {
59  $glo_ids = array($glo_ids);
60  }
61  $term_glo_id = ilGlossaryTerm::_lookGlossaryID($this->term_id);
62  include_once("./Modules/Glossary/classes/class.ilGlossaryTermReferences.php");
63  if (!in_array($term_glo_id, $glo_ids) && !ilGlossaryTermReferences::isReferenced($glo_ids, $this->term_id))
64  {
65  $this->term_id = "";
66  }
67 
68  $this->tax_node = 0;
69  $this->tax_id = $this->glossary->getTaxonomyId();
70  if ($this->tax_id > 0 && $this->glossary->getShowTaxonomy())
71  {
72  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
73  $this->tax = new ilObjTaxonomy($this->tax_id);
74  }
75  if ((int) $_GET["tax_node"] > 1 && $this->tax->getTree()->readRootId() != $_GET["tax_node"])
76  {
77  $this->tax_node = (int) $_GET["tax_node"];
78  }
79  }
Class ilGlossaryGUI.
static isReferenced($a_glo_id, $a_term_id)
Is a term referenced by one or multiple glossaries.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
Create styles array
The data for the language used.
static _lookGlossaryID($term_id)
get glossary id form term id
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilGlossaryPresentationGUI::applyFilter ( )

Apply filter.

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

References getPresentationTable(), and listTerms().

308  {
309  global $ilTabs;
310 
311  $prtab = $this->getPresentationTable();
312  $prtab->resetOffset();
313  $prtab->writeFilterToSession();
314  $this->listTerms();
315 
316  }
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ chooseLetter()

ilGlossaryPresentationGUI::chooseLetter ( )

Choose first letter.

Parameters

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

References $ilCtrl.

1476  {
1477  global $ilCtrl;
1478 
1479  $ilCtrl->redirect($this, "listTerms");
1480  }
global $ilCtrl
Definition: ilias.php:18

◆ download_paragraph()

ilGlossaryPresentationGUI::download_paragraph ( )

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

References $_GET.

1377  {
1378  include_once("./Modules/Glossary/classes/class.ilGlossaryDefPage.php");
1379  $pg_obj = new ilGlossaryDefPage($_GET["pg_id"]);
1380  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
1381  }
$_GET["client_id"]
Glossary definition page object.

◆ downloadExportFile()

ilGlossaryPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

References $_GET, $file, $ilias, $lng, ilUtil\deliverFile(), and exit.

848  {
849  global $ilAccess, $ilias, $lng;
850 
851  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
852  {
853  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
854  }
855 
856  $file = $this->glossary->getPublicExportFile($_GET["type"]);
857  if ($this->glossary->getPublicExportFile($_GET["type"]) != "")
858  {
859  $dir = $this->glossary->getExportDirectory($_GET["type"]);
860  if (is_file($dir."/".$file))
861  {
862  ilUtil::deliverFile($dir."/".$file, $file);
863  exit;
864  }
865  }
866  $this->ilias->raiseError($this->lng->txt("file_not_found"),$this->ilias->error_obj->MESSAGE);
867  }
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ downloadFile()

ilGlossaryPresentationGUI::downloadFile ( )

download file of file lists

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

References $_GET, $file, $ilias, $lng, and exit.

896  {
897  global $ilAccess, $ilias, $lng;
898 
899  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
900  {
901  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
902  }
903 
904  $file = explode("_", $_GET["file_id"]);
905  include_once("./Modules/File/classes/class.ilObjFile.php");
906  $fileObj = new ilObjFile($file[count($file) - 1], false);
907  $fileObj->sendFile();
908  exit;
909  }
$_GET["client_id"]
Class ilObjFile.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file

◆ executeCommand()

ilGlossaryPresentationGUI::executeCommand ( )

execute command

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

References $_GET, $cmd, $ilias, $lng, $ret, getPresentationTable(), listDefinitions(), outputInfoScreen(), prepareOutput(), and setTabs().

120  {
121  global $lng, $ilAccess, $ilias;
122 
123  $lng->loadLanguageModule("content");
124 
125  $next_class = $this->ctrl->getNextClass($this);
126  $cmd = $this->ctrl->getCmd("listTerms");
127 
128  // check write permission
129  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) &&
130  !($ilAccess->checkAccess("visible", "", $_GET["ref_id"]) &&
131  ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui")))
132  {
133  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
134  }
135 
136  if ($cmd != "listDefinitions")
137  {
138  $this->prepareOutput();
139  }
140 
141  switch($next_class)
142  {
143  case "ilnotegui":
144  $this->setTabs();
145  $ret = $this->listDefinitions();
146  break;
147 
148  case "ilinfoscreengui":
149  $ret = $this->outputInfoScreen();
150  break;
151 
152  case "ilpresentationlisttablegui":
153  $prtab = $this->getPresentationTable();
154  $this->ctrl->forwardCommand($prtab);
155  return;
156  break;
157 
158  default:
159  $ret = $this->$cmd();
160  break;
161  }
162  $this->tpl->show();
163  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
outputInfoScreen()
info screen call from inside learning module
$ret
Definition: parser.php:6
getPresentationTable()
Get presentation table.
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false, $a_page_mode=IL_PAGE_PRESENTATION)
list definitions of a term
+ Here is the call graph for this function:

◆ fullscreen()

ilGlossaryPresentationGUI::fullscreen ( )

show fullscreen view

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

References $html, and media().

649  {
650  $html = $this->media("fullscreen");
651  return $html;
652  }
media($a_mode="media")
show media object
$html
Definition: example_001.php:87
+ 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 1042 of file class.ilGlossaryPresentationGUI.php.

References $a_type, and offlineMode().

Referenced by listDefinitions(), and media().

1044  {
1045  if ($a_cmd == "")
1046  {
1047  $a_cmd = "layout";
1048  }
1049  //$script = "glossary_presentation.php";
1050 
1051  // handle online links
1052  if (!$this->offlineMode())
1053  {
1054  //$link = $script."?ref_id=".$a_ref_id;
1055  switch ($a_cmd)
1056  {
1057  case "fullscreen":
1058  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1059  $link = $this->ctrl->getLinkTarget($this, "fullscreen");
1060  break;
1061 
1062  default:
1063  $link.= "&cmd=".$a_cmd;
1064  if ($a_frame != "")
1065  {
1066  $this->ctrl->setParameter($this, "frame", $a_frame);
1067  }
1068  if ($a_obj_id != "")
1069  {
1070  switch ($a_type)
1071  {
1072  case "MediaObject":
1073  $this->ctrl->setParameter($this, "mob_id", $a_obj_id);
1074  break;
1075 
1076  default:
1077  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1078  break;
1079  }
1080  }
1081  if ($a_type != "")
1082  {
1083  $this->ctrl->setParameter($this, "obj_type", $a_type);
1084  }
1085  $link = $this->ctrl->getLinkTarget($this, $a_cmd);
1086 // $link = str_replace("&", "&", $link);
1087  break;
1088  }
1089  }
1090  else // handle offline links
1091  {
1092  switch ($a_cmd)
1093  {
1094  case "downloadFile":
1095  break;
1096 
1097  case "fullscreen":
1098  $link = "fullscreen.html"; // id is handled by xslt
1099  break;
1100 
1101  case "layout":
1102  break;
1103 
1104  case "glossary":
1105  $link = "term_".$a_obj_id.".html";
1106  break;
1107 
1108  case "media":
1109  $link = "media_".$a_obj_id.".html";
1110  break;
1111 
1112  default:
1113  break;
1114  }
1115  }
1116  $this->ctrl->clearParameters($this);
1117  return $link;
1118  }
$a_type
Definition: workflow.php:93
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinkXML()

ilGlossaryPresentationGUI::getLinkXML (   $a_int_links)

get link targets

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

References $target, $target_arr, $target_id, ilFrameTargetInfo\_getFrame(), ilGlossaryTerm\_lookGlossaryID(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), array, ilWikiPage\getGotoForWikiPageTarget(), and offlineMode().

Referenced by listDefinitions().

923  {
924 
925  if ($a_layoutframes == "")
926  {
927  $a_layoutframes = array();
928  }
929  $link_info = "<IntLinkInfos>";
930  foreach ($a_int_links as $int_link)
931  {
932 //echo "<br>+".$int_link["Type"]."+".$int_link["TargetFrame"]."+".$int_link["Target"]."+";
933  $target = $int_link["Target"];
934  if (substr($target, 0, 4) == "il__")
935  {
936  $target_arr = explode("_", $target);
937  $target_id = $target_arr[count($target_arr) - 1];
938  $type = $int_link["Type"];
939  $targetframe = ($int_link["TargetFrame"] != "")
940  ? $int_link["TargetFrame"]
941  : "None";
942 
943  // anchor
944  $anc = $anc_add = "";
945  if ($int_link["Anchor"] != "")
946  {
947  $anc = $int_link["Anchor"];
948  $anc_add = "_".rawurlencode($int_link["Anchor"]);
949  }
950 
951  if ($targetframe == "New")
952  {
953  $ltarget = "_blank";
954  }
955  else
956  {
957  $ltarget = "";
958  }
959 
960  switch($type)
961  {
962  case "PageObject":
963  case "StructureObject":
965  $cont_obj = $this->content_object;
966  if ($type == "PageObject")
967  {
968  $href = "./goto.php?target=pg_".$target_id.$anc_add;
969  }
970  else
971  {
972  $href = "./goto.php?target=st_".$target_id;
973  }
974  //$ltarget = "ilContObj".$lm_id;
975  break;
976 
977  case "GlossaryItem":
978  if (ilGlossaryTerm::_lookGlossaryID($target_id) == $this->glossary->getId())
979  {
980  if ($this->offlineMode())
981  {
982  $href = "term_".$target_id.".html";
983  }
984  else
985  {
986  $this->ctrl->setParameter($this, "term_id", $target_id);
987  $href = $this->ctrl->getLinkTarget($this, "listDefinitions");
988  $href = str_replace("&", "&amp;", $href);
989  }
990  }
991  else
992  {
993  $href = "./goto.php?target=git_".$target_id;
994  }
995  break;
996 
997  case "MediaObject":
998  if ($this->offlineMode())
999  {
1000  $href = "media_".$target_id.".html";
1001  }
1002  else
1003  {
1004  $this->ctrl->setParameter($this, "obj_type", $type);
1005  $this->ctrl->setParameter($this, "mob_id", $target_id);
1006  $href = $this->ctrl->getLinkTarget($this, "media");
1007  $href = str_replace("&", "&amp;", $href);
1008  }
1009  break;
1010 
1011  case "RepositoryItem":
1012  $obj_type = ilObject::_lookupType($target_id, true);
1014  $href = "./goto.php?target=".$obj_type."_".$target_id;
1015  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
1016  $ltarget = $t_frame;
1017  break;
1018 
1019  case "WikiPage":
1020  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1022  break;
1023  }
1024 
1025  $anc_par = 'Anchor="'.$anc.'"';
1026 
1027  $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
1028  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
1029 
1030  $this->ctrl->clearParameters($this);
1031  }
1032  }
1033  $link_info.= "</IntLinkInfos>";
1034 
1035  return $link_info;
1036  }
$target_arr
Definition: goto.php:49
$target_id
Definition: goto.php:51
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _lookGlossaryID($term_id)
get glossary id form term id
static _getFrame($a_class, $a_type='')
Get content frame name.
offlineMode()
checks wether offline content generation is activated
static getGotoForWikiPageTarget($a_target, $a_offline=false)
Get goto href for internal wiki page link target.
+ 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 110 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions().

111  {
112  return $this->offline_dir;
113  }
+ Here is the caller graph for this function:

◆ getPresentationTable()

ilGlossaryPresentationGUI::getPresentationTable ( )

Get presentation table.

Parameters

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

References offlineMode().

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

297  {
298  include_once("./Modules/Glossary/classes/class.ilPresentationListTableGUI.php");
299  $table = new ilPresentationListTableGUI($this, "listTerms", $this->glossary,
300  $this->offlineMode(), $this->tax_node, $this->glossary->getTaxonomyId());
301  return $table;
302  }
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 1315 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $ilCtrl, $lng, and offlineMode().

Referenced by setTabs().

1316  {
1317  global $ilAccess, $lng, $ilCtrl, $ilHelp;
1318 
1319  $ilHelp->setScreenIdComponent("glo");
1320 
1321  $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
1322 
1323  if (!$this->offlineMode())
1324  {
1325  if ($this->ctrl->getCmd() != "listDefinitions")
1326  {
1327  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1328  {
1329  $this->tabs_gui->addTab("terms",
1330  $lng->txt("cont_terms"),
1331  $ilCtrl->getLinkTarget($this, "listTerms"));
1332  }
1333 
1334  $this->tabs_gui->addTab("info",
1335  $lng->txt("info_short"),
1336  $ilCtrl->getLinkTarget($this, "infoScreen"));
1337 
1338  $this->tabs_gui->addTab("print_view",
1339  $lng->txt("cont_print_view"),
1340  $ilCtrl->getLinkTarget($this, "printViewSelection"));
1341 
1342  // glossary menu
1343  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1344  {
1345  //if ($this->glossary->isActiveGlossaryMenu())
1346  //{
1347  // download links
1348  if ($this->glossary->isActiveDownloads())
1349  {
1350  $this->tabs_gui->addTab("download",
1351  $lng->txt("download"),
1352  $ilCtrl->getLinkTarget($this, "showDownloadList"));
1353  }
1354  //}
1355  }
1356 
1357  if ($ilAccess->checkAccess("write", "", (int) $_GET["ref_id"]) ||
1358  $ilAccess->checkAccess("edit_content", "", (int) $_GET["ref_id"]))
1359  {
1360  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1361  $this->tabs_gui->addNonTabbedLink("editing_view",
1362  $lng->txt("glo_editing_view"),
1363  "ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".(int) $_GET["ref_id"],
1364  "_top");
1365  }
1366 
1367  }
1368  }
1369  else
1370  {
1371  $this->tabs_gui->addTarget("cont_back",
1372  "index.html#term_".$this->term_id, "",
1373  "");
1374  }
1375  }
$_GET["client_id"]
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 1389 of file class.ilGlossaryPresentationGUI.php.

References outputInfoScreen().

1390  {
1391  $this->ctrl->setCmd("showSummary");
1392  $this->ctrl->setCmdClass("ilinfoscreengui");
1393  $this->outputInfoScreen();
1394  }
outputInfoScreen()
info screen call from inside learning module
+ Here is the call graph for this function:

◆ initPrintViewSelectionForm()

ilGlossaryPresentationGUI::initPrintViewSelectionForm ( )

Init print view selection form.

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

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

Referenced by printViewSelection().

1154  {
1155  global $lng, $ilCtrl;
1156 
1157  $terms = $this->glossary->getTermList();
1158 
1159  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1160  $this->form = new ilPropertyFormGUI();
1161  $this->form->setTarget("print_view");
1162  $this->form->setFormAction($ilCtrl->getFormAction($this));
1163 
1164  // selection type
1165  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1166  $radg->setValue("glossary");
1167 
1168  // current term
1169  if ((int) $this->term_id > 0)
1170  {
1171  $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
1172  $radg->addOption($op1);
1173  $radg->setValue("term");
1174  }
1175 
1176  // whole glossary
1177  $op2 = new ilRadioOption($lng->txt("cont_whole_glossary")
1178  ." (".$lng->txt("cont_terms").": ".count($terms).")", "glossary");
1179  $radg->addOption($op2);
1180 
1181  // selected topic
1182  if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy())
1183  {
1184  $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
1185  $radg->addOption($op4);
1186 
1187  // topic drop down
1188  include_once("./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php");
1189  $si = new ilTaxAssignInputGUI($t_id, false, $lng->txt("cont_topic"), "topic",
1190  false);
1191  if ($this->tax_node > 0)
1192  {
1193  $si->setValue((int) $this->tax_node);
1194  }
1195  $op4->addSubItem($si);
1196 
1197  }
1198 
1199  // selected terms
1200  $op3= new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
1201  $radg->addOption($op3);
1202 
1203  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1204  $nl = new ilNestedListInputGUI("", "obj_id");
1205  $op3->addSubItem($nl);
1206 //var_dump($terms);
1207  foreach ($terms as $t)
1208  {
1209  $nl->addListNode($t["id"], $t["term"], 0, false, false);
1210  }
1211 
1212  $this->form->addItem($radg);
1213 
1214  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
1215  $this->form->setPreventDoubleSubmission(false);
1216 
1217  $this->form->setTitle($lng->txt("cont_print_selection"));
1218  }
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:

◆ listDefinitions()

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

list definitions of a term

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

References $_GET, $cmd, $ilCtrl, $ilias, $ilUser, $lng, $output, $ref_id, $title, $tpl, $w, ilObject\_getAllReferences(), ilUserSearchCache\_getInstance(), ilLMPageObject\_getPresentationTitle(), ilInternalLink\_getSourcesOfTarget(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), array, ilObjStyleSheet\getContentStylePath(), ilGlossaryDefinition\getDefinitionList(), ilUtil\getImagePath(), getLink(), getLinkXML(), getOfflineDirectory(), ilObjStyleSheet\getSyntaxStylePath(), ilTextHighlighterGUI\highlight(), IL_PAGE_PRESENTATION, ilUserSearchCache\LAST_QUERY, offlineMode(), setLocator(), showDefinitionTabs(), and showTaxonomy().

Referenced by executeCommand(), and printView().

334  {
335  global $ilUser, $ilAccess, $ilias, $lng, $ilCtrl;
336 
337  if ($a_ref_id == 0)
338  {
339  $ref_id = (int) $_GET["ref_id"];
340  }
341  else
342  {
343  $ref_id = $a_ref_id;
344  }
345  if ($a_term_id == 0)
346  {
347  $term_id = $this->term_id;
348  }
349  else
350  {
351  $term_id = $a_term_id;
352  }
353 
354  if (!$ilAccess->checkAccess("read", "", $ref_id))
355  {
356  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
357  }
358 
359  // tabs
360  if ($this->glossary->getPresentationMode() != "full_def")
361  {
362  $this->showDefinitionTabs("term_content");
363  }
364 
365  $term = new ilGlossaryTerm($term_id);
366 
367  if (!$a_get_html)
368  {
369  $tpl = $this->tpl;
370 
371  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
372  $tpl->getStandardTemplate();
373 // $this->setTabs();
374 
375  if ($this->offlineMode())
376  {
377  $style_name = $ilUser->prefs["style"].".css";;
378  $tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
379  }
380  else
381  {
382  $this->setLocator();
383  }
384 
385  // content style
386  $tpl->setCurrentBlock("ContentStyle");
387  if (!$this->offlineMode())
388  {
389  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
390  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
391  }
392  else
393  {
394  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET","content.css");
395  }
396  $tpl->parseCurrentBlock();
397 
398  // syntax style
399  $tpl->setCurrentBlock("SyntaxStyle");
400  if (!$this->offlineMode())
401  {
402  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
404  }
405  else
406  {
407  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
408  "syntaxhighlight.css");
409  }
410  $tpl->parseCurrentBlock();
411 
412  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
413  $tpl->setTitle($this->lng->txt("cont_term").": ".$term->getTerm());
414 
415  // advmd block
416  $cmd = null;
417  if($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
418  {
419  $cmd = array("edit" => $this->ctrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui", "ilobjectmetadatagui"), ""));
420  }
421  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
422  $mdgui = new ilObjectMetaDataGUI($this->glossary, "term", $term->getId());
423  $tpl->setRightContent($mdgui->getBlockHTML($cmd));
424 
425  // load template for table
426  $tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", "Modules/Glossary");
427  }
428  else
429  {
430  $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
431  }
432 
433  $defs = ilGlossaryDefinition::getDefinitionList($term_id);
434  $tpl->setVariable("TXT_TERM", $term->getTerm());
435  $this->mobs = array();
436 
437  // toc
438  if (count($defs) > 1 && $a_page_mode == IL_PAGE_PRESENTATION)
439  {
440  $tpl->setCurrentBlock("toc");
441  for($j=1; $j<=count($defs); $j++)
442  {
443  $tpl->setCurrentBlock("toc_item");
444  $tpl->setVariable("TOC_DEF_NR", $j);
445  $tpl->setVariable("TOC_DEF", $lng->txt("cont_definition"));
446  $tpl->parseCurrentBlock();
447  }
448  $tpl->setCurrentBlock("toc");
449  $tpl->parseCurrentBlock();
450  }
451 
452  for($j=0; $j<count($defs); $j++)
453  {
454  $def = $defs[$j];
455  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
456  $page_gui->setGlossary($this->glossary);
457  $page_gui->setOutputMode($a_page_mode);
458  $page_gui->setStyleId($this->glossary->getStyleSheetId());
459  $page = $page_gui->getPageObject();
460 
461  // internal links
462  $page->buildDom();
463  $int_links = $page->getInternalLinks();
464  $link_xml = $this->getLinkXML($int_links);
465  $page_gui->setLinkXML($link_xml);
466 
467  if ($this->offlineMode())
468  {
469  $page_gui->setOutputMode("offline");
470  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
471  }
472  $page_gui->setSourcecodeDownloadScript($this->getLink($ref_id));
473  $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"]));
474 
475  $page_gui->setTemplateOutput(false);
476  $page_gui->setRawPageContent(true);
477  $page_gui->setFileDownloadLink($this->getLink($ref_id, "downloadFile"));
478  if (!$this->offlineMode())
479  {
480  $output = $page_gui->showPage();
481  }
482  else
483  {
484  $output = $page_gui->presentation($page_gui->getOutputMode());
485  }
486 
487  if (count($defs) > 1)
488  {
489  $tpl->setCurrentBlock("definition_header");
490  $tpl->setVariable("TXT_DEFINITION",
491  $this->lng->txt("cont_definition")." ".($j+1));
492  $tpl->setVariable("DEF_NR", ($j+1));
493  $tpl->parseCurrentBlock();
494  }
495 
496  $tpl->setCurrentBlock("definition");
497  $tpl->setVariable("PAGE_CONTENT", $output);
498  $tpl->parseCurrentBlock();
499  }
500 
501  // display possible backlinks
502  $sources = ilInternalLink::_getSourcesOfTarget('git',$_GET['term_id'],0);
503 
504  if ($sources)
505  {
506  $backlist_shown = false;
507  foreach ($sources as $src)
508  {
509  $type = explode(':',$src['type']);
510 
511  if ($type[0] == 'lm')
512  {
513  if ($type[1] == 'pg')
514  {
516  $lm_id = ilLMObject::_lookupContObjID($src['id']);
517  $lm_title = ilObject::_lookupTitle($lm_id);
518  $tpl->setCurrentBlock('backlink_item');
519  $ref_ids = ilObject::_getAllReferences($lm_id);
520  $access = false;
521  foreach($ref_ids as $rid)
522  {
523  if ($ilAccess->checkAccess("read", "", $rid))
524  {
525  $access = true;
526  }
527  }
528  if ($access)
529  {
530  $tpl->setCurrentBlock("backlink_item");
531  $tpl->setVariable("BACKLINK_LINK",ILIAS_HTTP_PATH."/goto.php?target=".$type[1]."_".$src['id']);
532  $tpl->setVariable("BACKLINK_ITEM",$lm_title.": ".$title);
533  $tpl->parseCurrentBlock();
534  $backlist_shown = true;
535  }
536  }
537  }
538  }
539  if ($backlist_shown)
540  {
541  $tpl->setCurrentBlock("backlink_list");
542  $tpl->setVariable("BACKLINK_TITLE",$this->lng->txt('glo_term_used_in'));
543  $tpl->parseCurrentBlock();
544  }
545  }
546 
547  if (!$a_get_html)
548  {
549  $tpl->setCurrentBlock("perma_link");
550  $tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH.
551  "/goto.php?target=".
552  "git".
553  "_".$term_id."_".$ref_id."&client_id=".CLIENT_ID);
554  $tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link"));
555  $tpl->setVariable("PERMA_TARGET", "_top");
556  $tpl->parseCurrentBlock();
557 
558  // show taxonomy
559  $this->showTaxonomy();
560  }
561 
562  // highlighting?
563  if ($_GET["srcstring"] != "" && !$this->offlineMode())
564  {
565  include_once './Services/Search/classes/class.ilUserSearchCache.php';
566  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
567  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
568  $search_string = $cache->getQuery();
569 
570  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
571  include_once("./Services/Search/classes/class.ilQueryParser.php");
572  $p = new ilQueryParser($search_string);
573  $p->parse();
574 
575  $words = $p->getQuotedWords();
576  if (is_array($words))
577  {
578  foreach ($words as $w)
579  {
580  ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl);
581  }
582  }
583  $this->fill_on_load_code = true;
584  }
585 
586  if ($this->offlineMode() || $a_get_html)
587  {
588  return $tpl->get();
589  }
590  }
Class ilObjectMetaDataGUI.
static getDefinitionList($a_term_id)
static
getOfflineDirectory()
Get offline directory.
getLinkXML($a_int_links)
get link targets
$_GET["client_id"]
Class ilGlossaryTerm.
setLocator($a_tree="", $a_id="")
set Locator
$cmd
Definition: sahs_server.php:35
static _lookupTitle($a_id)
lookup object title
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
getLink($a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
handles links for learning module presentation
$w
static _getAllReferences($a_id)
get all reference ids of object
global $ilCtrl
Definition: ilias.php:18
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
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)
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
static getSyntaxStylePath()
get syntax style path
Create styles array
The data for the language used.
static getContentStylePath($a_style_id)
get content style path
const IL_PAGE_PRESENTATION
$ref_id
Definition: sahs_server.php:39
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.
static _getPresentationTitle($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
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 228 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $ilCtrl, $ilias, $lng, $tpl, ilObjStyleSheet\getContentStylePath(), getPresentationTable(), ilObjStyleSheet\getSyntaxStylePath(), offlineMode(), and setTabs().

Referenced by listTerms().

229  {
230  global $ilCtrl, $ilAccess, $ilias, $lng, $tpl;
231 
232  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
233  {
234  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
235  }
236 
237  $this->lng->loadLanguageModule("meta");
238 
239  $this->setTabs();
240 
241  // load template for table
242 // $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
243 
244  $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
245 
246  if ($this->glossary->getPresentationMode() == "full_def")
247  {
248  // content style
249  $this->tpl->setCurrentBlock("ContentStyle");
250  if (!$this->offlineMode())
251  {
252  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
253  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
254  }
255  else
256  {
257  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET","content.css");
258  }
259  $this->tpl->parseCurrentBlock();
260 
261  // syntax style
262  $this->tpl->setCurrentBlock("SyntaxStyle");
263  if (!$this->offlineMode())
264  {
265  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
267  }
268  else
269  {
270  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
271  "syntaxhighlight.css");
272  }
273  $this->tpl->parseCurrentBlock();
274  }
275 
276  $table = $this->getPresentationTable();
277 
278  if (!$this->offlineMode())
279  {
280 // $tpl->setContent($table->getHTML());
281  $tpl->setContent($ilCtrl->getHTML($table));
282  }
283  else
284  {
285  $this->tpl->setVariable("ADM_CONTENT", $table->getHTML());
286  return $this->tpl->get();
287  }
288  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id)
get content style path
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 180 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $ai, $ilCtrl, $ilias, $lng, $ret, listTermByGiven(), offlineMode(), showTaxonomy(), and ilUtil\stripSlashes().

Referenced by applyFilter(), and resetFilter().

181  {
182  global $ilNavigationHistory, $ilAccess, $ilias, $lng, $ilToolbar, $ilCtrl, $ilTabs;
183 
184 
185  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
186  {
187  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
188  }
189 
190  if (!$this->offlineMode())
191  {
192  $ilNavigationHistory->addItem($_GET["ref_id"],
193  $this->ctrl->getLinkTarget($this, "listTerms"), "glo");
194 
195  // alphabetical navigation
196  include_once("./Services/Form/classes/class.ilAlphabetInputGUI.php");
197  $ai = new ilAlphabetInputGUI($lng->txt("glo_quick_navigation"), "first");
198  $first_letters = $this->glossary->getFirstLetters($this->tax_node);
199  if (!is_array($first_letters))
200  {
201  $first_letters = [];
202  }
203  if (!in_array($_GET["letter"], $first_letters))
204  {
205  $first_letters[] = ilUtil::stripSlashes($_GET["letter"]);
206  }
207  $ai->setLetters($first_letters);
208  $ai->setParentCommand($this, "chooseLetter");
209  $ai->setHighlighted($_GET["letter"]);
210  $ilToolbar->addInputItem($ai, true);
211 
212  }
213 
214  $ret = $this->listTermByGiven();
215  $ilCtrl->setParameter($this, "term_id", "");
216 
217  $ilTabs->activateTab("terms");
218 
219  // show taxonomy
220  $this->showTaxonomy();
221 
222  return $ret;
223  }
$_GET["client_id"]
This class represents a text property in a property form.
global $ilCtrl
Definition: ilias.php:18
$ai
Definition: langwiz.php:238
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 657 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $html, $output, $params, ilMediaItem\_getMapAreasIntLinks(), array, 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().

658  {
659  $this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
660  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
661  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
662  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
663  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
664 
665  //$int_links = $page_object->getInternalLinks();
666  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
667 
668  // later
669  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
670 
671  $link_xlm = "";
672 
673  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
674  $media_obj = new ilObjMediaObject($_GET["mob_id"]);
675 
676  $xml = "<dummy>";
677  // todo: we get always the first alias now (problem if mob is used multiple
678  // times in page)
679  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
680  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
681  $xml.= $link_xml;
682  $xml.="</dummy>";
683 
684  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
685  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
686  $xh = xslt_create();
687 
688  if (!$this->offlineMode())
689  {
690  $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
691  $wb_path = ilUtil::getWebspaceDir("output")."/";
692  }
693  else
694  {
695  $enlarge_path = "images/enlarge.svg";
696  $wb_path = "";
697  }
698 
699  $mode = $a_mode;
700 
701  $this->ctrl->setParameter($this, "obj_type", "MediaObject");
702  $fullscreen_link =
703  $this->getLink($_GET["ref_id"], "fullscreen");
704  $this->ctrl->clearParameters($this);
705 
706  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
707  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
708  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
709  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
710  echo xslt_error($xh);
711  xslt_free($xh);
712 
713  // unmask user html
714  $this->tpl->setVariable("MEDIA_CONTENT", $output);
715 
716  $this->tpl->parseCurrentBlock();
717  if ($this->offlineMode())
718  {
719  $html = $this->tpl->get();
720  return $html;
721  }
722 
723  }
xslt_create()
static _getMapAreasIntLinks($a_mob_id)
get all internal links of map areas of a mob
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
xslt_free(&$proc)
getLink($a_ref_id, $a_cmd="", $a_term_id="", $a_def_id="", $a_frame="", $a_type="")
handles links for learning module presentation
xslt_error(&$proc)
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Class ilObjMediaObject.
const IL_MODE_ALIAS
Create styles array
The data for the language used.
static getContentStylePath($a_style_id)
get content style path
offlineMode()
checks wether offline content generation is activated
const IL_MODE_OUTPUT
static getWebspaceDir($mode="filesystem")
get webspace directory
$html
Definition: example_001.php:87
$params
Definition: example_049.php:96
+ 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 93 of file class.ilGlossaryPresentationGUI.php.

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

94  {
95  return $this->offline;
96  }
+ Here is the caller graph for this function:

◆ outputInfoScreen()

ilGlossaryPresentationGUI::outputInfoScreen ( )

info screen call from inside learning module

info screen

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

References $_GET, $ilBench, $info, ilObjGlossaryGUI\addUsagesToInfo(), offlineMode(), and setTabs().

Referenced by executeCommand(), and infoScreen().

1409  {
1410  global $ilBench, $ilAccess, $ilTabs;
1411 
1412  $this->setTabs();
1413  $ilTabs->activateTab("info");
1414  $this->lng->loadLanguageModule("meta");
1415 
1416  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1417 
1418  $info = new ilInfoScreenGUI($this->glossary_gui);
1419  $info->enablePrivateNotes();
1420  //$info->enableLearningProgress();
1421 
1422  $info->enableNews();
1423  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1424  {
1425  $info->enableNewsEditing();
1426  $news_set = new ilSetting("news");
1427  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1428  if ($enable_internal_rss)
1429  {
1430  $info->setBlockProperty("news", "settings", true);
1431  }
1432  }
1433 
1434  // add read / back button
1435  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1436  {
1437  /*
1438  if ($_GET["obj_id"] > 0)
1439  {
1440  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
1441  $info->addButton($this->lng->txt("back"),
1442  $this->ctrl->getLinkTarget($this, "layout"));
1443  }
1444  else
1445  {
1446  $info->addButton($this->lng->txt("view"),
1447  $this->ctrl->getLinkTarget($this, "layout"));
1448  }*/
1449  }
1450 
1451  // show standard meta data section
1452  $info->addMetaDataSections($this->glossary->getId(),0, $this->glossary->getType());
1453 
1454  include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
1455  ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1456 
1457  if ($this->offlineMode())
1458  {
1459  $this->tpl->setContent($info->getHTML());
1460  return $this->tpl->get();
1461  }
1462  else
1463  {
1464  // forward the command
1465  $this->ctrl->forwardCommand($info);
1466  }
1467  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
$_GET["client_id"]
$info
Definition: example_052.php:80
static addUsagesToInfo($info, $glo_id)
Add usages to info.
offlineMode()
checks wether offline content generation is activated
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilGlossaryPresentationGUI::prepareOutput ( )

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

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

Referenced by executeCommand().

166  {
167  $this->tpl->getStandardTemplate();
168  $title = $this->glossary->getTitle();
169 
170  $this->tpl->setTitle($title);
171  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
172 
173  $this->setLocator();
174  }
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 1226 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $_POST, $t, $tpl, array, exit, ilObjStyleSheet\getContentPrintStyle(), ilObjTaxonomy\getSubTreeItems(), IL_PAGE_PRINT, iljQueryUtil\initjQuery(), and listDefinitions().

1227  {
1228  global $ilAccess, $tpl;
1229 
1230  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1231  {
1232  return;
1233  }
1234 
1235  $terms = array();
1236  switch ($_POST["sel_type"])
1237  {
1238  case "glossary":
1239  $ts = $this->glossary->getTermList();
1240  foreach ($ts as $t)
1241  {
1242  $terms[] = $t["id"];
1243  }
1244  break;
1245 
1246  case "sel_topic":
1247  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1248  $t_id = $this->glossary->getTaxonomyId();
1249  $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]);
1250  foreach ($items as $i)
1251  {
1252  if ($i["item_type"] == "term")
1253  {
1254  $terms[] = $i["item_id"];
1255  }
1256  }
1257  break;
1258 
1259  case "selection":
1260  if (is_array($_POST["obj_id"]))
1261  {
1262  $terms = $_POST["obj_id"];
1263  }
1264  else
1265  {
1266  $terms = array();
1267  }
1268  break;
1269 
1270  case "term":
1271  $terms = array($this->term_id);
1272  break;
1273  }
1274 
1275  $tpl = new ilTemplate("tpl.main.html", true, true);
1276  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1277 
1278 /*
1279  // syntax style
1280  $this->tpl->setCurrentBlock("SyntaxStyle");
1281  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1282  ilObjStyleSheet::getSyntaxStylePath());
1283  $this->tpl->parseCurrentBlock();
1284 
1285  // content style
1286  $this->tpl->setCurrentBlock("ContentStyle");
1287  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1288  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
1289  $this->tpl->parseCurrentBlock();*/
1290 
1291  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1293 
1294  // determine target frames for internal links
1295 
1296  foreach ($terms as $t_id)
1297  {
1298  $page_content.= $this->listDefinitions($_GET["ref_id"], $t_id, true, IL_PAGE_PRINT);
1299  }
1300  $tpl->setVariable("CONTENT", $page_content.
1301  '<script type="text/javascript" language="javascript1.2">
1302  <!--
1303  il.Util.addOnLoad(function () {
1304  il.Util.print();
1305  });
1306  //-->
1307  </script>');
1308  $tpl->show(false);
1309  exit;
1310  }
static getContentPrintStyle()
get content print style
$_GET["client_id"]
const IL_PAGE_PRINT
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
static initjQuery($a_tpl=null)
Init jQuery.
static getSubTreeItems($a_comp, $a_obj_id, $a_item_type, $a_tax_id, $a_node)
Get all assigned items under a node.
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false, $a_page_mode=IL_PAGE_PRESENTATION)
list definitions of a term
$_POST["username"]
+ Here is the call graph for this function:

◆ printViewSelection()

ilGlossaryPresentationGUI::printViewSelection ( )

Print view selection.

Parameters

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

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

1127  {
1128  global $ilUser, $lng, $ilToolbar, $ilCtrl, $tpl, $ilTabs;
1129 
1130  $ilCtrl->saveParameter($this, "term_id");
1131 
1132  if ((int) $this->term_id == 0)
1133  {
1134  $this->setTabs();
1135  $ilTabs->activateTab("print_view");
1136  }
1137  else
1138  {
1139  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
1140  $term = new ilGlossaryTerm((int) $this->term_id);
1141  $tpl->setTitle($this->lng->txt("cont_term").": ".$term->getTerm());
1142  $this->showDefinitionTabs("print_view");
1143  }
1144 
1145  $this->initPrintViewSelectionForm();
1146 
1147  $tpl->setContent($this->form->getHTML());
1148  }
initPrintViewSelectionForm()
Init print view selection form.
Class ilGlossaryTerm.
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 322 of file class.ilGlossaryPresentationGUI.php.

References getPresentationTable(), and listTerms().

323  {
324  $prtab = $this->getPresentationTable();
325  $prtab->resetOffset();
326  $prtab->resetFilter();
327  $this->listTerms();
328  }
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ setLocator()

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

set Locator

Parameters
objecttree object
integerreference id public

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

Referenced by listDefinitions(), and prepareOutput().

877  {
878  //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
879  require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
880  $gloss_loc = new ilGlossaryLocatorGUI();
881  $gloss_loc->setMode("presentation");
882  if (!empty($this->term_id))
883  {
884  $term = new ilGlossaryTerm($this->term_id);
885  $gloss_loc->setTerm($term);
886  }
887  $gloss_loc->setGlossary($this->glossary);
888  //$gloss_loc->setDefinition($this->definition);
889  $gloss_loc->display();
890  }
Class ilGlossaryTerm.
+ Here is the caller graph for this function:

◆ setOfflineDirectory()

ilGlossaryPresentationGUI::setOfflineDirectory (   $a_dir)

Set offline directory.

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

102  {
103  $this->offline_dir = $a_dir;
104  }

◆ setOfflineMode()

ilGlossaryPresentationGUI::setOfflineMode (   $a_offline = true)

set offline mode (content is generated for offline package)

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

86  {
87  $this->offline = $a_offline;
88  }

◆ setTabs()

ilGlossaryPresentationGUI::setTabs ( )

output tabs

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

References getTabs().

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

915  {
916  $this->getTabs();
917  }
+ 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 598 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $ilCtrl, $lng, ilGlossaryTerm\_lookGlossaryID(), array, and offlineMode().

Referenced by listDefinitions(), and printViewSelection().

599  {
600  global $ilTabs, $lng, $ilCtrl, $ilHelp;
601 
602  if (!$this->offlineMode())
603  {
604  $ilHelp->setScreenIdComponent("glo");
605 
606  $ilCtrl->setParameter($this, "term_id", "");
607  $this->ctrl->setParameter($this, "offset", $_GET["offset"]);
608  if (!empty ($_REQUEST["term"]))
609  {
610  $this->ctrl->setParameter($this, "term", $_REQUEST["term"]);
611  $this->ctrl->setParameter($this, "oldoffset", $_GET["oldoffset"]);
612  $back = $ilCtrl->getLinkTarget($this, "searchTerms");
613  }
614  else
615  {
616  $back = $ilCtrl->getLinkTarget($this, "listTerms");
617  }
618  $ilCtrl->setParameter($this, "term_id", $this->term_id);
619  $ilCtrl->saveParameter($this, "term_id");
620 
621  $ilTabs->setBackTarget($this->lng->txt("obj_glo"), $back);
622 
623  $ilTabs->addTab("term_content",
624  $lng->txt("content"),
625  $ilCtrl->getLinkTarget($this, "listDefinitions"));
626 
627  $ilTabs->addTab("print_view",
628  $lng->txt("print_view"),
629  $ilCtrl->getLinkTarget($this, "printViewSelection"));
630 
631  $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $this->term_id);
632  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
633  if (ilGlossaryTerm::_lookGlossaryID($this->term_id) == $this->glossary->getId())
634  {
635  $ilTabs->addNonTabbedLink("editing_view",
636  $lng->txt("glo_editing_view"),
637  $ilCtrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui"), "listDefinitions"));
638  //"ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".$_GET["ref_id"]."&amp;edit_term=".$this->term_id);
639  }
640  $ilTabs->activateTab($a_act);
641  }
642  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
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 728 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $ilBench, $ilias, $lng, $size, $tbl, array, date, ilUtil\getImagePath(), setTabs(), and ilUtil\switchColor().

729  {
730  global $ilBench, $ilAccess, $ilias, $lng, $ilTabs;
731 
732  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
733  {
734  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
735  }
736 
737  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
738 
739  $this->setTabs();
740  $ilTabs->activateTab("download");
741 
742  // set title header
743  $this->tpl->setTitle($this->glossary->getTitle());
744  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
745 
746  // create table
747  require_once("./Services/Table/classes/class.ilTableGUI.php");
748  $tbl = new ilTableGUI();
749 
750  // load files templates
751  $this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
752 
753  // load template for table content data
754  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
755 
756  $export_files = array();
757  $types = array("xml", "html");
758  foreach($types as $type)
759  {
760  if ($this->glossary->getPublicExportFile($type) != "")
761  {
762  $dir = $this->glossary->getExportDirectory($type);
763  if (is_file($this->glossary->getExportDirectory($type)."/".
764  $this->glossary->getPublicExportFile($type)))
765  {
766  $size = filesize($this->glossary->getExportDirectory($type)."/".
767  $this->glossary->getPublicExportFile($type));
768  $export_files[] = array("type" => $type,
769  "file" => $this->glossary->getPublicExportFile($type),
770  "size" => $size);
771  }
772  }
773  }
774 
775  $num = 0;
776 
777  $tbl->setTitle($this->lng->txt("download"));
778 
779  $tbl->setHeaderNames(array($this->lng->txt("cont_format"),
780  $this->lng->txt("cont_file"),
781  $this->lng->txt("size"), $this->lng->txt("date"),
782  ""));
783 
784  $cols = array("format", "file", "size", "date", "download");
785  $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
786  "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
787  $tbl->setHeaderVars($cols, $header_params);
788  $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
789  $tbl->disable("sort");
790 
791  // control
792  $tbl->setOrderColumn($_GET["sort_by"]);
793  $tbl->setOrderDirection($_GET["sort_order"]);
794  $tbl->setLimit($_GET["limit"]);
795  $tbl->setOffset($_GET["offset"]);
796  $tbl->setMaxCount($this->maxcount); // ???
797 
798  // $this->tpl->setVariable("COLUMN_COUNTS", 5);
799 
800  // footer
801  //$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
802  $tbl->disable("footer");
803 
804  $tbl->setMaxCount(count($export_files));
805  $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
806 
807  $tbl->render();
808  if(count($export_files) > 0)
809  {
810  $i=0;
811  foreach($export_files as $exp_file)
812  {
813  $this->tpl->setCurrentBlock("tbl_content");
814  $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
815 
816  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
817  $this->tpl->setVariable("CSS_ROW", $css_row);
818 
819  $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
820  $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
821  $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"].":".$exp_file["file"]);
822 
823  $file_arr = explode("__", $exp_file["file"]);
824  $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s",$file_arr[0]));
825 
826  $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
827  $this->ctrl->setParameter($this, "type", $exp_file["type"]);
828  $this->tpl->setVariable("LINK_DOWNLOAD",
829  $this->ctrl->getLinkTarget($this, "downloadExportFile"));
830 
831  $this->tpl->parseCurrentBlock();
832  }
833  } //if is_array
834  else
835  {
836  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
837  $this->tpl->setVariable("NUM_COLS", 5);
838  $this->tpl->parseCurrentBlock();
839  }
840 
841  //$this->tpl->show();
842  }
$size
Definition: RandomTest.php:79
$_GET["client_id"]
$tbl
Definition: example_048.php:81
Class ilTableGUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ showTaxonomy()

ilGlossaryPresentationGUI::showTaxonomy ( )

Show taxonomy.

Parameters

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

References $lng, $tpl, ilObjTaxonomyGUI\getTreeHTML(), ilObjTaxonomy\getUsageOfObject(), and offlineMode().

Referenced by listDefinitions(), and listTerms().

1489  {
1490  global $tpl, $lng;
1491  if (!$this->offlineMode() && $this->glossary->getShowTaxonomy())
1492  {
1493  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1494  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->glossary->getId());
1495  if (count($tax_ids) > 0)
1496  {
1497  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
1498  $tax_exp = new ilTaxonomyExplorerGUI($this, "showTaxonomy", $tax_ids[0],
1499  "ilglossarypresentationgui", "listTerms");
1500  if (!$tax_exp->handleCommand())
1501  {
1502  //$tpl->setLeftNavContent($tax_exp->getHTML());
1503  $tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
1504  }
1505  return;
1506 
1507 
1508  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
1509  $tpl->setLeftNavContent(ilObjTaxonomyGUI::getTreeHTML($tax_ids[0],
1510  "ilglossarypresentationgui", "listTerms", $lng->txt("cont_all_topics")));
1511  }
1512  }
1513 
1514  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
Taxonomy explorer GUI class.
static getTreeHTML($a_tax_id, $a_class, $a_cmd, $a_target_class, $a_target_cmd, $a_root_node_title="")
Get tree html.
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

◆ $admin_tabs

ilGlossaryPresentationGUI::$admin_tabs

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

◆ $glossary

ilGlossaryPresentationGUI::$glossary

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

◆ $ilias

◆ $lng

◆ $tpl

ilGlossaryPresentationGUI::$tpl

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