ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilGlossaryPresentationGUI Class Reference

Class ilGlossaryPresentationGUI. More...

+ Collaboration diagram for ilGlossaryPresentationGUI:

Public Member Functions

 ilGlossaryPresentationGUI ()
 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 ($term_list, $filter="")
 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)
 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 (&$tabs_gui)
 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

Member Function Documentation

◆ applyFilter()

ilGlossaryPresentationGUI::applyFilter ( )

Apply filter.

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

References getPresentationTable(), and listTerms().

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

◆ chooseLetter()

ilGlossaryPresentationGUI::chooseLetter ( )

Choose first letter.

Parameters

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

References $ilCtrl.

1461  {
1462  global $ilCtrl;
1463 
1464  $ilCtrl->redirect($this, "listTerms");
1465  }
global $ilCtrl
Definition: ilias.php:18

◆ download_paragraph()

ilGlossaryPresentationGUI::download_paragraph ( )

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

References $_GET.

1362  {
1363  include_once("./Modules/Glossary/classes/class.ilGlossaryDefPage.php");
1364  $pg_obj = new ilGlossaryDefPage($_GET["pg_id"]);
1365  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
1366  }
$_GET["client_id"]
Glossary definition page object.

◆ downloadExportFile()

ilGlossaryPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

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

832  {
833  global $ilAccess, $ilias, $lng;
834 
835  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
836  {
837  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
838  }
839 
840  $file = $this->glossary->getPublicExportFile($_GET["type"]);
841  if ($this->glossary->getPublicExportFile($_GET["type"]) != "")
842  {
843  $dir = $this->glossary->getExportDirectory($_GET["type"]);
844  if (is_file($dir."/".$file))
845  {
846  ilUtil::deliverFile($dir."/".$file, $file);
847  exit;
848  }
849  }
850  $this->ilias->raiseError($this->lng->txt("file_not_found"),$this->ilias->error_obj->MESSAGE);
851  }
print $file
exit
Definition: login.php:54
$_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.
+ Here is the call graph for this function:

◆ downloadFile()

ilGlossaryPresentationGUI::downloadFile ( )

download file of file lists

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

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

880  {
881  global $ilAccess, $ilias, $lng;
882 
883  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
884  {
885  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
886  }
887 
888  $file = explode("_", $_GET["file_id"]);
889  include_once("./Modules/File/classes/class.ilObjFile.php");
890  $fileObj =& new ilObjFile($file[count($file) - 1], false);
891  $fileObj->sendFile();
892  exit;
893  }
print $file
exit
Definition: login.php:54
$_GET["client_id"]
Class ilObjFile.

◆ executeCommand()

ilGlossaryPresentationGUI::executeCommand ( )

execute command

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

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

118  {
119  global $lng, $ilAccess, $ilias;
120 
121  $lng->loadLanguageModule("content");
122 
123  $next_class = $this->ctrl->getNextClass($this);
124  $cmd = $this->ctrl->getCmd("listTerms");
125 
126  // check write permission
127  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) &&
128  !($ilAccess->checkAccess("visible", "", $_GET["ref_id"]) &&
129  ($cmd == "infoScreen" || strtolower($next_class) == "ilinfoscreengui")))
130  {
131  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
132  }
133 
134  if ($cmd != "listDefinitions")
135  {
136  $this->prepareOutput();
137  }
138 
139  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
140  if(IS_PAYMENT_ENABLED == true
141  && (ilPaymentObject::_requiresPurchaseToAccess($_GET["ref_id"], $type = (isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL) )))
142  {
143  $this->tpl->getStandardTemplate();
144 
145  include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
146  $pp = new ilShopPurchaseGUI((int)$_GET['ref_id']);
147  $ret = $this->ctrl->forwardCommand($pp);
148  }
149  else
150  {
151  switch($next_class)
152  {
153  case "ilnotegui":
154  $this->setTabs();
155  $ret =& $this->listDefinitions();
156  break;
157 
158  case "ilinfoscreengui":
159  $ret =& $this->outputInfoScreen();
160  break;
161 
162  case "ilpresentationlisttablegui":
163  $prtab = $this->getPresentationTable();
164  $this->ctrl->forwardCommand($prtab);
165  return;
166  break;
167 
168  default:
169  $ret =& $this->$cmd();
170  break;
171  }
172  }
173  $this->tpl->show();
174  }
$_GET["client_id"]
Class ilShopPurchaseGUI.
$cmd
Definition: sahs_server.php:35
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false)
list definitions of a term
outputInfoScreen()
info screen call from inside learning module
getPresentationTable()
Get presentation table.
+ Here is the call graph for this function:

