forked from mudrd8mz/moodle-mod_stampcoll
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tabs.php
35 lines (31 loc) · 1.21 KB
/
tabs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php // $Id$
/**
* Prints navigation tabs in the Stamp Collection module
*
* @uses Variables $cap_* defined in {@link mod/stampcoll/caps.php}
* @author David Mudrak
* @package mod/stampcoll
*/
if (empty($currenttab) or empty($stampcoll) or empty($context) or empty($cm)) {
die('You cannot call this script in that way');
}
$inactive = NULL;
$activetwo = NULL;
$tabs = array();
$row = array();
if ($cap_viewotherstamps) {
$row[] = new tabobject('view', $CFG->wwwroot.'/mod/stampcoll/view.php?id='.$cm->id,
get_string('viewstamps','stampcoll'));
}
if ($cap_viewownstamps) {
$row[] = new tabobject('viewown', $CFG->wwwroot.'/mod/stampcoll/view.php?view=own&id='.$cm->id,
get_string('ownstamps','stampcoll'));
}
if ($cap_editstamps) {
$row[] = new tabobject('edit', $CFG->wwwroot.'/mod/stampcoll/editstamps.php?id='.$cm->id,
get_string('editstamps', 'stampcoll'));
}
$tabs[] = $row;
/// Print out the tabs and continue!
print_tabs($tabs, $currenttab, $inactive, $activetwo);
?>