2 if (!isset($sortorder)) {
5 if (!isset($sortkey)) {
9 //make sure variables are properly cleaned
10 $sortkey = clean_param($sortkey, PARAM_ALPHA
);// Sorted view: CREATION | UPDATE | FIRSTNAME | LASTNAME...
11 $sortorder = clean_param($sortorder, PARAM_ALPHA
); // it defines the order of the sorting (ASC or DESC)
18 if (!has_capability('mod/glossary:approve', $context) && $tab == GLOSSARY_APPROVAL_VIEW
) {
19 /// Non-teachers going to approval view go to defaulttab
24 $browserow[] = new tabobject(GLOSSARY_STANDARD_VIEW
,
25 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=letter',
26 get_string('standardview', 'glossary'));
28 $browserow[] = new tabobject(GLOSSARY_CATEGORY_VIEW
,
29 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=cat',
30 get_string('categoryview', 'glossary'));
32 $browserow[] = new tabobject(GLOSSARY_DATE_VIEW
,
33 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=date',
34 get_string('dateview', 'glossary'));
36 $browserow[] = new tabobject(GLOSSARY_AUTHOR_VIEW
,
37 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=author',
38 get_string('authorview', 'glossary'));
40 if ($tab < GLOSSARY_STANDARD_VIEW ||
$tab > GLOSSARY_AUTHOR_VIEW
) { // We are on second row
41 $inactive = array('edit');
42 $activated = array('edit');
44 $browserow[] = new tabobject('edit', '#', get_string('edit'));
47 /// Put all this info together
50 $tabrows[] = $browserow; // Always put these at the top
52 $tabrows[] = $toolsrow;
57 <div
class="glossarydisplay">
60 <?php
if ($showcommonelements) { print_tabs($tabrows, $tab, $inactive, $activated); } ?
>
62 <div
class="entrybox">
66 if (!isset($category)) {
72 case GLOSSARY_CATEGORY_VIEW
:
73 glossary_print_categories_menu($cm, $glossary, $hook, $category);
75 case GLOSSARY_APPROVAL_VIEW
:
76 glossary_print_approval_menu($cm, $glossary, $mode, $hook, $sortkey, $sortorder);
78 case GLOSSARY_AUTHOR_VIEW
:
80 glossary_print_author_menu($cm, $glossary, "author", $hook, $sortkey, $sortorder, 'print');
82 case GLOSSARY_IMPORT_VIEW
:
85 glossary_print_import_menu($cm, $glossary, 'import', $hook, $sortkey, $sortorder);
87 case GLOSSARY_EXPORT_VIEW
:
90 glossary_print_export_menu($cm, $glossary, 'export', $hook, $sortkey, $sortorder);
92 case GLOSSARY_DATE_VIEW
:
99 glossary_print_alphabet_menu($cm, $glossary, "date", $hook, $sortkey, $sortorder);
101 case GLOSSARY_STANDARD_VIEW
:
103 glossary_print_alphabet_menu($cm, $glossary, "letter", $hook, $sortkey, $sortorder);
104 if ($mode == 'search' and $hook) {
105 echo "<h3>$strsearch: $hook</h3>";