◆ fullscreen()

ilGlossaryPresentationGUI::fullscreen ( )

show fullscreen view

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

References $html, and media().

633  {
634  $html = $this->media("fullscreen");
635  return $html;
636  }
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 1027 of file class.ilGlossaryPresentationGUI.php.

References offlineMode().

Referenced by listDefinitions(), and media().

1029  {
1030  if ($a_cmd == "")
1031  {
1032  $a_cmd = "layout";
1033  }
1034  //$script = "glossary_presentation.php";
1035 
1036  // handle online links
1037  if (!$this->offlineMode())
1038  {
1039  //$link = $script."?ref_id=".$a_ref_id;
1040  switch ($a_cmd)
1041  {
1042  case "fullscreen":
1043  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1044  $link = $this->ctrl->getLinkTarget($this, "fullscreen");
1045  break;
1046 
1047  default:
1048  $link.= "&cmd=".$a_cmd;
1049  if ($a_frame != "")
1050  {
1051  $this->ctrl->setParameter($this, "frame", $a_frame);
1052  }
1053  if ($a_obj_id != "")
1054  {
1055  switch ($a_type)
1056  {
1057  case "MediaObject":
1058  $this->ctrl->setParameter($this, "mob_id", $a_obj_id);
1059  break;
1060 
1061  default:
1062  $this->ctrl->setParameter($this, "def_id", $a_def_id);
1063  break;
1064  }
1065  }
1066  if ($a_type != "")
1067  {
1068  $this->ctrl->setParameter($this, "obj_type", $a_type);
1069  }
1070  $link = $this->ctrl->getLinkTarget($this, $a_cmd);
1071 // $link = str_replace("&", "&", $link);
1072  break;
1073  }
1074  }
1075  else // handle offline links
1076  {
1077  switch ($a_cmd)
1078  {
1079  case "downloadFile":
1080  break;
1081 
1082  case "fullscreen":
1083  $link = "fullscreen.html"; // id is handled by xslt
1084  break;
1085 
1086  case "layout":
1087  break;
1088 
1089  case "glossary":
1090  $link = "term_".$a_obj_id.".html";
1091  break;
1092 
1093  case "media":
1094  $link = "media_".$a_obj_id.".html";
1095  break;
1096 
1097  default:
1098  break;
1099  }
1100  }
1101  $this->ctrl->clearParameters($this);
1102  return $link;
1103  }
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 907 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by listDefinitions().

