[moodle] / contrib / plugins / grade / report / visual / index.php Repository:

Annotation of /contrib/plugins/grade/report/visual/index.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download)

1 : dservos 1.1 <?php
2 : dservos 1.2 ///////////////////////////////////////////////////////////////////////////
3 :     // //
4 :     // NOTICE OF COPYRIGHT //
5 :     // //
6 :     // Moodle - Modular Object-Oriented Dynamic Learning Environment //
7 :     // http://moodle.org //
8 :     // //
9 :     // Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
10 :     // //
11 :     // This program is free software; you can redistribute it and/or modify //
12 :     // it under the terms of the GNU General Public License as published by //
13 :     // the Free Software Foundation; either version 2 of the License, or //
14 :     // (at your option) any later version. //
15 :     // //
16 :     // This program is distributed in the hope that it will be useful, //
17 :     // but WITHOUT ANY WARRANTY; without even the implied warranty of //
18 :     // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
19 :     // GNU General Public License for more details: //
20 :     // //
21 :     // http://www.gnu.org/copyleft/gpl.html //
22 :     // //
23 :     ///////////////////////////////////////////////////////////////////////////
24 :    
25 :     /**
26 :     * Index page for the visual grade book report.
27 :     */
28 :    
29 : dservos 1.1 require_once '../../../config.php';
30 :     require_once $CFG->libdir.'/gradelib.php';
31 :     require_once $CFG->dirroot.'/grade/lib.php';
32 :    
33 :     $courseid = required_param('id');
34 :    
35 :     /// basic access checks
36 :     if(isset($DB) && !is_null($DB)) {
37 :     $course = $DB->get_record('course', array('id' => $courseid));
38 :     } else {
39 :     $course = get_record('course', 'id', $courseid);
40 :     }
41 :     if (!$course) {
42 :     print_error('nocourseid');
43 :     }
44 :     require_login($course);
45 :     $context = get_context_instance(CONTEXT_COURSE, $course->id);
46 :     require_capability('gradereport/visual:view', $context);
47 :    
48 :     /// last selected report session tracking
49 :     if (!isset($USER->grade_last_report)) {
50 :     $USER->grade_last_report = array();
51 :     }
52 :     $USER->grade_last_report[$course->id] = 'visual';
53 :    
54 :     /// Build navigation
55 :     $strgrades = get_string('grades');
56 :     $reportname = get_string('modulename', 'gradereport_visual');
57 :     $navigation = grade_build_nav(__FILE__, $reportname, $courseid);
58 :    
59 :     //grade_regrade_final_grades($courseid);
60 :    
61 :     /// Print header
62 :     print_header_simple($strgrades.': '.$reportname, ': '.$strgrades, $navigation, '', '', true, null, navmenu($course), false, null);
63 :    
64 :     /// Print the plugin selector at the top
65 :     print_grade_plugin_selector($courseid, 'report', 'stats');
66 :    
67 : dservos 1.2 // /Add tabs
68 : dservos 1.1 $currenttab = 'visualreport';
69 :     require('tabs.php');
70 :    
71 : dservos 1.2 /// Call on flex.php for html to load the flex application.
72 :     /// TODO: have the adapt_data() function in lib.php do this.
73 : dservos 1.1 require('flex.php');
74 :    
75 :     /// Print footer
76 :     print_footer($course);
77 :     ?>

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7