MDL-12531, make the new member value available to all the affected plugins, thanks...
[moodle-linuxchix.git] / admin / upgradesettings.php
blob65fbf3c4cb1eab14aa3dffdb5630a52daf2ff7b7
1 <?php // $Id$
3 // detects settings that were added during an upgrade, displays a screen for the admin to
4 // modify them, and then processes modifications
6 require_once('../config.php');
7 require_once($CFG->libdir.'/adminlib.php');
9 $return = optional_param('return', '', PARAM_ALPHA);
11 /// no guest autologin
12 require_login(0, false);
14 $adminroot =& admin_get_root(); // need all settings
15 admin_externalpage_setup('upgradesettings'); // now hidden page
17 // now we'll deal with the case that the admin has submitted the form with new settings
18 if ($data = data_submitted() and confirm_sesskey()) {
19 $count = admin_write_settings($data);
20 $adminroot =& admin_get_root(true); //reload tree
23 $newsettingshtml = admin_output_new_settings_by_page($adminroot);
24 $focus = '';
26 if (empty($adminroot->errors) and $newsettingshtml === '') {
27 // there must be either redirect without message or continue button or else upgrade would be sometimes broken
28 if ($return == 'site') {
29 redirect("$CFG->wwwroot/");
30 } else {
31 redirect("$CFG->wwwroot/$CFG->admin/index.php");
35 if (!empty($adminroot->errors)) {
36 $firsterror = reset($adminroot->errors);
37 $focus = $firsterror->id;
40 // and finally, if we get here, then there are new settings and we have to print a form
41 // to modify them
42 admin_externalpage_print_header($focus);
44 print_box(get_string('upgradesettingsintro','admin'), 'generalbox');
46 echo '<form action="upgradesettings.php" method="post" id="adminsettings">';
47 echo '<div>';
48 echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
49 echo '<input type="hidden" name="return" value="'.$return.'" />';
50 echo '<fieldset>';
51 echo '<div class="clearer"><!-- --></div>';
52 echo $newsettingshtml;
53 echo '</fieldset>';
54 echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
55 echo '</div>';
56 echo '</form>';
58 if (!empty($CFG->adminusehtmleditor)) {
59 use_html_editor();
62 print_footer();