ILIAS  release_4-4 Revision
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 1444 of file class.ilGlossaryPresentationGUI.php.

References $ilCtrl.

1445  {
1446  global $ilCtrl;
1447 
1448  $ilCtrl->redirect($this, "listTerms");
1449  }
global $ilCtrl
Definition: ilias.php:18

◆ download_paragraph()

ilGlossaryPresentationGUI::download_paragraph ( )

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

References $_GET.

1346  {
1347  include_once("./Modules/Glossary/classes/class.ilGlossaryDefPage.php");
1348  $pg_obj = new ilGlossaryDefPage($_GET["pg_id"]);
1349  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
1350  }
$_GET["client_id"]
Glossary definition page object.

◆ downloadExportFile()

ilGlossaryPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

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

818  {
819  global $ilAccess, $ilias, $lng;
820 
821  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
822  {
823  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
824  }
825 
826  $file = $this->glossary->getPublicExportFile($_GET["type"]);
827  if ($this->glossary->getPublicExportFile($_GET["type"]) != "")
828  {
829  $dir = $this->glossary->getExportDirectory($_GET["type"]);
830  if (is_file($dir."/".$file))
831  {
832  ilUtil::deliverFile($dir."/".$file, $file);
833  exit;
834  }
835  }
836  $this->ilias->raiseError($this->lng->txt("file_not_found"),$this->ilias->error_obj->MESSAGE);
837  }
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 865 of file class.ilGlossaryPresentationGUI.php.

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

866  {
867  global $ilAccess, $ilias, $lng;
868 
869  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
870  {
871  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
872  }
873 
874  $file = explode("_", $_GET["file_id"]);
875  include_once("./Modules/File/classes/class.ilObjFile.php");
876  $fileObj =& new ilObjFile($file[count($file) - 1], false);
877  $fileObj->sendFile();
878  exit;
879  }
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 617 of file class.ilGlossaryPresentationGUI.php.

References media().

618  {
619  $html = $this->media("fullscreen");
620  return $html;
621  }
media($a_mode="media")
show media object
+ Here is the call graph for this function:

◆ getLink()

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

handles links for learning module presentation

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

References offlineMode().

Referenced by listDefinitions(), and media().

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

894  {
895 
896  if ($a_layoutframes == "")
897  {
898  $a_layoutframes = array();
899  }
900  $link_info = "<IntLinkInfos>";
901  foreach ($a_int_links as $int_link)
902  {
903 //echo "<br>+".$int_link["Type"]."+".$int_link["TargetFrame"]."+".$int_link["Target"]."+";
904  $target = $int_link["Target"];
905  if (substr($target, 0, 4) == "il__")
906  {
907  $target_arr = explode("_", $target);
908  $target_id = $target_arr[count($target_arr) - 1];
909  $type = $int_link["Type"];
910  $targetframe = ($int_link["TargetFrame"] != "")
911  ? $int_link["TargetFrame"]
912  : "None";
913 
914  // anchor
915  $anc = $anc_add = "";
916  if ($int_link["Anchor"] != "")
917  {
918  $anc = $int_link["Anchor"];
919  $anc_add = "_".rawurlencode($int_link["Anchor"]);
920  }
921 
922  if ($targetframe == "New")
923  {
924  $ltarget = "_blank";
925  }
926  else
927  {
928  $ltarget = "";
929  }
930 
931  switch($type)
932  {
933  case "PageObject":
934  case "StructureObject":
936  $cont_obj =& $this->content_object;
937  if ($type == "PageObject")
938  {
939  $href = "./goto.php?target=pg_".$target_id.$anc_add;
940  }
941  else
942  {
943  $href = "./goto.php?target=st_".$target_id;
944  }
945  //$ltarget = "ilContObj".$lm_id;
946  break;
947 
948  case "GlossaryItem":
949  if (ilGlossaryTerm::_lookGlossaryID($target_id) == $this->glossary->getId())
950  {
951  if ($this->offlineMode())
952  {
953  $href = "term_".$target_id.".html";
954  }
955  else
956  {
957  $this->ctrl->setParameter($this, "term_id", $target_id);
958  $href = $this->ctrl->getLinkTarget($this, "listDefinitions");
959  $href = str_replace("&", "&amp;", $href);
960  }
961  }
962  else
963  {
964  $href = "./goto.php?target=git_".$target_id;
965  }
966  break;
967 
968  case "MediaObject":
969  if ($this->offlineMode())
970  {
971  $href = "media_".$target_id.".html";
972  }
973  else
974  {
975  $this->ctrl->setParameter($this, "obj_type", $type);
976  $this->ctrl->setParameter($this, "mob_id", $target_id);
977  $href = $this->ctrl->getLinkTarget($this, "media");
978  $href = str_replace("&", "&amp;", $href);
979  }
980  break;
981 
982  case "RepositoryItem":
983  $obj_type = ilObject::_lookupType($target_id, true);
985  $href = "./goto.php?target=".$obj_type."_".$target_id;
986  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
987  $ltarget = $t_frame;
988  break;
989 
990  case "WikiPage":
991  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
993  break;
994  }
995 
996  $anc_par = 'Anchor="'.$anc.'"';
997 
998  $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
999  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
1000 
1001  $this->ctrl->clearParameters($this);
1002  }
1003  }
1004  $link_info.= "</IntLinkInfos>";
1005 
1006  return $link_info;
1007  }
$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 _getFrame($a_class, $a_type='')
Get content frame name.
offlineMode()
checks wether offline content generation is activated
_lookGlossaryID($term_id)
get glossary id form term id
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 1285 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by setTabs().

