mirror of
https://github.com/moodle/moodle.git
synced 2025-03-06 08:49:53 +01:00
Also, part of the change from weblib.php functions to $OUTPUT-> methods. This is part of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F This is a big change, and the result is not perfect yet. Expect some debugging output on some pages. The main part of these changes are that $OUTPUT->header now looks for a file in the theme called layout.php, rather than header.html and footer.html. Also you can have special templates for certain pages like layout-home.php. There is fallback code for Moodle 1.9 themes, so they still work. A few of the old arguments to print_header are no longer supported. (You get an exception if you try to use them.) Sam H will be cleaning those up. All the weblib functions that have been replaced with $OUTPUT-> have version in deprecatedlib, so existing code will go on working for the foreseeable future.
48 lines
2.0 KiB
PHP
48 lines
2.0 KiB
PHP
<?php // $Id$
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
/// Default class for report plugins
|
|
///
|
|
/// Doesn't do anything on it's own -- it needs to be extended.
|
|
/// This class displays quiz reports. Because it is called from
|
|
/// within /mod/quiz/report.php you can assume that the page header
|
|
/// and footer are taken care of.
|
|
///
|
|
/// This file can refer to itself as report.php to pass variables
|
|
/// to itself - all these will also be globally available. You must
|
|
/// pass "id=$cm->id" or q=$quiz->id", and "mode=reportname".
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// Included by ../report.php
|
|
|
|
class quiz_default_report {
|
|
|
|
function display($cm, $course, $quiz) { /// This function just displays the report
|
|
return true;
|
|
}
|
|
|
|
function print_header_and_tabs($cm, $course, $quiz, $reportmode="overview") {
|
|
global $CFG;
|
|
/// Define some strings
|
|
$strquizzes = get_string("modulenameplural", "quiz");
|
|
$strquiz = get_string("modulename", "quiz");
|
|
/// Print the page header
|
|
$navigation = build_navigation('', $cm);
|
|
|
|
print_header_simple(format_string($quiz->name), "", $navigation,
|
|
'', '', true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
|
|
/// Print the tabs
|
|
$currenttab = 'reports';
|
|
$mode = $reportmode;
|
|
require($CFG->dirroot . '/mod/quiz/tabs.php');
|
|
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
|
|
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
|
|
echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
|
|
. get_string('seeallcoursegrades', 'grades') . '</a></div>';
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
?>
|