forked from lushonline/moodle2-skillsoft-activity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabs.php
More file actions
41 lines (33 loc) · 1.27 KB
/
tabs.php
File metadata and controls
41 lines (33 loc) · 1.27 KB
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
36
37
38
39
40
41
<?php
/*
* @package mod-skillsoft
* @author $Author$
* @version SVN: $Header$
* @copyright 2009-2014 Martin Holden
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (empty($skillsoft)) {
error('You cannot call this script in that way');
}
if (!isset($currenttab)) {
$currenttab = '';
}
if (!isset($cm)) {
$cm = get_coursemodule_from_instance('skillsoft', $skillsoft->id);
}
//$contextmodule = get_context_instance(CONTEXT_MODULE, $cm->id);
$contextmodule = context_MODULE::instance($cm->id);
$row = array();
$tabs = array();
$inactive = array();
$activated = array();
$infourl = new moodle_url('/mod/skillsoft/view.php', array('id'=>$cm->id));
$row[] = new tabobject('info', $infourl, get_string('skillsoft_info', 'skillsoft'));
$reporturl = new moodle_url('/mod/skillsoft/report.php', array('id'=>$cm->id, 'user'=>'true'));
$row[] = new tabobject('reports', $reporturl, get_string('skillsoft_results', 'skillsoft'));
if (has_capability('mod/skillsoft:viewreport', $contextmodule)) {
$reportallurl = new moodle_url('/mod/skillsoft/report.php', array('id'=>$cm->id));
$row[] = new tabobject('allreports', $reportallurl, get_string('skillsoft_allresults', 'skillsoft'));
}
$tabs[] = $row;
print_tabs($tabs, $currenttab, $inactive, $activated);