1286  {
1287  global $ilAccess, $lng, $ilCtrl, $ilHelp;
1288 
1289  $ilHelp->setScreenIdComponent("glo");
1290 
1291  $oldoffset = (is_numeric ($_GET["oldoffset"]))?$_GET["oldoffset"]:$_GET["offset"];
1292 
1293  if (!$this->offlineMode())
1294  {
1295  if ($this->ctrl->getCmd() != "listDefinitions")
1296  {
1297  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1298  {
1299  $tabs_gui->addTab("terms",
1300  $lng->txt("cont_terms"),
1301  $ilCtrl->getLinkTarget($this, "listTerms"));
1302  }
1303 
1304  $tabs_gui->addTab("info",
1305  $lng->txt("info_short"),
1306  $ilCtrl->getLinkTarget($this, "infoScreen"));
1307 
1308  $tabs_gui->addTab("print_view",
1309  $lng->txt("cont_print_view"),
1310  $ilCtrl->getLinkTarget($this, "printViewSelection"));
1311 
1312  // glossary menu
1313  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1314  {
1315  //if ($this->glossary->isActiveGlossaryMenu())
1316  //{
1317  // download links
1318  if ($this->glossary->isActiveDownloads())
1319  {
1320  $tabs_gui->addTab("download",
1321  $lng->txt("download"),
1322  $ilCtrl->getLinkTarget($this, "showDownloadList"));
1323  }
1324  //}
1325  }
1326 
1327  if ($ilAccess->checkAccess("write", "", (int) $_GET["ref_id"]) ||
1328  $ilAccess->checkAccess("edit_content", "", (int) $_GET["ref_id"]))
1329  {
1330  $tabs_gui->addNonTabbedLink("editing_view",
1331  $lng->txt("glo_editing_view"),
1332  "ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".(int) $_GET["ref_id"],
1333  "_top");
1334  }
1335 
1336  }
1337  }
1338  else
1339  {
1340  $tabs_gui->addTarget("cont_back",
1341  "index.html#term_".$this->term_id, "",
1342  "");
1343  }
1344  }
$_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) ...
_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 1358 of file class.ilGlossaryPresentationGUI.php.

References outputInfoScreen().

1359  {
1360  $this->ctrl->setCmd("showSummary");
1361  $this->ctrl->setCmdClass("ilinfoscreengui");
1362  $this->outputInfoScreen();
1363  }
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 1124 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by printViewSelection().

