|
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 00026 defined('MOODLE_INTERNAL') || die; 00027 00035 function report_progress_extend_navigation_course($navigation, $course, $context) { 00036 global $CFG, $OUTPUT; 00037 00038 require_once($CFG->libdir.'/completionlib.php'); 00039 00040 $showonnavigation = has_capability('report/progress:view', $context); 00041 $group = groups_get_course_group($course,true); // Supposed to verify group 00042 if($group===0 && $course->groupmode==SEPARATEGROUPS) { 00043 $showonnavigation = ($showonnavigation && has_capability('moodle/site:accessallgroups', $context)); 00044 } 00045 00046 $completion = new completion_info($course); 00047 $showonnavigation = ($showonnavigation && $completion->is_enabled() && count($completion->get_activities())>0); 00048 if ($showonnavigation) { 00049 $url = new moodle_url('/report/progress/index.php', array('course'=>$course->id)); 00050 $navigation->add(get_string('pluginname','report_progress'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', '')); 00051 } 00052 } 00053 00061 function report_progress_page_type_list($pagetype, $parentcontext, $currentcontext) { 00062 $array = array( 00063 '*' => get_string('page-x', 'pagetype'), 00064 'report-*' => get_string('page-report-x', 'pagetype'), 00065 'report-progress-*' => get_string('page-report-progress-x', 'report_progress'), 00066 'report-progress-index' => get_string('page-report-progress-index', 'report_progress'), 00067 ); 00068 return $array; 00069 }