]> git.mjollnir.org Git - moodle.git/commitdiff
Adding new pluggable reports
authorikawhero <ikawhero>
Fri, 10 Mar 2006 07:46:24 +0000 (07:46 +0000)
committerikawhero <ikawhero>
Fri, 10 Mar 2006 07:46:24 +0000 (07:46 +0000)
admin/index.php
admin/report.php [new file with mode: 0644]

index 59f6110dd1a177fe701a83e4e16c4ef7209c4d00..97a7992022a141ae483599ef942d41a7c77622ae 100644 (file)
     $table->data[] = array('<strong><a href="stickyblocks.php">'.get_string('stickyblocks','admin').'</a></strong>',
                            '<div class="explanation">'.get_string('adminhelpstickyblocks').'</div>');
     if (!empty($CFG->enablestats)) {
-        $table->data[] = array('<strong><a href="reports.php">'.get_string('reports').'</a></strong>', 
+        $table->data[] = array('<strong><a href="report.php">'.get_string('reports').'</a></strong>', 
                                  '<div class="explanation">'.get_string('adminhelpreports').'</div>');
     }
     $table->data[] = array('<strong><a href="environment.php">'.get_string('environment','admin').'</a></strong>',
diff --git a/admin/report.php b/admin/report.php
new file mode 100644 (file)
index 0000000..2845053
--- /dev/null
@@ -0,0 +1,26 @@
+<?php // $Id$
+      // Display all the reports available in admin/report
+
+    require_once('../config.php');
+
+    if (!isadmin()) {
+        error("You are not allowed to look at this page");
+    }
+
+    $stradmin = get_string('administration');
+    $strreports = get_string('reports');
+
+    print_header($strreports, $strreports,
+                 '<a href="index.php">'.$stradmin.'</a> -> '.$strreports);
+
+    $directories = get_list_of_plugins('admin/report');
+
+    foreach ($directories as $directory) {
+        echo '<div class="plugin '.$directory.'">';
+        include_once($CFG->dirroot.'/admin/report/'.$directory.'/mod.php');  // Fragment for listing
+        echo '</div>';
+    }
+
+    print_footer();
+?>
+