1125  {
1126  global $lng, $ilCtrl;
1127 
1128  $terms = $this->glossary->getTermList();
1129 
1130  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1131  $this->form = new ilPropertyFormGUI();
1132  $this->form->setTarget("print_view");
1133  $this->form->setFormAction($ilCtrl->getFormAction($this));
1134 
1135  // selection type
1136  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1137  $radg->setValue("glossary");
1138 
1139  // current term
1140  if ((int) $this->term_id > 0)
1141  {
1142  $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
1143  $radg->addOption($op1);
1144  $radg->setValue("term");
1145  }
1146 
1147  // whole glossary
1148  $op2 = new ilRadioOption($lng->txt("cont_whole_glossary")
1149  ." (".$lng->txt("cont_terms").": ".count($terms).")", "glossary");
1150  $radg->addOption($op2);
1151 
1152  // selected topic
1153  if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy())
1154  {
1155  $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
1156  $radg->addOption($op4);
1157 
1158  // topic drop down
1159  include_once("./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php");
1160  $si = new ilTaxAssignInputGUI($t_id, false, $lng->txt("cont_topic"), "topic",
1161  false);
1162  if ($this->tax_node > 0)
1163  {
1164  $si->setValue((int) $this->tax_node);
1165  }
1166  $op4->addSubItem($si);
1167 
1168  }
1169 
1170  // selected terms
1171  $op3= new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
1172  $radg->addOption($op3);
1173 
1174  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1175  $nl = new ilNestedListInputGUI("", "obj_id");
1176  $op3->addSubItem($nl);
1177 //var_dump($terms);
1178  foreach ($terms as $t)
1179  {
1180  $nl->addListNode($t["id"], $t["term"], 0, false, false);
1181  }
1182 
1183  $this->form->addItem($radg);
1184 
1185  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
1186 
1187  $this->form->setTitle($lng->txt("cont_print_selection"));
1188  }
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, $ilCtrl, $ilias, $ilUser, $lng, $ref_id, $tpl, 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("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_term_b.png"));
417  $tpl->setTitle($this->lng->txt("cont_term").": ".$term->getTerm());
418 
419  // load template for table
420  $tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", "Modules/Glossary");
421  }
422  else
423  {
424  $tpl = new ilTemplate("tpl.glossary_definition_list.html", true, true, "Modules/Glossary");
425  }
426 
427  $defs = ilGlossaryDefinition::getDefinitionList($term_id);
428 
429  $tpl->setVariable("TXT_TERM", $term->getTerm());
430  $this->mobs = array();
431 
432  for($j=0; $j<count($defs); $j++)
433  {
434  $def = $defs[$j];
435  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
436  $page_gui->setStyleId($this->glossary->getStyleSheetId());
437  $page = $page_gui->getPageObject();
438 
439  // internal links
440  $page->buildDom();
441  $int_links = $page->getInternalLinks();
442  $link_xml = $this->getLinkXML($int_links);
443  $page_gui->setLinkXML($link_xml);
444 
445  if ($this->offlineMode())
446  {
447  $page_gui->setOutputMode("offline");
448  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
449  }
450  $page_gui->setSourcecodeDownloadScript($this->getLink($ref_id));
451  $page_gui->setFullscreenLink($this->getLink($ref_id, "fullscreen", $term_id, $def["id"]));
452 
453  $page_gui->setTemplateOutput(false);
454  $page_gui->setRawPageContent(true);
455  $page_gui->setFileDownloadLink($this->getLink($ref_id, "downloadFile"));
456  if (!$this->offlineMode())
457  {
458  $output = $page_gui->preview();
459  }
460  else
461  {
462  $output = $page_gui->presentation($page_gui->getOutputMode());
463  }
464 
465  if (count($defs) > 1)
466  {
467  $tpl->setCurrentBlock("definition_header");
468  $tpl->setVariable("TXT_DEFINITION",
469  $this->lng->txt("cont_definition")." ".($j+1));
470  $tpl->parseCurrentBlock();
471  }
472 
473  $tpl->setCurrentBlock("definition");
474  $tpl->setVariable("PAGE_CONTENT", $output);
475  $tpl->parseCurrentBlock();
476  }
477 
478  // display possible backlinks
479  $sources = ilInternalLink::_getSourcesOfTarget('git',$_GET['term_id'],0);
480 
481  if ($sources)
482  {
483  $backlist_shown = false;
484  foreach ($sources as $src)
485  {
486  $type = explode(':',$src['type']);
487 
488  if ($type[0] == 'lm')
489  {
490  if ($type[1] == 'pg')
491  {
492  $title = ilLMPageObject::_getPresentationTitle($src['id']);
493  $lm_id = ilLMObject::_lookupContObjID($src['id']);
494  $lm_title = ilObject::_lookupTitle($lm_id);
495  $tpl->setCurrentBlock('backlink_item');
496  $ref_ids = ilObject::_getAllReferences($lm_id);
497  $access = false;
498  foreach($ref_ids as $rid)
499  {
500  if ($ilAccess->checkAccess("read", "", $rid))
501  {
502  $access = true;
503  }
504  }
505  if ($access)
506  {
507  $tpl->setCurrentBlock("backlink_item");
508  $tpl->setVariable("BACKLINK_LINK",ILIAS_HTTP_PATH."/goto.php?target=".$type[1]."_".$src['id']);
509  $tpl->setVariable("BACKLINK_ITEM",$lm_title.": ".$title);
510  $tpl->parseCurrentBlock();
511  $backlist_shown = true;
512  }
513  }
514  }
515  }
516  if ($backlist_shown)
517  {
518  $tpl->setCurrentBlock("backlink_list");
519  $tpl->setVariable("BACKLINK_TITLE",$this->lng->txt('glo_term_used_in'));
520  $tpl->parseCurrentBlock();
521  }
522  }
523 
524  if (!$a_get_html)
525  {
526  $tpl->setCurrentBlock("perma_link");
527  $tpl->setVariable("PERMA_LINK", ILIAS_HTTP_PATH.
528  "/goto.php?target=".
529  "git".
530  "_".$term_id."_".$ref_id."&client_id=".CLIENT_ID);
531  $tpl->setVariable("TXT_PERMA_LINK", $this->lng->txt("perma_link"));
532  $tpl->setVariable("PERMA_TARGET", "_top");
533  $tpl->parseCurrentBlock();
534  }
535 
536  // highlighting?
537  if ($_GET["srcstring"] != "" && !$this->offlineMode())
538  {
539  include_once './Services/Search/classes/class.ilUserSearchCache.php';
540  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
541  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
542  $search_string = $cache->getQuery();
543 
544  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
545  include_once("./Services/Search/classes/class.ilQueryParser.php");
546  $p = new ilQueryParser($search_string);
547  $p->parse();
548 
549  $words = $p->getQuotedWords();
550  if (is_array($words))
551  {
552  foreach ($words as $w)
553  {
554  ilTextHighlighterGUI::highlight("ilGloContent", $w, $tpl);
555  }
556  }
557  $this->fill_on_load_code = true;
558  }
559 
560  if ($this->offlineMode() || $a_get_html)
561  {
562  return $tpl->get();
563  }
564  }
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
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
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 626 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by fullscreen().

