]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes for MDL-7861.
authorvyshane <vyshane>
Mon, 15 Jan 2007 08:15:04 +0000 (08:15 +0000)
committervyshane <vyshane>
Mon, 15 Jan 2007 08:15:04 +0000 (08:15 +0000)
course/report/stats/report.php

index 32ee6d0e7f98d92e7a52c09f8e6176ef94483f69..f3159a84d4e28d9f0092e4e81ff180fa2846eed5 100644 (file)
         }
     }
     
-
-    echo '<form action="index.php" method="post">'."\n"
-        .'<input type="hidden" name="mode" value="'.$mode.'" />'."\n";
+    // Ugly hack. This file may be included from admin or course reports.
+    // For admin reports, $adminroot is set. We basically use it to decide
+    // what kind of footer we need to print.
+    if (!isset($adminroot)) {
+        $adminroot = false;
+    }
 
     $reportoptions = stats_get_report_options($course->id, $mode);
     $timeoptions = report_stats_timeoptions($mode);
     if (empty($timeoptions)) {
-        error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id);
+        error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id, $adminroot);
     }
 
     $table->width = '*';
@@ -36,7 +39,7 @@
             .' ORDER BY r.sortorder';
         
         if (!$us = get_records_sql($sql)) {
-            error('Cannot enter detailed view: No users found for this course.');
+            error('Cannot enter detailed view: No users found for this course.', $adminroot);
         }
 
         foreach ($us as $u) {
                                '<input type="submit" value="'.get_string('view').'" />') ;
     }
 
+    echo '<form action="index.php" method="post">'."\n"
+        .'<fieldset class="invisiblefieldset">'."\n"
+        .'<input type="hidden" name="mode" value="'.$mode.'" />'."\n";
 
     print_table($table);
+
+    echo '</fieldset>';
     echo '</form>';
 
     if (!empty($report) && !empty($time)) {
         if ($report == STATS_REPORT_LOGINS && $course->id != SITEID) {
-            error("This type of report is only available for the site course");
+            error('This type of report is only available for the site course', $adminroot);
         }
         $timesql = 
         $param = stats_get_parameters($time,$report,$course->id,$mode);
         }
     }    
 
-?>
+?>
\ No newline at end of file