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
23 // Get visible tabs for the format and check tab needs to be displayed.
24 $dt = glossary_get_visible_tabs($dp);
26 if (in_array(GLOSSARY_STANDARD
, $dt)) {
27 $browserow[] = new tabobject(GLOSSARY_STANDARD_VIEW
,
28 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=letter',
29 get_string('standardview', 'glossary'));
32 if (in_array(GLOSSARY_CATEGORY
, $dt)) {
33 $browserow[] = new tabobject(GLOSSARY_CATEGORY_VIEW
,
34 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=cat',
35 get_string('categoryview', 'glossary'));
38 if (in_array(GLOSSARY_DATE
, $dt)) {
39 $browserow[] = new tabobject(GLOSSARY_DATE_VIEW
,
40 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=date',
41 get_string('dateview', 'glossary'));
44 if (in_array(GLOSSARY_AUTHOR
, $dt)) {
45 $browserow[] = new tabobject(GLOSSARY_AUTHOR_VIEW
,
46 $CFG->wwwroot
.'/mod/glossary/view.php?id='.$id.'&mode=author',
47 get_string('authorview', 'glossary'));
50 if ($tab < GLOSSARY_STANDARD_VIEW ||
$tab > GLOSSARY_AUTHOR_VIEW
) { // We are on second row
51 $inactive = array('edit');
52 $activated = array('edit');
54 $browserow[] = new tabobject('edit', '#', get_string('edit'));
57 /// Put all this info together
60 $tabrows[] = $browserow; // Always put these at the top
62 $tabrows[] = $toolsrow;
66 <div
class="glossarydisplay">
70 if ($showcommonelements && (count($tabrows[0]) > 1)) {
71 print_tabs($tabrows, $tab, $inactive, $activated);
75 <div
class="entrybox">
79 if (!isset($category)) {
85 case GLOSSARY_CATEGORY_VIEW
:
86 glossary_print_categories_menu($cm, $glossary, $hook, $category);
88 case GLOSSARY_APPROVAL_VIEW
:
89 glossary_print_approval_menu($cm, $glossary, $mode, $hook, $sortkey, $sortorder);
91 case GLOSSARY_AUTHOR_VIEW
:
93 glossary_print_author_menu($cm, $glossary, "author", $hook, $sortkey, $sortorder, 'print');
95 case GLOSSARY_IMPORT_VIEW
:
98 glossary_print_import_menu($cm, $glossary, 'import', $hook, $sortkey, $sortorder);
100 case GLOSSARY_EXPORT_VIEW
:
103 glossary_print_export_menu($cm, $glossary, 'export', $hook, $sortkey, $sortorder);
105 case GLOSSARY_DATE_VIEW
:
112 glossary_print_alphabet_menu($cm, $glossary, "date", $hook, $sortkey, $sortorder);
114 case GLOSSARY_STANDARD_VIEW
:
116 glossary_print_alphabet_menu($cm, $glossary, "letter", $hook, $sortkey, $sortorder);
117 if ($mode == 'search' and $hook) {
118 echo html_writer
::tag('div', "$strsearch: $hook");
122 echo html_writer
::empty_tag('hr');