627  {
628  $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
629  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
630  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
631  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
632  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
633 
634  //$int_links = $page_object->getInternalLinks();
635  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
636 
637  // later
638  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
639 
640  $link_xlm = "";
641 
642  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
643  $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
644 
645  $xml = "<dummy>";
646  // todo: we get always the first alias now (problem if mob is used multiple
647  // times in page)
648  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
649  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
650  $xml.= $link_xml;
651  $xml.="</dummy>";
652 
653  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
654  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
655  $xh = xslt_create();
656 
657  if (!$this->offlineMode())
658  {
659  $enlarge_path = ilUtil::getImagePath("enlarge.png", false, "output");
660  $wb_path = ilUtil::getWebspaceDir("output")."/";
661  }
662  else
663  {
664  $enlarge_path = "images/enlarge.png";
665  $wb_path = "";
666  }
667 
668  $mode = $a_mode;
669 
670  $this->ctrl->setParameter($this, "obj_type", "MediaObject");
671  $fullscreen_link =
672  $this->getLink($_GET["ref_id"], "fullscreen");
673  $this->ctrl->clearParameters($this);
674 
675  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
676  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
677  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
678  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
679  echo xslt_error($xh);
680  xslt_free($xh);
681 
682  // unmask user html
683  $this->tpl->setVariable("MEDIA_CONTENT", $output);
684 
685  $this->tpl->parseCurrentBlock();
686  if ($this->offlineMode())
687  {
688  $html = $this->tpl->get();
689  return $html;
690  }
691 
692  }
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)
xslt_process(&$proc, $xml_var, $xslt_var, $dummy, $args, $params, $a_no_warnings=false)
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
+ 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 1377 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by executeCommand(), and infoScreen().