908  {
909 
910  if ($a_layoutframes == "")
911  {
912  $a_layoutframes = array();
913  }
914  $link_info = "<IntLinkInfos>";
915  foreach ($a_int_links as $int_link)
916  {
917 //echo "<br>+".$int_link["Type"]."+".$int_link["TargetFrame"]."+".$int_link["Target"]."+";
918  $target = $int_link["Target"];
919  if (substr($target, 0, 4) == "il__")
920  {
921  $target_arr = explode("_", $target);
922  $target_id = $target_arr[count($target_arr) - 1];
923  $type = $int_link["Type"];
924  $targetframe = ($int_link["TargetFrame"] != "")
925  ? $int_link["TargetFrame"]
926  : "None";
927 
928  // anchor
929  $anc = $anc_add = "";
930  if ($int_link["Anchor"] != "")
931  {
932  $anc = $int_link["Anchor"];
933  $anc_add = "_".rawurlencode($int_link["Anchor"]);
934  }
935 
936  if ($targetframe == "New")
937  {
938  $ltarget = "_blank";
939  }
940  else
941  {
942  $ltarget = "";
943  }
944 
945  switch($type)
946  {
947  case "PageObject":
948  case "StructureObject":
950  $cont_obj =& $this->content_object;
951  if ($type == "PageObject")
952  {
953  $href = "./goto.php?target=pg_".$target_id.$anc_add;
954  }
955  else
956  {
957  $href = "./goto.php?target=st_".$target_id;
958  }
959  //$ltarget = "ilContObj".$lm_id;
960  break;
961 
962  case "GlossaryItem":
963  if (ilGlossaryTerm::_lookGlossaryID($target_id) == $this->glossary->getId())
964  {
965  if ($this->offlineMode())
966  {
967  $href = "term_".$target_id.".html";
968  }
969  else
970  {
971  $this->ctrl->setParameter($this, "term_id", $target_id);
972  $href = $this->ctrl->getLinkTarget($this, "listDefinitions");
973  $href = str_replace("&", "&amp;", $href);
974  }
975  }
976  else
977  {
978  $href = "./goto.php?target=git_".$target_id;
979  }
980  break;
981 
982  case "MediaObject":
983  if ($this->offlineMode())
984  {
985  $href = "media_".$target_id.".html";
986  }
987  else
988  {
989  $this->ctrl->setParameter($this, "obj_type", $type);
990  $this->ctrl->setParameter($this, "mob_id", $target_id);
991  $href = $this->ctrl->getLinkTarget($this, "media");
992  $href = str_replace("&", "&amp;", $href);
993  }
994  break;
995 
996  case "RepositoryItem":
997  $obj_type = ilObject::_lookupType($target_id, true);
999  $href = "./goto.php?target=".$obj_type."_".$target_id;
1000  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
1001  $ltarget = $t_frame;
1002  break;
1003 
1004  case "WikiPage":
1005  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1007  break;
1008  }
1009 
1010  $anc_par = 'Anchor="'.$anc.'"';
1011 
1012  $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
1013  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
1014 
1015  $this->ctrl->clearParameters($this);
1016  }
1017  }
1018  $link_info.= "</IntLinkInfos>";
1019 
1020  return $link_info;
1021  }
$target_arr
Definition: goto.php:86
$target_id
Definition: goto.php:88
static _lookupObjId($a_id)
_lookupContObjID($a_id)
get learning module / digibook id for lm object
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 108 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions().

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

◆ getPresentationTable()

ilGlossaryPresentationGUI::getPresentationTable ( )

Get presentation table.

Parameters

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

References offlineMode().

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

301  {
302  include_once("./Modules/Glossary/classes/class.ilPresentationListTableGUI.php");
303  $table = new ilPresentationListTableGUI($this, "listTerms", $this->glossary,
304  $this->offlineMode(), $this->tax_node, $this->glossary->getTaxonomyId());
305  return $table;
306  }
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 ( $tabs_gui)

get tabs

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

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

Referenced by setTabs().

