]> git.mjollnir.org Git - moodle.git/commitdiff
If modules have a config.php file in them then a link to this is
authormoodler <moodler>
Thu, 24 Jul 2003 12:09:32 +0000 (12:09 +0000)
committermoodler <moodler>
Thu, 24 Jul 2003 12:09:32 +0000 (12:09 +0000)
printed in the modules screen.

These config.php screens presumably allow the setting of site-wide
parameters for modules.

Thanks to Mad Alex. :-)

admin/modules.php

index e76b32684b35b3aa76189584be12e6fdc501d3db..93d0ee2c4fa91290bed765fe5239704bf3e1e4f2 100644 (file)
@@ -1,8 +1,8 @@
 <?PHP // $Id$
       // Allows the admin to create, delete and rename course categories
 
-       require_once("../config.php");
-       require_once("../course/lib.php");
+    require_once("../config.php");
+    require_once("../course/lib.php");
 
     optional_variable($disable);
     optional_variable($enable);
     $strdelete = get_string("delete");
     $strhide = get_string("hide");
     $strshow = get_string("show");
+    $strsettings = get_string("settings");
     $stractivitymodule = get_string("activitymodule");
 
-       print_header("$site->shortname: $strmanagemodules", "$site->fullname", 
+    print_header("$site->shortname: $strmanagemodules", "$site->fullname", 
                  "<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strmanagemodules");
 
     print_heading($strmanagemodules);
         $modpixpath = "../theme/$CFG->theme/pix/mod";
     }
 
-    $table->head  = array ($stractivitymodule, "$strhide/$strshow", $strdelete);
-    $table->align = array ("LEFT", "CENTER", "CENTER");
-    $table->wrap = array ("NOWRAP", "", "");
-    $table->size = array ("100%", "10", "10");
+    $table->head  = array ($stractivitymodule, "$strhide/$strshow", $strdelete, $strsettings);
+    $table->align = array ("LEFT", "CENTER", "CENTER", "CENTER");
+    $table->wrap = array ("NOWRAP", "", "","");
+    $table->size = array ("100%", "10", "10","12");
     $table->width = "100";
 
     foreach ($modulebyname as $modulename => $module) {
 
         $delete = "<a href=\"modules.php?delete=$module->name\">$strdelete</a>";
 
+        if (file_exists("$CFG->dirroot/mod/$module->name/config.php")) {
+            $settings = "<a href=\"$CFG->wwwroot/mod/$module->name/config.php\">$strsettings</a>";
+        } else {
+            $settings = "";
+        }
+
         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>", $visible, $delete);
+        $table->data[] = array ("<p $class>$icon $modulename</p>", $visible, $delete, $settings);
     }
     print_table($table);