dataroot.'/'.SITEID.'/maintenance.html'; if ($form = data_submitted()) { if (confirm_sesskey()) { if ($form->action == "disable") { unlink($filename); redirect('index.php', get_string('sitemaintenanceoff','admin')); } else { $file = fopen($filename, 'w'); fwrite($file, stripslashes($form->text)); fclose($file); redirect('index.php', get_string('sitemaintenanceon', 'admin')); } } } /// Print the header stuff $strmaintenance = get_string('sitemaintenancemode', 'admin'); $stradmin = get_string('administration'); $strconfiguration = get_string('configuration'); print_header("$SITE->shortname: $strmaintenance", $SITE->fullname, "$stradmin -> ". "$strconfiguration -> $strmaintenance"); print_heading($strmaintenance); /// Print the appropriate form if (file_exists($filename)) { // We are in maintenance mode echo '
'; echo '
'; echo ''; echo ''; echo '

'; echo '
'; echo '
'; } else { // We are not in maintenance mode $usehtmleditor = can_use_html_editor(); echo '
'; echo '
'; echo ''; echo ''; echo '

'; echo '

'.get_string('optionalmaintenancemessage', 'admin').':

'; echo '
'; print_textarea($usehtmleditor, 20, 50, 600, 400, "text"); echo '
'; echo '
'; echo '
'; if ($usehtmleditor) { use_html_editor(); } } print_footer(); ?>