]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fixes from stable
authormoodler <moodler>
Thu, 12 Oct 2006 03:31:48 +0000 (03:31 +0000)
committermoodler <moodler>
Thu, 12 Oct 2006 03:31:48 +0000 (03:31 +0000)
admin/settings.php
lang/en_utf8/admin.php

index f0756ef80a7f9e8e01e23790639673cf1c58cd33..65ad4d30a1de8da285ccadd2e3f513b5675eae96 100644 (file)
@@ -49,6 +49,32 @@ if (!($root->check_access())) {
 
 $CFG->pagepath = 'admin/setting/'.$section;
 
+
+
+if (!empty($SITE->fullname)) {
+    $pageblocks = blocks_setup($PAGE);
+
+    $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
+                                            BLOCK_L_MAX_WIDTH);
+    $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
+                                            BLOCK_R_MAX_WIDTH);
+
+    // print header stuff
+    $PAGE->print_header();
+
+    echo '<table id="layout-table"><tr>';
+    echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
+    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+    echo '</td>';
+    echo '<td id="middle-column">';
+} else {
+
+    print_header();
+    print_simple_box(get_string('configintrosite', 'admin'), 'center', '50%');
+
+}
+
+
 // WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
 
 if ($data = data_submitted()) {
@@ -66,44 +92,19 @@ if ($data = data_submitted()) {
                 case 'admin':
                     redirect("$CFG->wwwroot/$CFG->admin/");
                 default:
-                    // following redirect should display confirmation message because it redirects
-                    // to the same page, user might not know if save button worked
-                    redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),2);
+                    notify(get_string('changessaved'));
             }
         } else {
-            error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
+            notify(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
         }
     } else {
         error(get_string('confirmsesskeybad', 'error'));
-        die;
     }
 }
 
 // ---------------------------------------------------------------------------------------------------------------
 
 
-if (!empty($SITE->fullname)) {
-    $pageblocks = blocks_setup($PAGE);
-
-    $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
-                                            BLOCK_L_MAX_WIDTH);
-    $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
-                                            BLOCK_R_MAX_WIDTH);
-
-    // print header stuff
-    $PAGE->print_header();
-
-    echo '<table id="layout-table"><tr>';
-    echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
-    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-    echo '</td>';
-    echo '<td id="middle-column">';
-} else {
-
-    print_header();
-    print_simple_box(get_string('configintrosite', 'admin'), 'center', '50%');
-
-}
 
 echo '<form action="settings.php" method="post" name="adminsettings" id="adminsettings">';
 echo '<input type="hidden" name="section" value="' . $PAGE->section . '" />';
index 978010ee5cd9f915e89d691403df1f5cc29ba808..8fa3ec01d516010527f56bb0a19775771bb66e8d 100644 (file)
@@ -16,6 +16,9 @@ $string['security'] = 'Security';
 $string['userlist'] = 'Browse list of users';
 $string['courses'] = 'Courses';
 $string['location'] = 'Location';
+$string['errorwithsettings'] = 'Some settings were not changed due to an error:';
+$string['errorsetting'] = 'Could not save setting:';
+$string['validateerror'] = 'This value was not valid: ';
 $string['coursemgmt'] = 'Add/edit courses';
 $string['debugging'] = 'Debugging';
 $string['plugins'] = 'Modules';