From: moodler Date: Sat, 19 Aug 2006 02:46:46 +0000 (+0000) Subject: Just tidying up things a bit as I look it over X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6e0993ee483ead9e64454e1f5770c51939ad4d4c;p=moodle.git Just tidying up things a bit as I look it over --- diff --git a/admin/index.php b/admin/index.php index c1712e1119..bb9c929d56 100644 --- a/admin/index.php +++ b/admin/index.php @@ -313,18 +313,7 @@ } -////////////////////////////////////////////////////////////////////////////// -// -// -// NOTE: We aren't going to have a user_admin table anymore. FIX below! -// We need to assign the "admin" user to the default admin role at some point! -// -// -////////////////////////////////////////////////////////////////////////////// - - /// Set up the admin user - //if (!record_exists("user_admins")) { // No admin user yet if (!$CFG->rolesactive) { redirect("user.php"); } @@ -345,18 +334,14 @@ } } -/// At this point everything is set up and the user is an admin, so print menu +/// Everything should now be set up, and the user is an admin -# $stradministration = get_string("administration"); -# print_header("$site->shortname: $stradministration","$site->fullname", "$stradministration"); -# print_simple_box_start('center', '100%', '', 20); -# print_heading($stradministration); +/// Print default admin page with notifications. require_once($CFG->dirroot . '/admin/adminlib.php'); admin_externalpage_setup('adminnotifications'); admin_externalpage_print_header(); - echo 'Umm... any notifications should show up here... I hope :)

'; - echo 'Also, I\'m including the old admin menu on this page incase I forgot any links in the new admin structure. It should be removed after.

'; + /// Deprecated database! Warning!! if (!empty($CFG->migrated_to_new_db)) { print_simple_box_start('center','60%'); @@ -364,7 +349,8 @@ print_simple_box_end(); } - if (!empty($CFG->upgrade)) { // Print notice about extra upgrading that needs to be done +/// Check for any special upgrades that might need to be run + if (!empty($CFG->upgrade)) { print_simple_box(get_string("upgrade$CFG->upgrade", "admin", "$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"), "center", '60%'); print_spacer(10,10); @@ -374,7 +360,6 @@ print_simple_box(get_string('globalsquoteswarning', 'admin'), 'center', '60%'); } - /// If no recently cron run $lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules'); if (time() - $lastcron > 3600 * 24) { @@ -405,113 +390,117 @@ print_single_button('register.php', $options, get_string('registration')); echo ''; print_simple_box_end(); + $registrationbuttonshown = true; } -// keeping this old menu here for a little while /* - $table->tablealign = "center"; - $table->align = array ("right", "left"); - $table->wrap = array ("nowrap", "nowrap"); - $table->cellpadding = 5; - $table->cellspacing = 0; - $table->width = '40%'; - - $configdata = ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - if (!isset($CFG->disablescheduledbackups)) { - $configdata .= ''; - } - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - - $table->data[] = array(''.get_string('configuration').'', $configdata); - - $userdata = ''; - $userdata .= ''; - $userdata .= ''; - $userdata .= ''; - $userdata .= ''; - $userdata .= ''; - - $table->data[] = array(''.get_string('users').'', $userdata); - - $coursedata = ''; - $coursedata .= ''; - - - $table->data[] = array(''.get_string('courses').'', $coursedata); - - $miscdata = ''; - $miscdata .= ''; - $miscdata .= ''; -//to be enabled later -/* $miscdata .= '';*/ - $miscdata .= ''; -/// Optional stuff - if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) { - $miscdata .= ''; - } -/// Hack to show the XMLDB editor - if (file_exists("$CFG->dirroot/$CFG->admin/xmldb")) { - $miscdata .= ''; - } - - $table->data[] = array(''.get_string('miscellaneous').'', $miscdata); - - -/// Hooks for Matt Oquists contrib code for repositories and portfolio. -/// The eventual official versions may not look like this - if (isset($CFG->portfolio) && file_exists("$CFG->dirroot/$CFG->portfolio")) { - $table->data[] = array("".get_string('portfolio','portfolio').'', - '
'.get_string('adminhelpportfolio','portfolio').'
'); - } - - if (isset($CFG->repo) && file_exists("$CFG->dirroot/$CFG->repo")) { +/// The old admin menu + if (optional_param('oldmenu', 0)) { + $table->tablealign = "center"; + $table->align = array ("right", "left"); + $table->wrap = array ("nowrap", "nowrap"); + $table->cellpadding = 5; + $table->cellspacing = 0; + $table->width = '40%'; + + $configdata = ''; + $configdata .= ''; + $configdata .= ''; + $configdata .= ''; + $configdata .= ''; + $configdata .= ''; + $configdata .= ''; + if (!isset($CFG->disablescheduledbackups)) { + $configdata .= ''; + } + $configdata .= ''; + $configdata .= ''; + $configdata .= ''; + + $table->data[] = array(''.get_string('configuration').'', $configdata); + + $userdata = ''; + $userdata .= ''; + $userdata .= ''; + $userdata .= ''; + $userdata .= ''; + $userdata .= ''; + + $table->data[] = array(''.get_string('users').'', $userdata); + + $coursedata = ''; + $coursedata .= ''; + + + $table->data[] = array(''.get_string('courses').'', $coursedata); + + $miscdata = ''; + $miscdata .= ''; + $miscdata .= ''; + //to be enabled later + /* $miscdata .= '';*/ + $miscdata .= ''; + /// Optional stuff + if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) { + $miscdata .= ''; + } + /// Hack to show the XMLDB editor + if (file_exists("$CFG->dirroot/$CFG->admin/xmldb")) { + $miscdata .= ''; + } + + $table->data[] = array(''.get_string('miscellaneous').'', $miscdata); + + + /// Hooks for Matt Oquists contrib code for repositories and portfolio. + /// The eventual official versions may not look like this + if (isset($CFG->portfolio) && file_exists("$CFG->dirroot/$CFG->portfolio")) { + $table->data[] = array("".get_string('portfolio','portfolio').'', + '
'.get_string('adminhelpportfolio','portfolio').'
'); + } + + if (isset($CFG->repo) && file_exists("$CFG->dirroot/$CFG->repo")) { $table->data[] = array("".get_string('repository',' -repository').'', - '
'.get_string('adminhelprepository','repository').'
'); + repository').'
', + '
'.get_string('adminhelprepository','repository').'
'); + } + + + + print_table($table); + + } else { + print_simple_box('The old admin menu has been replaced by a new system, make sure the administration block is showing on this page. If you want to, you can can also temporarily display the old menu' , 'center', '60%'); } - - - print_table($table); - -// old stuff ends here */ - ////////////////////////////////////////////////////////////////////////////////////////////////// //// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO REMOVE OR MODIFY THE COPYRIGHT NOTICE BELOW //// $copyrighttext = 'Moodle '. @@ -522,12 +511,13 @@ repository').'
', ////////////////////////////////////////////////////////////////////////////////////////////////// - echo '
'; - $options = array(); - $options['sesskey'] = $USER->sesskey; - print_single_button('register.php', $options, get_string('registration')); - echo '
'; - + if (empty($registrationbuttonshown)) { + echo '
'; + $options = array(); + $options['sesskey'] = $USER->sesskey; + print_single_button('register.php', $options, get_string('registration')); + echo '
'; + } print_simple_box_end();