mod-forum MDL-19808 Added set_url calls, replaced deprecated functions
[moodle.git] / mod / glossary / view.php
CommitLineData
4528ab53 1<?php // $Id$
07842023 2/// This page prints a particular instance of glossary
07842023 3 require_once("../../config.php");
4 require_once("lib.php");
48b29ba4 5 require_once("$CFG->libdir/rsslib.php");
2dda0bbb 6
aa813941 7 $id = optional_param('id', 0, PARAM_INT); // Course Module ID
8 $g = optional_param('g', 0, PARAM_INT); // Glossary ID
67905ace 9
aa813941 10 $tab = optional_param('tab', GLOSSARY_NO_VIEW, PARAM_ALPHA); // browsing entries by categories?
11 $displayformat = optional_param('displayformat',-1, PARAM_INT); // override of the glossary display format
767a31c3 12
f7f735b8 13 $mode = optional_param('mode', '', PARAM_ALPHA); // term entry cat date letter search author approval
14 $hook = optional_param('hook', '', PARAM_CLEAN); // the term, entry, cat, etc... to look for based on mode
aa813941 15 $fullsearch = optional_param('fullsearch', 0,PARAM_INT); // full search (concept and definition) when searching?
1d33f652 16 $sortkey = optional_param('sortkey', '', PARAM_ALPHA);// Sorted view: CREATION | UPDATE | FIRSTNAME | LASTNAME...
aa813941 17 $sortorder = optional_param('sortorder', 'ASC', PARAM_ALPHA); // it defines the order of the sorting (ASC or DESC)
18 $offset = optional_param('offset', 0,PARAM_INT); // entries to bypass (for paging purposes)
19 $page = optional_param('page', 0,PARAM_INT); // Page to show (for paging purposes)
20 $show = optional_param('show', '', PARAM_ALPHA); // [ concept | alias ] => mode=term hook=$show
8a2fe407 21
67905ace 22 if (!empty($id)) {
f9d5371b 23 if (! $cm = get_coursemodule_from_id('glossary', $id)) {
8a274bcd 24 print_error('invalidcoursemodule');
fe32b4f6 25 }
ae8c3566 26 if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
8a274bcd 27 print_error('coursemisconf');
fe32b4f6 28 }
ae8c3566 29 if (! $glossary = $DB->get_record("glossary", array("id"=>$cm->instance))) {
8a274bcd 30 print_error('invalidid', 'glossary');
fe32b4f6 31 }
49bcd737 32
67905ace 33 } else if (!empty($g)) {
ae8c3566 34 if (! $glossary = $DB->get_record("glossary", array("id"=>$g))) {
8a274bcd 35 print_error('invalidid', 'glossary');
fe32b4f6 36 }
ae8c3566 37 if (! $course = $DB->get_record("course", array("id"=>$glossary->course))) {
8a274bcd 38 print_error('invalidcourseid');
fe32b4f6 39 }
67905ace 40 if (!$cm = get_coursemodule_from_instance("glossary", $glossary->id, $course->id)) {
8a274bcd 41 print_error('invalidcoursemodule');
67905ace 42 }
359f2758 43 $id = $cm->id;
67905ace 44 } else {
8a274bcd 45 print_error('invalidid', 'glossary');
67905ace 46 }
7856dd59 47
ab397f26 48 require_course_login($course->id, true, $cm);
dabfd0ed 49 $context = get_context_instance(CONTEXT_MODULE, $cm->id);
bbbf2d40 50
a983f05a 51/// Loading the textlib singleton instance. We are going to need it.
52 $textlib = textlib_get_instance();
53
1ac87c73 54/// redirecting if adding a new entry
55 if ($tab == GLOSSARY_ADDENTRY_VIEW ) {
49bcd737 56 redirect("edit.php?cmid=$cm->id&amp;mode=$mode");
1ac87c73 57 }
58
59/// setting the defaut number of entries per page if not set
fe32b4f6 60
1ac87c73 61 if ( !$entriesbypage = $glossary->entbypage ) {
4f3e59c3 62 $entriesbypage = $CFG->glossary_entbypage;
1ac87c73 63 }
64
e2cf5316 65/// If we have received a page, recalculate offset
66 if ($page != 0 && $offset == 0) {
67 $offset = $page * $entriesbypage;
68 }
69
0dafa92b 70/// setting the default values for the display mode of the current glossary
71/// only if the glossary is viewed by the first time
ae8c3566 72 if ( $dp = $DB->get_record('glossary_formats', array('name'=>$glossary->displayformat)) ) {
f7f735b8 73 /// Based on format->defaultmode, we build the defaulttab to be showed sometimes
74 switch ($dp->defaultmode) {
75 case 'cat':
76 $defaulttab = GLOSSARY_CATEGORY_VIEW;
77 break;
78 case 'date':
79 $defaulttab = GLOSSARY_DATE_VIEW;
80 break;
81 case 'author':
82 $defaulttab = GLOSSARY_AUTHOR_VIEW;
83 break;
84 default:
85 $defaulttab = GLOSSARY_STANDARD_VIEW;
86 }
87 /// Fetch the rest of variables
0dafa92b 88 $printpivot = $dp->showgroup;
89 if ( $mode == '' and $hook == '' and $show == '') {
90 $mode = $dp->defaultmode;
91 $hook = $dp->defaulthook;
92 $sortkey = $dp->sortkey;
fe32b4f6 93 $sortorder = $dp->sortorder;
0dafa92b 94 }
95 } else {
f7f735b8 96 $defaulttab = GLOSSARY_STANDARD_VIEW;
0dafa92b 97 $printpivot = 1;
b6862360 98 if ( $mode == '' and $hook == '' and $show == '') {
99 $mode = 'letter';
100 $hook = 'ALL';
101 }
0dafa92b 102 }
103
104 if ( $displayformat == -1 ) {
105 $displayformat = $glossary->displayformat;
fe32b4f6 106 }
1ac87c73 107
0dafa92b 108 if ( $show ) {
109 $mode = 'term';
110 $hook = $show;
111 $show = '';
112 }
1ac87c73 113/// Processing standard security processes
1936c10e 114 if ($course->id != SITEID) {
34fb0651 115 require_login($course->id);
116 }
81e956b9 117 if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)) {
e6855d1a 118 echo $OUTPUT->header();
fb443f1a 119 notice(get_string("activityiscurrentlyhidden"));
fe32b4f6 120 }
839f2456 121 add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id&amp;tab=$tab", $glossary->id, $cm->id);
c197e607 122
1ac87c73 123/// stablishing flag variables
c76e673a 124 if ( $sortorder = strtolower($sortorder) ) {
c197e607 125 if ($sortorder != 'asc' and $sortorder != 'desc') {
126 $sortorder = '';
767a31c3 127 }
128 }
c76e673a 129 if ( $sortkey = strtoupper($sortkey) ) {
fe32b4f6 130 if ($sortkey != 'CREATION' and
131 $sortkey != 'UPDATE' and
132 $sortkey != 'FIRSTNAME' and
c4a35419 133 $sortkey != 'LASTNAME'
134 ) {
c197e607 135 $sortkey = '';
c76e673a 136 }
767a31c3 137 }
1d9ddaaf 138
1ac87c73 139 switch ( $mode = strtolower($mode) ) {
140 case 'search': /// looking for terms containing certain word(s)
141 $tab = GLOSSARY_STANDARD_VIEW;
c76e673a 142
0fd4f407 143 //Clean a bit the search string
144 $hook = trim(strip_tags($hook));
74a27855 145
1ac87c73 146 break;
fe32b4f6 147
1ac87c73 148 case 'entry': /// Looking for a certain entry id
ea14e783 149 $tab = GLOSSARY_STANDARD_VIEW;
ae8c3566 150 if ( $dp = $DB->get_record("glossary_formats", array("name"=>$glossary->displayformat)) ) {
a359c29b 151 $displayformat = $dp->popupformatname;
0dafa92b 152 }
1ac87c73 153 break;
fe32b4f6 154
1ac87c73 155 case 'cat': /// Looking for a certain cat
156 $tab = GLOSSARY_CATEGORY_VIEW;
157 if ( $hook > 0 ) {
ae8c3566 158 $category = $DB->get_record("glossary_categories", array("id"=>$hook));
1ac87c73 159 }
160 break;
c76e673a 161
1ac87c73 162 case 'approval': /// Looking for entries waiting for approval
163 $tab = GLOSSARY_APPROVAL_VIEW;
164 if ( !$hook and !$sortkey and !$sortorder) {
165 $hook = 'ALL';
c197e607 166 }
1ac87c73 167 break;
168
169 case 'term': /// Looking for entries that include certain term in its concept, definition or aliases
170 $tab = GLOSSARY_STANDARD_VIEW;
171 break;
172
173 case 'date':
174 $tab = GLOSSARY_DATE_VIEW;
175 if ( !$sortkey ) {
176 $sortkey = 'UPDATE';
fe32b4f6 177 }
1ac87c73 178 if ( !$sortorder ) {
179 $sortorder = 'desc';
180 }
181 break;
fe32b4f6 182
1ac87c73 183 case 'author': /// Looking for entries, browsed by author
184 $tab = GLOSSARY_AUTHOR_VIEW;
185 if ( !$hook ) {
186 $hook = 'ALL';
fe32b4f6 187 }
c4a35419 188 if ( !$sortkey ) {
189 $sortkey = 'FIRSTNAME';
fe32b4f6 190 }
c4a35419 191 if ( !$sortorder ) {
192 $sortorder = 'asc';
193 }
1ac87c73 194 break;
195
196 case 'letter': /// Looking for entries that begin with a certain letter, ALL or SPECIAL characters
197 default:
198 $tab = GLOSSARY_STANDARD_VIEW;
199 if ( !$hook ) {
fe32b4f6 200 $hook = 'ALL';
201 }
1ac87c73 202 break;
fe32b4f6 203 }
1ac87c73 204
205 switch ( $tab ) {
fe32b4f6 206 case GLOSSARY_IMPORT_VIEW:
207 case GLOSSARY_EXPORT_VIEW:
1ac87c73 208 case GLOSSARY_APPROVAL_VIEW:
ab397f26 209 $showcommonelements = 0;
1ac87c73 210 break;
fe32b4f6 211
1ac87c73 212 default:
ab397f26 213 $showcommonelements = 1;
1ac87c73 214 break;
215 }
216
217/// Printing the heading
86183b07 218 $strglossaries = get_string("modulenameplural", "glossary");
219 $strglossary = get_string("modulename", "glossary");
220 $strallcategories = get_string("allcategories", "glossary");
221 $straddentry = get_string("addentry", "glossary");
222 $strnoentries = get_string("noentries", "glossary");
223 $strsearchconcept = get_string("searchconcept", "glossary");
224 $strsearchindefinition = get_string("searchindefinition", "glossary");
225 $strsearch = get_string("search");
ab397f26 226 $strwaitingapproval = get_string('waitingapproval', 'glossary');
227
228/// If we are in approval mode, prit special header
e6855d1a 229 $PAGE->set_title(format_string($glossary->name));
230 $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
0961861e 231 $url = new moodle_url($CFG->wwwroot.'/mod/glossary/view.php', array('id'=>$cm->id));
232 if (isset($mode)) {
233 $url->param('mode', $mode);
234 }
235 $PAGE->set_url($url);
ab397f26 236 if ($tab == GLOSSARY_APPROVAL_VIEW) {
237 require_capability('mod/glossary:approve', $context);
e6855d1a 238 $PAGE->navbar->add($strwaitingapproval);
239 echo $OUTPUT->header();
2d8e042e 240 echo $OUTPUT->heading($strwaitingapproval);
e6855d1a 241 } else { /// Print standard header
242 echo $OUTPUT->header();
136ce8de 243 }
244
dd232d01 245/// All this depends if whe have $showcommonelements
ab397f26 246 if ($showcommonelements) {
247 /// To calculate available options
248 $availableoptions = '';
249
250 /// Decide about to print the import link
251 if (has_capability('mod/glossary:import', $context)) {
252 $availableoptions = '<span class="helplink">' .
253 '<a href="' . $CFG->wwwroot . '/mod/glossary/import.php?id=' . $cm->id . '"' .
254 ' title="' . s(get_string('importentries', 'glossary')) . '">' .
255 get_string('importentries', 'glossary') . '</a>' .
256 '</span>';
257 }
258 /// Decide about to print the export link
259 if (has_capability('mod/glossary:export', $context)) {
136ce8de 260 if ($availableoptions) {
ab397f26 261 $availableoptions .= '&nbsp;/&nbsp;';
f4646b44 262 }
136ce8de 263 $availableoptions .='<span class="helplink">' .
dd232d01 264 '<a href="' . $CFG->wwwroot . '/mod/glossary/export.php?id=' . $cm->id .
ab397f26 265 '&amp;mode='.$mode . '&amp;hook=' . urlencode($hook) . '"' .
266 ' title="' . s(get_string('exportentries', 'glossary')) . '">' .
267 get_string('exportentries', 'glossary') . '</a>' .
136ce8de 268 '</span>';
2dda0bbb 269 }
5bd9aa93 270
ab397f26 271 /// Decide about to print the approval link
272 if (has_capability('mod/glossary:approve', $context)) {
273 /// Check we have pending entries
ae8c3566 274 if ($hiddenentries = $DB->count_records('glossary_entries', array('glossaryid'=>$glossary->id, 'approved'=>0))) {
ab397f26 275 if ($availableoptions) {
276 $availableoptions .= '<br />';
277 }
278 $availableoptions .='<span class="helplink">' .
dd232d01 279 '<a href="' . $CFG->wwwroot . '/mod/glossary/view.php?id=' . $cm->id .
ab397f26 280 '&amp;mode=approval' . '"' .
281 ' title="' . s(get_string('waitingapproval', 'glossary')) . '">' .
282 get_string('waitingapproval', 'glossary') . ' ('.$hiddenentries.')</a>' .
283 '</span>';
284 }
136ce8de 285 }
ab397f26 286
287 /// Start to print glossary controls
52ea8aa0 288// print_box_start('glossarycontrol clearfix');
289 echo '<div class="glossarycontrol" style="text-align: right">';
ab397f26 290 echo $availableoptions;
291
292 /// If rss are activated at site and glossary level and this glossary has rss defined, show link
293 if (isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
294 $CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds && $glossary->rsstype && $glossary->rssarticles) {
dd232d01 295
ab397f26 296 $tooltiptext = get_string("rsssubscriberss","glossary",format_string($glossary->name,true));
297 if (empty($USER->id)) {
298 $userid = 0;
299 } else {
300 $userid = $USER->id;
301 }
52ea8aa0 302// print_box_start('rsslink');
303 echo '<span class="wrap rsslink">';
ab397f26 304 rss_print_link($course->id, $userid, "glossary", $glossary->id, $tooltiptext);
52ea8aa0 305 echo '</span>';
306// print_box_end();
41c98028 307 }
4f4ca7b5 308
ab397f26 309 /// The print icon
310 if ( $showcommonelements and $mode != 'search') {
311 if (has_capability('mod/glossary:manageentries', $context) or $glossary->allowprintview) {
52ea8aa0 312// print_box_start('printicon');
313 echo '<span class="wrap printicon">';
5bd76d7f 314 echo " <a title =\"". get_string("printerfriendly","glossary") ."\" href=\"print.php?id=$cm->id&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
52ea8aa0 315 echo '</span>';
316// print_box_end();
ab397f26 317 }
318 }
319 /// End glossary controls
52ea8aa0 320// print_box_end(); /// glossarycontrol
321 echo '</div>';
49bcd737 322
52ea8aa0 323// print_box('&nbsp;', 'clearer');
ab397f26 324 }
d3709d95 325
7dd88447 326/// Info box
4ba2221a 327 if ($glossary->intro && $showcommonelements) {
9f555b8f 328 echo $OUTPUT->box(format_module_intro('glossary', $glossary, $cm->id), 'generalbox', 'intro');
c76e673a 329 }
7dd88447 330
86183b07 331/// Search box
ab397f26 332 if ($showcommonelements ) {
333 echo '<form method="post" action="view.php">';
52159a0d 334
5bd76d7f 335 echo '<table class="boxaligncenter" width="70%" border="0">';
ab397f26 336 echo '<tr><td align="center" class="glossarysearchbox">';
fe32b4f6 337
ab397f26 338 echo '<input type="submit" value="'.$strsearch.'" name="searchbutton" /> ';
339 if ($mode == 'search') {
340 echo '<input type="text" name="hook" size="20" value="'.s($hook).'" alt="'.$strsearch.'" /> ';
341 } else {
342 echo '<input type="text" name="hook" size="20" value="" alt="'.$strsearch.'" /> ';
343 }
344 if ($fullsearch || $mode != 'search') {
345 $fullsearchchecked = 'checked="checked"';
346 } else {
347 $fullsearchchecked = '';
348 }
097d705e 349 echo '<input type="checkbox" name="fullsearch" id="fullsearch" value="1" '.$fullsearchchecked.' />';
ab397f26 350 echo '<input type="hidden" name="mode" value="search" />';
351 echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
097d705e 352 echo '<label for="fullsearch">'.$strsearchindefinition.'</label>';
ab397f26 353 echo '</td></tr></table>';
fe32b4f6 354
ab397f26 355 echo '</form>';
66111853 356
ab397f26 357 echo '<br />';
358 }
66111853 359
360/// Show the add entry button if allowed
ab397f26 361 if (has_capability('mod/glossary:write', $context) && $showcommonelements ) {
66111853 362 echo '<div class="singlebutton glossaryaddentry">';
363 echo "<form id=\"newentryform\" method=\"get\" action=\"$CFG->wwwroot/mod/glossary/edit.php\">";
364 echo '<div>';
49bcd737 365 echo "<input type=\"hidden\" name=\"cmid\" value=\"$cm->id\" />";
366 echo '<input type="submit" value="'.get_string('addentry', 'glossary').'" />';
66111853 367 echo '</div>';
368 echo '</form>';
369 echo "</div>\n";
370 }
371
d23e2291 372 echo '<br />';
fb443f1a 373
49bcd737 374 require("tabs.php");
07842023 375
49bcd737 376 require("sql.php");
fe32b4f6 377
1ac87c73 378/// printing the entries
1ac87c73 379 $entriesshown = 0;
380 $currentpivot = '';
16527801 381 $ratingsmenuused = NULL;
382 $paging = NULL;
539f698d 383
86183b07 384 if ($allentries) {
539f698d 385
7fe60b0c 386 //Decide if we must show the ALL link in the pagebar
387 $specialtext = '';
388 if ($glossary->showall) {
389 $specialtext = get_string("allentries","glossary");
390 }
391
392 //Build paging bar
49bcd737 393 $paging = glossary_get_paging_bar($count, $page, $entriesbypage, "view.php?id=$id&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;fullsearch=$fullsearch&amp;",9999,10,'&nbsp;&nbsp;', $specialtext, -1);
db87439a 394
dfa5ff4f 395 echo '<div class="paging">';
66d7ae88 396 echo $paging;
e2cf5316 397 echo '</div>';
1ac87c73 398
63dd5fb2 399 $ratings = NULL;
400 $ratingsmenuused = false;
d08e1a0b 401 if ($glossary->assessed and isloggedin() and !isguestuser()) {
402 $ratings = new object();
63dd5fb2 403 if ($ratings->scale = make_grades_menu($glossary->scale)) {
404 $ratings->assesstimestart = $glossary->assesstimestart;
405 $ratings->assesstimefinish = $glossary->assesstimefinish;
63dd5fb2 406 }
0468976c 407 if ($glossary->assessed == 2 and !has_capability('mod/glossary:rate', $context)) {
37d543b5 408 $ratings->allow = false;
409 } else {
410 $ratings->allow = true;
411 }
5bd76d7f 412 $formsent = 1;
eee75231 413
b7dc2256 414 echo "<form method=\"post\" action=\"rate.php\">";
5bd76d7f 415 echo "<div>";
dd232d01 416 echo "<input type=\"hidden\" name=\"glossaryid\" value=\"$glossary->id\" />";
63dd5fb2 417 }
418
07842023 419 foreach ($allentries as $entry) {
539f698d 420
30691fc3 421 // Setting the pivot for the current entry
1d4d001c 422 $pivot = $entry->glossarypivot;
810944af 423 $upperpivot = $textlib->strtoupper($pivot);
30691fc3 424 // Reduce pivot to 1cc if necessary
1ac87c73 425 if ( !$fullpivot ) {
810944af 426 $upperpivot = $textlib->substr($upperpivot, 0, 1);
dd232d01 427 }
428
30691fc3 429 // if there's a group break
71235154 430 if ( $currentpivot != $upperpivot ) {
539f698d 431
432 // print the group break if apply
433 if ( $printpivot ) {
71235154 434 $currentpivot = $upperpivot;
539f698d 435
d3709d95 436 echo '<div>';
c988beb5 437 echo '<table cellspacing="0" class="glossarycategoryheader">';
539f698d 438
439 echo '<tr>';
440 $pivottoshow = $currentpivot;
8451166c 441 if ( isset($entry->userispivot) ) {
539f698d 442 // printing the user icon if defined (only when browsing authors)
120a18f0 443 echo '<th align="left">';
fe32b4f6 444
ae8c3566 445 $user = $DB->get_record("user", array("id"=>$entry->userid));
0b36c948 446 echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
d02eeded 447 $pivottoshow = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
539f698d 448 } else {
097d705e 449 echo '<th >';
c76e673a 450 }
c4a35419 451
2d8e042e 452 echo $OUTPUT->heading($pivottoshow);
120a18f0 453 echo "</th></tr></table></div>\n";
c4a35419 454
539f698d 455 }
1ac87c73 456 }
fe32b4f6 457
539f698d 458 $concept = $entry->concept;
459 $definition = $entry->definition;
1ac87c73 460
539f698d 461 /// highlight the term if necessary
462 if ($mode == 'search') {
fddeb22f 463 //We have to strip any word starting by + and take out words starting by -
464 //to make highlight works properly
465 $searchterms = explode(' ', $hook); // Search for words independently
466 foreach ($searchterms as $key => $searchterm) {
467 if (preg_match('/^\-/',$searchterm)) {
468 unset($searchterms[$key]);
469 } else {
470 $searchterms[$key] = preg_replace('/^\+/','',$searchterm);
471 }
0fd4f407 472 //Avoid highlight of <2 len strings. It's a well known hilight limitation.
473 if (strlen($searchterm) < 2) {
474 unset($searchterms[$key]);
475 }
fddeb22f 476 }
477 $strippedsearch = implode(' ', $searchterms); // Rebuild the string
478 $entry->highlight = $strippedsearch;
fe32b4f6 479 }
b1918034 480
539f698d 481 /// and finally print the entry.
fe32b4f6 482
539f698d 483 if ( glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat,$ratings) ) {
484 $ratingsmenuused = true;
1ac87c73 485 }
539f698d 486
487 $entriesshown++;
de1fe384 488 }
1ac87c73 489 }
490 if ( !$entriesshown ) {
ee9e63b5 491 echo $OUTPUT->box(get_string("noentries","glossary"), "generalbox boxaligncenter boxwidthwide");
1ac87c73 492 }
63dd5fb2 493
d23e2291 494
63dd5fb2 495 if ($ratingsmenuused) {
5bd76d7f 496
36a2b6bd 497 echo "<div class=\"boxaligncenter\"><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\" />";
63dd5fb2 498 if ($glossary->scale < 0) {
ae8c3566 499 if ($scale = $DB->get_record("scale", array("id"=>abs($glossary->scale)))) {
8c7ddcaf 500 echo $OUTPUT->help_button(help_button::make_scale_menu($course->id, $scale));
63dd5fb2 501 }
502 }
dd232d01 503 echo "</div>";
eee75231 504 }
d08e1a0b 505
506 if (!empty($formsent)) {
507 // close the form properly if used
5bd76d7f 508 echo "</div>";
dd232d01 509 echo "</form>";
63dd5fb2 510 }
dd232d01 511
66d7ae88 512 if ( $paging ) {
e2cf5316 513 echo '<hr />';
dfa5ff4f 514 echo '<div class="paging">';
e2cf5316 515 echo $paging;
516 echo '</div>';
66d7ae88 517 }
d23e2291 518 echo '<br />';
86183b07 519 glossary_print_tabbed_table_end();
0dafa92b 520
db87439a 521/// Finish the page
0578c9a2 522 echo $OUTPUT->footer();
db87439a 523
18a2a0cb 524/// Mark as viewed
525 $completion=new completion_info($course);
526 $completion->set_module_viewed($cm);
e24d96ba 527?>