-
Notifications
You must be signed in to change notification settings - Fork 1
/
block_cegep_tabs.php
33 lines (26 loc) · 1.14 KB
/
block_cegep_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
<?php
global $COURSE;
$row = $tabs = array();
$row[] = new tabobject('studentlist',
'block_cegep_enrolment.php?id='.$COURSE->id,
get_string('studentlist','block_cegep'));
$row[] = new tabobject('enrol',
'block_cegep_enrolment.php?a=enrol&id='.$COURSE->id,
get_string('enrol','block_cegep'));
$row[] = new tabobject('unenrol',
'block_cegep_enrolment.php?a=unenrol&id='.$COURSE->id,
get_string('unenrol','block_cegep'));
$syscontext = get_context_instance(CONTEXT_SYSTEM, 1);
if (is_siteadmin() || has_capability('block/cegep:enroladmin_program', $syscontext)) {
$row[] = new tabobject('enrolprogram',
'block_cegep_enrolment.php?a=enrolprogram&id='.$COURSE->id,
get_string('enrolprogram','block_cegep'));
if ($num_programenrolments > 0) {
$row[] = new tabobject('unenrolprogram',
'block_cegep_enrolment.php?a=unenrolprogram&id='.$COURSE->id,
get_string('unenrolprogram','block_cegep'));
}
}
$tabs[] = $row;
print_tabs($tabs, $currenttab);
?>