1378  {
1379  global $ilBench, $ilAccess, $ilTabs;
1380 
1381  $this->setTabs();
1382  $ilTabs->activateTab("info");
1383  $this->lng->loadLanguageModule("meta");
1384 
1385  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1386 
1387  $info = new ilInfoScreenGUI($this->glossary_gui);
1388  $info->enablePrivateNotes();
1389  //$info->enableLearningProgress();
1390 
1391  $info->enableNews();
1392  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1393  {
1394  $info->enableNewsEditing();
1395  $news_set = new ilSetting("news");
1396  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1397  if ($enable_internal_rss)
1398  {
1399  $info->setBlockProperty("news", "settings", true);
1400  }
1401  }
1402 
1403  // add read / back button
1404  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1405  {
1406  /*
1407  if ($_GET["obj_id"] > 0)
1408  {
1409  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
1410  $info->addButton($this->lng->txt("back"),
1411  $this->ctrl->getLinkTarget($this, "layout"));
1412  }
1413  else
1414  {
1415  $info->addButton($this->lng->txt("view"),
1416  $this->ctrl->getLinkTarget($this, "layout"));
1417  }*/
1418  }
1419 
1420  // show standard meta data section
1421  $info->addMetaDataSections($this->glossary->getId(),0, $this->glossary->getType());
1422 
1423  include_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
1424  ilObjGlossaryGUI::addUsagesToInfo($info, $this->glossary->getId());
1425 
1426  if ($this->offlineMode())
1427  {
1428  $this->tpl->setContent($info->getHTML());
1429  return $this->tpl->get();
1430  }
1431  else
1432  {
1433  // forward the command
1434  $this->ctrl->forwardCommand($info);
1435  }
1436  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
$_GET["client_id"]
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_b.png"));
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 1196 of file class.ilGlossaryPresentationGUI.php.

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

1197  {
1198  global $ilAccess, $tpl;
1199 
1200  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1201  {
1202  return;
1203  }
1204 
1205  $terms = array();
1206  switch ($_POST["sel_type"])
1207  {
1208  case "glossary":
1209  $ts = $this->glossary->getTermList();
1210  foreach ($ts as $t)
1211  {
1212  $terms[] = $t["id"];
1213  }
1214  break;
1215 
1216  case "sel_topic":
1217  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1218  $t_id = $this->glossary->getTaxonomyId();
1219  $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]);
1220  foreach ($items as $i)
1221  {
1222  if ($i["item_type"] == "term")
1223  {
1224  $terms[] = $i["item_id"];
1225  }
1226  }
1227  break;
1228 
1229  case "selection":
1230  if (is_array($_POST["obj_id"]))
1231  {
1232  $terms = $_POST["obj_id"];
1233  }
1234  else
1235  {
1236  $terms = array();
1237  }
1238  break;
1239 
1240  case "term":
1241  $terms = array($this->term_id);
1242  break;
1243  }
1244 
1245  $tpl = new ilTemplate("tpl.main.html", true, true);
1246  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1247 
1248 /*
1249  // syntax style
1250  $this->tpl->setCurrentBlock("SyntaxStyle");
1251  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1252  ilObjStyleSheet::getSyntaxStylePath());
1253  $this->tpl->parseCurrentBlock();
1254 
1255  // content style
1256  $this->tpl->setCurrentBlock("ContentStyle");
1257  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1258  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
1259  $this->tpl->parseCurrentBlock();*/
1260 
1261  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1263 
1264  // determine target frames for internal links
1265 
1266  foreach ($terms as $t_id)
1267  {
1268  $page_content.= $this->listDefinitions($_GET["ref_id"], $t_id, true);
1269  }
1270  $tpl->setVariable("CONTENT", $page_content.
1271  '<script type="text/javascript" language="javascript1.2">
1272  <!--
1273  il.Util.addOnLoad(function () {
1274  il.Util.print();
1275  });
1276  //-->
1277  </script>');
1278  $tpl->show(false);
1279  exit;
1280  }
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 1097 of file class.ilGlossaryPresentationGUI.php.

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

