MDL-48823 admin: Just one admin tree reload after settings changes
authorDavid Monllao <davidm@moodle.com>
Wed, 14 Jan 2015 05:35:24 +0000 (13:35 +0800)
committerDavid Monllao <davidm@moodle.com>
Wed, 21 Jan 2015 02:41:23 +0000 (10:41 +0800)
admin/category.php
admin/search.php
admin/settings.php
admin/upgradesettings.php

index 223cd5b..7847b2d 100644 (file)
@@ -67,7 +67,6 @@ if ($data = data_submitted() and confirm_sesskey()) {
         $errormsg = get_string('errorwithsettings', 'admin');
         $firsterror = reset($adminroot->errors);
     }
-    $adminroot = admin_get_root(true); //reload tree
     $settingspage = $adminroot->locate($category, true);
 }
 
@@ -156,4 +155,4 @@ echo $outputhtml;
 echo html_writer::end_tag('fieldset');
 echo html_writer::end_tag('form');
 
-echo $OUTPUT->footer();
\ No newline at end of file
+echo $OUTPUT->footer();
index d60f093..748ef5b 100644 (file)
@@ -22,7 +22,6 @@ if ($data = data_submitted() and confirm_sesskey()) {
     if (admin_write_settings($data)) {
         $statusmsg = get_string('changessaved');
     }
-    $adminroot = admin_get_root(true); //reload tree
 
     if (!empty($adminroot->errors)) {
         $errormsg = get_string('errorwithsettings', 'admin');
index 3236444..2acbc83 100644 (file)
@@ -48,7 +48,6 @@ if ($data = data_submitted() and confirm_sesskey()) {
         $errormsg = get_string('errorwithsettings', 'admin');
         $firsterror = reset($adminroot->errors);
     }
-    $adminroot = admin_get_root(true); //reload tree
     $settingspage = $adminroot->locate($section, true);
 }
 
index 6fe6b4b..38a8f06 100644 (file)
@@ -24,7 +24,6 @@ $adminroot = admin_get_root(); // need all settings
 // now we'll deal with the case that the admin has submitted the form with new settings
 if ($data = data_submitted() and confirm_sesskey()) {
     $count = admin_write_settings($data);
-    $adminroot = admin_get_root(true); //reload tree
 }
 
 $newsettings = admin_output_new_settings_by_page($adminroot);