]> git.mjollnir.org Git - moodle.git/commitdiff
Add a count of the number of activites using a particular module
authormoodler <moodler>
Sat, 13 Mar 2004 10:40:01 +0000 (10:40 +0000)
committermoodler <moodler>
Sat, 13 Mar 2004 10:40:01 +0000 (10:40 +0000)
admin/modules.php

index 9c5421e3749bb831c619625659ae864c8fc18ad8..bbe23112fd4ecaa66d31771b3ea433a2aec50299 100644 (file)
@@ -28,6 +28,7 @@
     $strhide = get_string("hide");
     $strshow = get_string("show");
     $strsettings = get_string("settings");
+    $stractivities = get_string("activities");
     $stractivitymodule = get_string("activitymodule");
 
     print_header("$site->shortname: $strmanagemodules", "$site->fullname", 
         $modpixpath = "../theme/$CFG->theme/pix/mod";
     }
 
-    $table->head  = array ($stractivitymodule, $strversion, "$strhide/$strshow", $strdelete, $strsettings);
-    $table->align = array ("LEFT", "LEFT", "CENTER", "CENTER", "CENTER");
-    $table->wrap = array ("NOWRAP", "", "", "","");
-    $table->size = array ("100%", "10", "10", "10","12");
+    $table->head  = array ($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings);
+    $table->align = array ("LEFT", "RIGHT", "LEFT", "CENTER", "CENTER", "CENTER");
+    $table->wrap = array ("NOWRAP", "", "", "", "","");
+    $table->size = array ("100%", "10", "10", "10", "10","12");
     $table->width = "100";
 
     foreach ($modulebyname as $modulename => $module) {
             $settings = "";
         }
 
+        $count = count_records("$module->name");
+
         if ($module->visible) {
             $visible = "<a href=\"modules.php?hide=$module->name\" title=\"$strhide\">".
                        "<img src=\"$pixpath/i/hide.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
             $visible = "";
             $class = "";
         }
-        $table->data[] = array ("<p $class>$icon $modulename</p>", $module->version, $visible, $delete, $settings);
+        $table->data[] = array ("<p $class>$icon $modulename</p>", $count, $module->version, $visible, $delete, $settings);
     }
     print_table($table);