Commit c646b70d authored by martin's avatar martin
Browse files

Added a new $release variable that shows the user-friendly version number

parent 7c6addde
......@@ -80,7 +80,7 @@
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
if (insert_record("config", $dversion)) {
notify("You are currently using Moodle version $version");
notify("You are currently using Moodle version $release ($version)");
print_continue("index.php");
die;
} else {
......@@ -94,6 +94,18 @@
}
}
// Updated human-readable release version if necessary
if ($drelease = get_field("config", "value", "name", "release")) {
if ($release <> $drelease) { // Update the release version
set_field("config", "value", "$release", "name", "release");
}
} else {
$drelease->name = "release";
$drelease->value = $release;
insert_record("config", $drelease);
}
// Find and check all modules and load them up or upgrade them if necessary
......
......@@ -53,9 +53,12 @@ function print_footer ($course=NULL) {
if ($course) {
if ($course == "home") { // special case for site home page - please do not remove
if (!$dversion = get_field("config", "value", "name", "version")) {
$dversion = "unknown!";
$dversion = "xxx";
}
$homelink = "<P ALIGN=center><A TITLE=\"Version $dversion: Click to visit moodle.com\" HREF=\"http://moodle.com/\">";
if (!$drelease = get_field("config", "value", "name", "release")) {
$drelease = "xxx";
}
$homelink = "<P ALIGN=center><A TITLE=\"Moodle $drelease ($dversion)\" HREF=\"http://moodle.com/\">";
$homelink .= "<BR><IMG WIDTH=130 HEIGHT=19 SRC=\"pix/madewithmoodle2.gif\" BORDER=0></A></P>";
} else {
$homelink = "<A TARGET=_top HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>";
......
......@@ -9,7 +9,8 @@
// Moodle installed, which can be compared against
// a previous version (see the "config" table).
//
// To do this, visit the "admin" page.
// To do this, visit the "admin" page or the site
// home page while logged in as an admin.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
......@@ -17,7 +18,10 @@
// If there's something it cannot do itself, it
// will tell you what you need to do.
$version = 2002090501;
$version = 2002090501; // The current version is a date (YYYYMMDDXX) where
// XX is a number that increments during the day
$release = "1.0.3.1"; // For humans only, not used for the upgrade process
function upgrade_moodle($oldversion=0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment