From: martin Date: Thu, 15 Aug 2002 05:44:37 +0000 (+0000) Subject: Fixes to languages for admin (setting up and upgrading databases) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=169d3404a30a29fd8be151192919424a6feaefbb;p=moodle.git Fixes to languages for admin (setting up and upgrading databases) --- diff --git a/admin/index.php b/admin/index.php index d5e38ccb4d..aa001b2878 100644 --- a/admin/index.php +++ b/admin/index.php @@ -9,21 +9,23 @@ // Check databases and modules and install as needed. if (! $db->Metatables() ) { - print_header("Setting up database", "Setting up database", "Setting up databases for the first time"); + $strdatabasesetup = get_string("databasesetup"); + $strdatabasesuccess = get_string("databasesuccess"); + print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup); if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) { $db->debug = true; if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) { $db->debug = false; - notify("Main databases set up successfully"); + notify($strdatabasesuccess); } else { $db->debug = false; error("Error: Main databases NOT set up successfully"); } } else { - error("Error: Your database ($CFG->dbtype) is not yet supported by Moodle. See the lib/db directory."); + error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle. See the lib/db directory."); } - print_heading("Continue"); + print_continue("index.php"); die; } @@ -34,14 +36,18 @@ if ($dversion = get_field("config", "value", "name", "version")) { if ($version > $dversion) { // upgrade - print_header("Upgrading database", "Upgrading database", "Upgrading main databases"); - notify("Upgrading databases from version $dversion to $version..."); + $a->oldversion = $dversion; + $a->newversion = $version; + $strdatabasechecking = get_string("databasechecking", "", $a); + $strdatabasesuccess = get_string("databasesuccess"); + print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades); + notify($strdatabasechecking); $db->debug=true; if (upgrade_moodle($dversion)) { $db->debug=false; if (set_field("config", "value", "$version", "name", "version")) { - notify("Databases were successfully upgraded"); - print_heading("Continue"); + notify($strdatabasesuccess); + print_continue("$CFG->wwwroot"); die; } else { notify("Upgrade failed! (Could not update version in config table)"); @@ -57,15 +63,16 @@ } else { $dversion->name = "version"; $dversion->value = $version; - print_header("Upgrading database", "Upgrading database", "Upgrading main databases"); + $strdatabaseupgrades = get_string("databaseupgrades"); + print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades); if (insert_record("config", $dversion)) { notify("You are currently using Moodle version $version"); - print_heading("Continue"); + print_continue("index.php"); die; } else { $db->debug=true; if (upgrade_moodle(0)) { - print_heading("Continue"); + print_continue("index.php"); } else { error("A problem occurred inserting current version into databases"); } @@ -109,7 +116,7 @@ if (! update_record("modules", $module)) { error("Could not update $module->name record in modules table!"); } - notify("$module->name module was successfully upgraded"); + notify(get_string("modulesuccess", "", $module->name)); } else { $db->debug=false; notify("Upgrading $module->name from $currmodule->version to $module->version FAILED!"); @@ -122,14 +129,15 @@ } else { // module not installed yet, so install it if (!$updated_modules) { - print_header("Setting up database", "Setting up database", "Setting up module tables", ""); + $strmodulesetup = get_string("modulesetup"); + print_header($strmodulesetup, $strmodulesetup, $strmodulesetup); } $updated_modules = true; $db->debug = true; if (modify_database("$fullmod/db/$CFG->dbtype.sql")) { $db->debug = false; if ($module->id = insert_record("modules", $module)) { - notify("$module->name tables have been set up correctly"); + notify(get_string("modulesuccess", "", $module->name)); } else { error("$module->name module could not be added to the module list!"); } @@ -140,7 +148,7 @@ } if ($updated_modules) { - print_heading("Continue"); + print_continue("index.php"); die; } diff --git a/lang/en/moodle.php b/lang/en/moodle.php index f144b29c91..00b5ce0ecf 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -45,6 +45,10 @@ $string[courses] = "Courses"; $string[createaccount] = "Create my new account"; $string[createuserandpass] = "Create a new username and password to log in with"; $string[currentlocaltime] = "your current local time"; +$string[databasechecking] = "Upgrading Moodle database from version \$a->oldversion to \$a->newversion..."; +$string[databasesetup] = "Setting up database"; +$string[databasesuccess] = "Database was successfully upgraded"; +$string[databaseupgrades] = "Upgrading database"; $string[defaultcoursefullname] = "Course Fullname 101"; $string[defaultcourseshortname] = "CF101"; $string[defaultcoursestudent] = "Student"; @@ -295,6 +299,8 @@ $string[success] = "Success"; $string[summary] = "Summary"; $string[summaryof] = "Summary of \$a"; $string[supplyinfo] = "Please supply some information about yourself"; +$string[modulesetup] = "Setting up module tables"; +$string[modulesuccess] = "\$a tables have been set up correctly"; $string[teacherforum] = "Teacher forum"; $string[teacheronly] = "for the \$a only"; $string[textformat] = "Plain text format"; diff --git a/version.php b/version.php index c73395fb2a..da5e48afc4 100644 --- a/version.php +++ b/version.php @@ -17,7 +17,7 @@ // If there's something it cannot do itself, it // will tell you what you need to do. -$version = 2002080800; +$version = 2002081503; function upgrade_moodle($oldversion=0) {