]> git.mjollnir.org Git - moodle.git/commitdiff
New report plugin structure for all course reports.
authormoodler <moodler>
Thu, 9 Mar 2006 07:37:40 +0000 (07:37 +0000)
committermoodler <moodler>
Thu, 9 Mar 2006 07:37:40 +0000 (07:37 +0000)
More to be added soon.

course/report.php [new file with mode: 0644]
course/report/stats/graph.php [moved from course/statsgraph.php with 100% similarity]
course/report/stats/index.php [moved from course/stats.php with 97% similarity]
course/report/stats/mod.php [new file with mode: 0644]

diff --git a/course/report.php b/course/report.php
new file mode 100644 (file)
index 0000000..66e726a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php // $Id$
+      // Display all the interfaces for importing data into a specific course
+
+    require_once('../config.php');
+
+    $id = required_param('id', PARAM_INT);   // course id to import TO
+
+    if (!$course = get_record('course', 'id', $id)) {
+        error("That's an invalid course id");
+    }
+
+    $strreports = get_string('reports');
+
+    print_header($course->fullname.': '.$strreports, $course->fullname.': '.$strreports, 
+                 '<a href="view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$strreports);
+
+    $directories = get_list_of_plugins('course/report');
+
+    foreach ($directories as $directory) {
+        echo '<div class="plugin">';
+        include_once($CFG->dirroot.'/course/report/'.$directory.'/mod.php');  // Fragment for listing
+        echo '</div>';
+    }
+
+    print_footer();
+?>
similarity index 97%
rename from course/stats.php
rename to course/report/stats/index.php
index e3bb3268a6ae15fbfc98946aa14e900965da40b2..47dfc2e2b54d03821b01caeedc37ea16696d681b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-    require_once(dirname(dirname(__FILE__)).'/config.php');
+    require_once('../../../config.php');
     require_once($CFG->dirroot.'/lib/statslib.php');
 
     if (empty($CFG->enablestats)) {
             echo "(".get_string("gdneed").")";
         } else {
             if ($mode == STATS_MODE_DETAILED) {
-                echo '<center><img src="'.$CFG->wwwroot.'/course/statsgraph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'&userid='.$userid.'" /></center>';
+                echo '<center><img src="'.$CFG->wwwroot.'/course/graph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'&userid='.$userid.'" /></center>';
             } else {
-                echo '<center><img src="'.$CFG->wwwroot.'/course/statsgraph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'" /></center>';
+                echo '<center><img src="'.$CFG->wwwroot.'/course/graph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'" /></center>';
             }
         }
 
     print_footer();
 
 
-?>
\ No newline at end of file
+?>
diff --git a/course/report/stats/mod.php b/course/report/stats/mod.php
new file mode 100644 (file)
index 0000000..264e756
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+
+    if (!empty($CFG->enablestats)) {
+        echo '<a href="'.$CFG->wwwroot.'/course/report/stats/index.php?course='.$course->id.'">'.get_string('stats').'</a>';
+    }
+?>