1301  {
1302  global $ilAccess, $lng, $ilCtrl, $ilHelp;
1303 
1304  $ilHelp->setScreenIdComponent("glo");
1305 
1306  $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
1307 
1308  if (!$this->offlineMode())
1309  {
1310  if ($this->ctrl->getCmd() != "listDefinitions")
1311  {
1312  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1313  {
1314  $tabs_gui->addTab("terms",
1315  $lng->txt("cont_terms"),
1316  $ilCtrl->getLinkTarget($this, "listTerms"));
1317  }
1318 
1319  $tabs_gui->addTab("info",
1320  $lng->txt("info_short"),
1321  $ilCtrl->getLinkTarget($this, "infoScreen"));
1322 
1323  $tabs_gui->addTab("print_view",
1324  $lng->txt("cont_print_view"),
1325  $ilCtrl->getLinkTarget($this, "printViewSelection"));
1326 
1327  // glossary menu
1328  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1329  {
1330  //if ($this->glossary->isActiveGlossaryMenu())
1331  //{
1332  // download links
1333  if ($this->glossary->isActiveDownloads())
1334  {
1335  $tabs_gui->addTab("download",
1336  $lng->txt("download"),
1337  $ilCtrl->getLinkTarget($this, "showDownloadList"));
1338  }
1339  //}
1340  }
1341 
1342  if ($ilAccess->checkAccess("write", "", (int) $_GET["ref_id"]) ||
1343  $ilAccess->checkAccess("edit_content", "", (int) $_GET["ref_id"]))
1344  {
1345  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1346  $tabs_gui->addNonTabbedLink("editing_view",
1347  $lng->txt("glo_editing_view"),
1348  "ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".(int) $_GET["ref_id"],
1349  "_top");
1350  }
1351 
1352  }
1353  }
1354  else
1355  {
1356  $tabs_gui->addTarget("cont_back",
1357  "index.html#term_".$this->term_id, "",
1358  "");
1359  }
1360  }
$_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:

◆ ilGlossaryPresentationGUI()

ilGlossaryPresentationGUI::ilGlossaryPresentationGUI ( )

Constructor public.

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

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

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

References outputInfoScreen().

1375  {
1376  $this->ctrl->setCmd("showSummary");
1377  $this->ctrl->setCmdClass("ilinfoscreengui");
1378  $this->outputInfoScreen();
1379  }
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 1138 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by printViewSelection().

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

list definitions of a term

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

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

Referenced by executeCommand(), and printView().

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

list glossary terms

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

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

Referenced by listTerms().

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

References $_GET, $ilCtrl, $ilias, $lng, $ret, listTermByGiven(), offlineMode(), ilAlphabetInputGUI\setLetters(), and showTaxonomy().

Referenced by applyFilter(), and resetFilter().

192  {
193  global $ilNavigationHistory, $ilAccess, $ilias, $lng, $ilToolbar, $ilCtrl, $ilTabs;
194 
195 
196  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
197  {
198  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
199  }
200 
201  if (!$this->offlineMode())
202  {
203  $ilNavigationHistory->addItem($_GET["ref_id"],
204  $this->ctrl->getLinkTarget($this, "listTerms"), "glo");
205 
206  // alphabetical navigation
207  include_once("./Services/Form/classes/class.ilAlphabetInputGUI.php");
208  $ai = new ilAlphabetInputGUI($lng->txt("glo_quick_navigation"), "first");
209  $ai->setLetters($this->glossary->getFirstLetters($this->tax_node));
210  $ai->setParentCommand($this, "chooseLetter");
211  $ai->setHighlighted($_GET["letter"]);
212  $ilToolbar->addInputItem($ai, true);
213 
214  }
215 
216 // $term_list = $this->glossary->getTermList();
217 
218  $ret = $this->listTermByGiven($term_list);
219  $ilCtrl->setParameter($this, "term_id", "");
220 
221  $ilTabs->activateTab("terms");
222 
223  // show taxonomy
224  $this->showTaxonomy();
225 
226  return $ret;
227  }
$_GET["client_id"]
This class represents a text property in a property form.
global $ilCtrl
Definition: ilias.php:18
listTermByGiven($term_list, $filter="")
list glossary terms
offlineMode()
checks wether offline content generation is activated
setLetters($a_val)
Set letters available.
+ 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 641 of file class.ilGlossaryPresentationGUI.php.

References $_GET, $html, $params, 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().

