MDL-10386 Refactored the grader report file (index.php), and extracted the grade_report_grader class out of it. The index file now only calls upon the class' main methods. Certain elements and code blocks in the class can be abstracted for other reports (such as the paging, sorting arrows and several general purpose variables).

This commit is contained in:
nicolasconnault
2007-07-12 16:36:38 +00:00
parent 06d7c6d6b2
commit 4ba9941c4b
5 changed files with 1172 additions and 906 deletions
+6 -6
View File
@@ -3748,7 +3748,7 @@ has_capability('moodle/course:viewhiddenuserfields', $context)) {
if (has_capability('moodle/notes:manage', $context) || has_capability('moodle/notes:view', $context)) {
$output .= '<a href="'.$CFG->wwwroot.'/notes/index.php?course=' . $course->id. '&amp;user='.$user->id.'">'.get_string('notes','notes').'</a><br />';
}
if (has_capability('moodle/site:viewreports', $context)) {
$timemidnight = usergetmidnight(time());
$output .= '<a href="'. $CFG->wwwroot .'/course/user.php?id='. $course->id .'&amp;user='. $user->id .'">'. $string->activity .'</a><br />';
@@ -6291,7 +6291,7 @@ function print_location_comment($file, $line, $return = false)
}
/**
/**
* Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
* provide this function with the language strings for sortasc and sortdesc.
* If no sort string is associated with the direction, an arrow with no alt text will be printed/returned.
@@ -6299,17 +6299,17 @@ function print_location_comment($file, $line, $return = false)
* @param string $strsort The language string used for the alt attribute of this image
* @param bool $return Whether to print directly or return the html string
* @return string HTML for the image
*
*
* TODO See if this isn't already defined somewhere. If not, move this to weblib
*/
function print_arrow($direction='up', $strsort=null, $return=false) {
global $CFG;
if (!in_array($direction, array('up', 'down', 'right', 'left'))) {
return null;
}
$return = null;
$return = null;
switch ($direction) {
case 'up':