]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes to languages for admin (setting up and upgrading databases)
authormartin <martin>
Thu, 15 Aug 2002 05:44:37 +0000 (05:44 +0000)
committermartin <martin>
Thu, 15 Aug 2002 05:44:37 +0000 (05:44 +0000)
admin/index.php
lang/en/moodle.php
version.php

index d5e38ccb4ddb4908b4cbecbaba62804a90a7b84b..aa001b28786095954a1a42cf98eaed2bf4b4ce1e 100644 (file)
@@ -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("<A HREF=\"index.php\">Continue</A>");
+        print_continue("index.php");
         die;
     }
 
 
     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("<A HREF=\"index.php\">Continue</A>");
+                    notify($strdatabasesuccess);
+                    print_continue("$CFG->wwwroot");
                     die;
                 } else {
                     notify("Upgrade failed!  (Could not update version in config table)");
     } 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("<A HREF=\"index.php\">Continue</A>");
+            print_continue("index.php");
             die;
         } else {
             $db->debug=true;
             if (upgrade_moodle(0)) {
-                print_heading("<A HREF=\"index.php\">Continue</A>");
+                print_continue("index.php");
             } else {
                 error("A problem occurred inserting current version into databases");
             }
                         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!");
     
         } 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!");
                 }
     }
 
     if ($updated_modules) {
-        print_heading("<A HREF=\"index.php\">Continue</A>");
+        print_continue("index.php");
         die;
     }
 
index f144b29c912ef0605a4ca4cf33016222a2073e45..00b5ce0ecff1cc435315e3626bbc31e36de59c9a 100644 (file)
@@ -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";
index c73395fb2a14cce12761a046fdce1dfff270fec6..da5e48afc4ac2a1ca9cb509c353f90dc13fe0fe3 100644 (file)
@@ -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) {