642  {
643  $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
644  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
645  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
646  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
647  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
648 
649  //$int_links = $page_object->getInternalLinks();
650  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
651 
652  // later
653  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
654 
655  $link_xlm = "";
656 
657  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
658  $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
659 
660  $xml = "<dummy>";
661  // todo: we get always the first alias now (problem if mob is used multiple
662  // times in page)
663  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
664  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
665  $xml.= $link_xml;
666  $xml.="</dummy>";
667 
668  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
669  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
670  $xh = xslt_create();
671 
672  if (!$this->offlineMode())
673  {
674  $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
675  $wb_path = ilUtil::getWebspaceDir("output")."/";
676  }
677  else
678  {
679  $enlarge_path = "images/enlarge.svg";
680  $wb_path = "";
681  }
682 
683  $mode = $a_mode;
684 
685  $this->ctrl->setParameter($this, "obj_type", "MediaObject");
686  $fullscreen_link =
687  $this->getLink($_GET["ref_id"], "fullscreen");
688  $this->ctrl->clearParameters($this);
689 
690  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
691  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
692  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
693  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
694  echo xslt_error($xh);
695  xslt_free($xh);
696 
697  // unmask user html
698  $this->tpl->setVariable("MEDIA_CONTENT", $output);
699 
700  $this->tpl->parseCurrentBlock();
701  if ($this->offlineMode())
702  {
703  $html = $this->tpl->get();
704  return $html;
705  }
706 
707  }
xslt_create()
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)
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.
_getMapAreasIntLinks($a_mob_id)
get all internal links of map areas of a mob
const IL_MODE_ALIAS
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 91 of file class.ilGlossaryPresentationGUI.php.

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

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

◆ outputInfoScreen()

ilGlossaryPresentationGUI::outputInfoScreen ( )

info screen call from inside learning module

info screen

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

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

Referenced by executeCommand(), and infoScreen().