1098  {
1099  global $ilUser, $lng, $ilToolbar, $ilCtrl, $tpl, $ilTabs;
1100 
1101  $ilCtrl->saveParameter($this, "term_id");
1102 
1103  if ((int) $this->term_id == 0)
1104  {
1105  $this->setTabs();
1106  $ilTabs->activateTab("print_view");
1107  }
1108  else
1109  {
1110  $tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
1111  $term = new ilGlossaryTerm((int) $this->term_id);
1112  $tpl->setTitle($this->lng->txt("cont_term").": ".$term->getTerm());
1113  $this->showDefinitionTabs("print_view");
1114  }
1115 
1116  $this->initPrintViewSelectionForm();
1117 
1118  $tpl->setContent($this->form->getHTML());
1119  }
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 846 of file class.ilGlossaryPresentationGUI.php.

Referenced by listDefinitions(), and prepareOutput().

847  {
848  //$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
849  require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
850  $gloss_loc =& new ilGlossaryLocatorGUI();
851  $gloss_loc->setMode("presentation");
852  if (!empty($this->term_id))
853  {
854  $term =& new ilGlossaryTerm($this->term_id);
855  $gloss_loc->setTerm($term);
856  }
857  $gloss_loc->setGlossary($this->glossary);
858  //$gloss_loc->setDefinition($this->definition);
859  $gloss_loc->display();
860  }
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 884 of file class.ilGlossaryPresentationGUI.php.

References getTabs().

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

885  {
886  global $ilTabs;
887  $this->getTabs($ilTabs);
888  }
+ 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 572 of file class.ilGlossaryPresentationGUI.php.

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

Referenced by listDefinitions(), and printViewSelection().

573  {
574  global $ilTabs, $lng, $ilCtrl;
575 
576  if (!$this->offlineMode())
577  {
578  $ilCtrl->setParameter($this, "term_id", "");
579  $this->ctrl->setParameter($this, "offset", $_GET["offset"]);
580  if (!empty ($_REQUEST["term"]))
581  {
582  $this->ctrl->setParameter($this, "term", $_REQUEST["term"]);
583  $this->ctrl->setParameter($this, "oldoffset", $_GET["oldoffset"]);
584  $back = $ilCtrl->getLinkTarget($this, "searchTerms");
585  }
586  else
587  {
588  $back = $ilCtrl->getLinkTarget($this, "listTerms");
589  }
590  $ilCtrl->setParameter($this, "term_id", $this->term_id);
591  $ilCtrl->saveParameter($this, "term_id");
592 
593  $ilTabs->setBackTarget($this->lng->txt("obj_glo"), $back);
594 
595  $ilTabs->addTab("content",
596  $lng->txt("content"),
597  $ilCtrl->getLinkTarget($this, "listDefinitions"));
598 
599  $ilTabs->addTab("print_view",
600  $lng->txt("print_view"),
601  $ilCtrl->getLinkTarget($this, "printViewSelection"));
602 
603  $ilCtrl->setParameterByClass("ilglossarytermgui", "term_id", $this->term_id);
604  $ilTabs->addNonTabbedLink("editing_view",
605  $lng->txt("glo_editing_view"),
606  $ilCtrl->getLinkTargetByClass(array("ilglossaryeditorgui", "ilobjglossarygui", "ilglossarytermgui"), "listDefinitions"));
607  //"ilias.php?baseClass=ilGlossaryEditorGUI&amp;ref_id=".$_GET["ref_id"]."&amp;edit_term=".$this->term_id);
608 
609  $ilTabs->activateTab($a_act);
610  }
611  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 697 of file class.ilGlossaryPresentationGUI.php.

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

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

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

Referenced by listTerms().

1458  {
1459  global $tpl, $lng;
1460  if (!$this->offlineMode() && $this->glossary->getShowTaxonomy())
1461  {
1462  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1463  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->glossary->getId());
1464  if (count($tax_ids) > 0)
1465  {
1466  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
1467  $tax_exp = new ilTaxonomyExplorerGUI($this, "showTaxonomy", $tax_ids[0],
1468  "ilglossarypresentationgui", "listTerms");
1469  if (!$tax_exp->handleCommand())
1470  {
1471  //$tpl->setLeftNavContent($tax_exp->getHTML());
1472  $tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
1473  }
1474  return;
1475 
1476 
1477  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
1478  $tpl->setLeftNavContent(ilObjTaxonomyGUI::getTreeHTML($tax_ids[0],
1479  "ilglossarypresentationgui", "listTerms", $lng->txt("cont_all_topics")));
1480  }
1481  }
1482 
1483  }
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: