|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00025 if (empty($scorm)) { 00026 error('You cannot call this script in that way'); 00027 } 00028 if (!isset($currenttab)) { 00029 $currenttab = ''; 00030 } 00031 if (!isset($cm)) { 00032 $cm = get_coursemodule_from_instance('scorm', $scorm->id); 00033 } 00034 00035 $contextmodule = get_context_instance(CONTEXT_MODULE, $cm->id); 00036 00037 $tabs = array(); 00038 $row = array(); 00039 $inactive = array(); 00040 $activated = array(); 00041 00042 if (has_capability('mod/scorm:savetrack', $contextmodule)) { 00043 $row[] = new tabobject('info', "$CFG->wwwroot/mod/scorm/view.php?id=$cm->id", get_string('info', 'scorm')); 00044 } 00045 if (has_capability('mod/scorm:viewreport', $contextmodule)) { 00046 $row[] = new tabobject('reports', "$CFG->wwwroot/mod/scorm/report.php?id=$cm->id", get_string('reports', 'scorm')); 00047 } 00048 00049 if ($currenttab == 'info' && count($row) == 1) { 00050 // Don't show only an info tab (e.g. to students). 00051 } else { 00052 $tabs[] = $row; 00053 } 00054 00055 if ($currenttab == 'reports' && !empty($reportlist) && count($reportlist) > 1) { 00056 $row2 = array(); 00057 foreach ($reportlist as $rep) { 00058 $row2[] = new tabobject('scorm_'.$rep, $CFG->wwwroot."/mod/scorm/report.php?id=$cm->id&mode=$rep", get_string('pluginname', 'scormreport_'.$rep)); 00059 } 00060 $tabs[] = $row2; 00061 } 00062 00063 print_tabs($tabs, $currenttab, $inactive, $activated);