1394  {
1395  global $ilBench, $ilAccess, $ilTabs;
1396 
1397  $this->setTabs();
1398  $ilTabs->activateTab("info");
1399  $this->lng->loadLanguageModule("meta");
1400 
1401  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1402 
1403  $info = new ilInfoScreenGUI($this->glossary_gui);
1404  $info->enablePrivateNotes();
1405  //$info->enableLearningProgress();
1406 
1407  $info->enableNews();
1408  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1409  {
1410  $info->enableNewsEditing();
1411  $news_set = new ilSetting("news");
1412  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1413  if ($enable_internal_rss)
1414  {
1415  $info->setBlockProperty("news", "settings", true);
1416  }
1417  }
1418 
1419  // add read / back button
1420  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1421  {
1422  /*
1423  if ($_GET["obj_id"] > 0)
1424  {
1425  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
1426  $info->addButton($this->lng->txt("back"),
1427  $this->ctrl->getLinkTarget($this, "layout"));
1428  }
1429  else
1430  {
1431  $info->addButton($this->lng->txt("view"),
1432  $this->ctrl->getLinkTarget($this, "layout"));
1433  }*/
1434  }
1435 
1436  // show standard meta data section
1437  $info->addMetaDataSections($this->glossary->getId(),0, $this->glossary->getType());
1438 
1439  include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
1440  ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1441 
1442  if ($this->offlineMode())
1443  {
1444  $this->tpl->setContent($info->getHTML());
1445  return $this->tpl->get();
1446  }
1447  else
1448  {
1449  // forward the command
1450  $this->ctrl->forwardCommand($info);
1451  }
1452  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
$_GET["client_id"]
$info
Definition: example_052.php:80
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 176 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by executeCommand().

177  {
178  $this->tpl->getStandardTemplate();
179  $title = $this->glossary->getTitle();
180 
181  $this->tpl->setTitle($title);
182  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
183 
184  $this->setLocator();
185  }
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 1211 of file class.ilGlossaryPresentationGUI.php.

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

1212  {
1213  global $ilAccess, $tpl;
1214 
1215  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1216  {
1217  return;
1218  }
1219 
1220  $terms = array();
1221  switch ($_POST["sel_type"])
1222  {
1223  case "glossary":
1224  $ts = $this->glossary->getTermList();
1225  foreach ($ts as $t)
1226  {
1227  $terms[] = $t["id"];
1228  }
1229  break;
1230 
1231  case "sel_topic":
1232  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1233  $t_id = $this->glossary->getTaxonomyId();
1234  $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]);
1235  foreach ($items as $i)
1236  {
1237  if ($i["item_type"] == "term")
1238  {
1239  $terms[] = $i["item_id"];
1240  }
1241  }
1242  break;
1243 
1244  case "selection":
1245  if (is_array($_POST["obj_id"]))
1246  {
1247  $terms = $_POST["obj_id"];
1248  }
1249  else
1250  {
1251  $terms = array();
1252  }
1253  break;
1254 
1255  case "term":
1256  $terms = array($this->term_id);
1257  break;
1258  }
1259 
1260  $tpl = new ilTemplate("tpl.main.html", true, true);
1261  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1262 
1263 /*
1264  // syntax style
1265  $this->tpl->setCurrentBlock("SyntaxStyle");
1266  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1267  ilObjStyleSheet::getSyntaxStylePath());
1268  $this->tpl->parseCurrentBlock();
1269 
1270  // content style
1271  $this->tpl->setCurrentBlock("ContentStyle");
1272  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1273  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
1274  $this->tpl->parseCurrentBlock();*/
1275 
1276  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1278 
1279  // determine target frames for internal links
1280 
1281  foreach ($terms as $t_id)
1282  {
1283  $page_content.= $this->listDefinitions($_GET["ref_id"], $t_id, true);
1284  }
1285  $tpl->setVariable("CONTENT", $page_content.
1286  '<script type="text/javascript" language="javascript1.2">
1287  <!--
1288  il.Util.addOnLoad(function () {
1289  il.Util.print();
1290  });
1291  //-->
1292  </script>');
1293  $tpl->show(false);
1294  exit;
1295  }
exit
Definition: login.php:54
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
listDefinitions($a_ref_id=0, $a_term_id=0, $a_get_html=false)
list definitions of a term
special template class to simplify handling of ITX/PEAR
getContentPrintStyle()
get content print style
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.
+ Here is the call graph for this function:

◆ printViewSelection()

ilGlossaryPresentationGUI::printViewSelection ( )

Print view selection.

Parameters

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

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

1112  {
1113  global $ilUser, $lng, $ilToolbar, $ilCtrl, $tpl, $ilTabs;
1114 
1115  $ilCtrl->saveParameter($this, "term_id");
1116 
1117  if ((int) $this->term_id == 0)
1118  {
1119  $this->setTabs();
1120  $ilTabs->activateTab("print_view");
1121  }
1122  else
1123  {
1124  $tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
1125  $term = new ilGlossaryTerm((int) $this->term_id);
1126  $tpl->setTitle($this->lng->txt("cont_term").": ".$term->getTerm());
1127  $this->showDefinitionTabs("print_view");
1128  }
1129 
1130  $this->initPrintViewSelectionForm();
1131 
1132  $tpl->setContent($this->form->getHTML());
1133  }
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)
global $ilUser
Definition: imgupload.php:15
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 326 of file class.ilGlossaryPresentationGUI.php.

References getPresentationTable(), and listTerms().

327  {
328  $prtab = $this->getPresentationTable();
329  $prtab->resetOffset();
330  $prtab->resetFilter();
331  $this->listTerms();
332  }
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 860 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions(), and prepareOutput().

861  {
862  //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
863  require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
864  $gloss_loc =& new ilGlossaryLocatorGUI();
865  $gloss_loc->setMode("presentation");
866  if (!empty($this->term_id))
867  {
868  $term =& new ilGlossaryTerm($this->term_id);
869  $gloss_loc->setTerm($term);
870  }
871  $gloss_loc->setGlossary($this->glossary);
872  //$gloss_loc->setDefinition($this->definition);
873  $gloss_loc->display();
874  }
Class ilGlossaryTerm.
+ Here is the caller graph for this function:

◆ setOfflineDirectory()

ilGlossaryPresentationGUI::setOfflineDirectory (   $a_dir)

Set offline directory.

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

100  {
101  $this->offline_dir = $a_dir;
102  }

◆ setOfflineMode()

ilGlossaryPresentationGUI::setOfflineMode (   $a_offline = true)

set offline mode (content is generated for offline package)

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

84  {
85  $this->offline = $a_offline;
86  }

◆ setTabs()

ilGlossaryPresentationGUI::setTabs ( )

output tabs

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

References getTabs().

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

899  {
900  global $ilTabs;
901  $this->getTabs($ilTabs);
902  }
+ 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 582 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by listDefinitions(), and printViewSelection().

583  {
584  global $ilTabs, $lng, $ilCtrl, $ilHelp;
585 
586  if (!$this->offlineMode())
587  {
588  $ilHelp->setScreenIdComponent("glo");
589 
590  $ilCtrl->setParameter($this, "term_id", "");
591  $this->ctrl->setParameter($this, "offset", $_GET["offset"]);
592  if (!empty ($_REQUEST["term"]))
593  {
594  $this->ctrl->setParameter($this, "term", $_REQUEST["term"]);
595  $this->ctrl->setParameter($this, "oldoffset", $_GET["oldoffset"]);
596  $back = $ilCtrl->getLinkTarget($this, "searchTerms");
597  }
598  else
599  {
600  $back = $ilCtrl->getLinkTarget($this, "listTerms");
601  }
602  $ilCtrl->setParameter($this, "term_id", $this->term_id);
603  $ilCtrl->saveParameter($this, "term_id");
604 
605  $ilTabs->setBackTarget($this->lng->txt("obj_glo"), $back);
606 
607  $ilTabs->addTab("term_content",
608  $lng->txt("content"),
609  $ilCtrl->getLinkTarget($this, "listDefinitions"));
610 
611  $ilTabs->addTab("print_view",
612  $lng->txt("print_view"),
613  $ilCtrl->getLinkTarget($this, "printViewSelection"));
614 
615  $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $this->term_id);
616  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
617  if (ilGlossaryTerm::_lookGlossaryID($this->term_id) == $this->glossary->getId())
618  {
619  $ilTabs->addNonTabbedLink("editing_view",
620  $lng->txt("glo_editing_view"),
621  $ilCtrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui"), "listDefinitions"));
622  //"ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".$_GET["ref_id"]."&amp;edit_term=".$this->term_id);
623  }
624  $ilTabs->activateTab($a_act);
625  }
626  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _lookGlossaryID($term_id)
get glossary id form term id
offlineMode()
checks wether offline content generation is activated
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 712 of file class.ilGlossaryPresentationGUI.php.

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

713  {
714  global $ilBench, $ilAccess, $ilias, $lng, $ilTabs;
715 
716  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
717  {
718  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
719  }
720 
721  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.glo_download_list.html", "Modules/Glossary");
722 
723  $this->setTabs();
724  $ilTabs->activateTab("download");
725 
726  // set title header
727  $this->tpl->setTitle($this->glossary->getTitle());
728  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
729 
730  // create table
731  require_once("./Services/Table/classes/class.ilTableGUI.php");
732  $tbl = new ilTableGUI();
733 
734  // load files templates
735  $this->tpl->addBlockfile("DOWNLOAD_TABLE", "download_table", "tpl.table.html");
736 
737  // load template for table content data
738  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/Glossary");
739 
740  $export_files = array();
741  $types = array("xml", "html");
742  foreach($types as $type)
743  {
744  if ($this->glossary->getPublicExportFile($type) != "")
745  {
746  $dir = $this->glossary->getExportDirectory($type);
747  if (is_file($this->glossary->getExportDirectory($type)."/".
748  $this->glossary->getPublicExportFile($type)))
749  {
750  $size = filesize($this->glossary->getExportDirectory($type)."/".
751  $this->glossary->getPublicExportFile($type));
752  $export_files[] = array("type" => $type,
753  "file" => $this->glossary->getPublicExportFile($type),
754  "size" => $size);
755  }
756  }
757  }
758 
759  $num = 0;
760 
761  $tbl->setTitle($this->lng->txt("download"));
762 
763  $tbl->setHeaderNames(array($this->lng->txt("cont_format"),
764  $this->lng->txt("cont_file"),
765  $this->lng->txt("size"), $this->lng->txt("date"),
766  ""));
767 
768  $cols = array("format", "file", "size", "date", "download");
769  $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
770  "cmd" => "showDownloadList", "cmdClass" => strtolower(get_class($this)));
771  $tbl->setHeaderVars($cols, $header_params);
772  $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
773  $tbl->disable("sort");
774 
775  // control
776  $tbl->setOrderColumn($_GET["sort_by"]);
777  $tbl->setOrderDirection($_GET["sort_order"]);
778  $tbl->setLimit($_GET["limit"]);
779  $tbl->setOffset($_GET["offset"]);
780  $tbl->setMaxCount($this->maxcount); // ???
781 
782  // $this->tpl->setVariable("COLUMN_COUNTS", 5);
783 
784  // footer
785  //$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
786  $tbl->disable("footer");
787 
788  $tbl->setMaxCount(count($export_files));
789  $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
790 
791  $tbl->render();
792  if(count($export_files) > 0)
793  {
794  $i=0;
795  foreach($export_files as $exp_file)
796  {
797  $this->tpl->setCurrentBlock("tbl_content");
798  $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
799 
800  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
801  $this->tpl->setVariable("CSS_ROW", $css_row);
802 
803  $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
804  $this->tpl->setVariable("TXT_FORMAT", strtoupper($exp_file["type"]));
805  $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"].":".$exp_file["file"]);
806 
807  $file_arr = explode("__", $exp_file["file"]);
808  $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s",$file_arr[0]));
809 
810  $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
811  $this->ctrl->setParameter($this, "type", $exp_file["type"]);
812  $this->tpl->setVariable("LINK_DOWNLOAD",
813  $this->ctrl->getLinkTarget($this, "downloadExportFile"));
814 
815  $this->tpl->parseCurrentBlock();
816  }
817  } //if is_array
818  else
819  {
820  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
821  $this->tpl->setVariable("NUM_COLS", 5);
822  $this->tpl->parseCurrentBlock();
823  }
824 
825  //$this->tpl->show();
826  }
$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)
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 1473 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by listTerms().

1474  {
1475  global $tpl, $lng;
1476  if (!$this->offlineMode() && $this->glossary->getShowTaxonomy())
1477  {
1478  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1479  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->glossary->getId());
1480  if (count($tax_ids) > 0)
1481  {
1482  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
1483  $tax_exp = new ilTaxonomyExplorerGUI($this, "showTaxonomy", $tax_ids[0],
1484  "ilglossarypresentationgui", "listTerms");
1485  if (!$tax_exp->handleCommand())
1486  {
1487  //$tpl->setLeftNavContent($tax_exp->getHTML());
1488  $tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
1489  }
1490  return;
1491 
1492 
1493  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
1494  $tpl->setLeftNavContent(ilObjTaxonomyGUI::getTreeHTML($tax_ids[0],
1495  "ilglossarypresentationgui", "listTerms", $lng->txt("cont_all_topics")));
1496  }
1497  }
1498 
1499  }
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


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