]> git.mjollnir.org Git - moodle.git/commitdiff
Nicer formatting of editing modules, takes into account course format
authormartin <martin>
Tue, 25 Jun 2002 07:56:26 +0000 (07:56 +0000)
committermartin <martin>
Tue, 25 Jun 2002 07:56:26 +0000 (07:56 +0000)
course/lib.php
course/mod.php

index f3375d9eccbcacd5a4aec4b7559335d8ace100ed..694725fdbc570cbbe1d33fc40ef4a7caf0908c0a 100644 (file)
@@ -8,6 +8,12 @@ $FORMATS = array (
              "3" => "Topics layout"
            );
 
+$SECTION = array (
+             "1" => "week",
+             "2" => "section",
+             "3" => "topic"
+           );
+
 
 function print_log_selector_form($course, $selecteduser=0, $selecteddate="today") {
 
index 76c35edc8aa9e6d604e04af6528998a3880343f4..1e4083cd06504077255603ae2b474051821167cc 100644 (file)
@@ -3,6 +3,7 @@
 //  Moves, adds, updates or deletes modules in a course
 
     require("../config.php");
+    require("lib.php");
 
     if (isset($course) && isset($HTTP_POST_VARS)) {    // add or update form submitted
         $mod = (object)$HTTP_POST_VARS;
             error("This module doesn't exist");
         }
 
+        $section = $SECTION[$course->format];
+
         if (! $form = get_record($module->name, "id", $cm->instance)) {
             error("The required instance of this module doesn't exist");
         }
         $form->instance   = $cm->instance;
         $form->mode       = "update";
 
-        $pageheading = "Updating a $module->fullname in Week $cw->week";
+        $pageheading = "Updating a ".strtolower($module->fullname)." in $section $cw->week";
 
         
     } else if (isset($add)) {
             error("This course doesn't exist");
         }
 
+        $section = $SECTION[$course->format];
+
         if (! $module = get_record("modules", "name", $add)) {
             error("This module type doesn't exist");
         }
         $form->mode       = "add";
 
         if ($form->week) {
-            $pageheading = "Adding a new $module->fullname to Week $form->week";
+            $pageheading = "Adding a new ".strtolower($module->fullname)." to $section $form->week";
         } else {
-            $pageheading = "Adding a new $module->fullname";
+            $pageheading = "Adding a new ".strtolower($module->fullname);
         }
 
     } else {