MDL-26609 Display information about the current version during the upgrade

As Eloy Lafuente noticed in the tracker discussion, we display the
information about the current version in the browser window title but
not at the screen itself. The patch fixes that by displaying the
information in the page heading instead of the page title.

Eloy's original idea to put the information into the grey message box
would require a change of [upgradesure,core_admin] string because
unfortunately it does not expect $a as an object but as a plain string.
This commit is contained in:
David Mudrak
2011-03-04 05:59:08 +01:00
parent dc41abd808
commit 1a4d6a5b60
3 changed files with 13 additions and 6 deletions
+8
View File
@@ -90,6 +90,7 @@ if ($version < $CFG->version) {
cli_error(get_string('downgradedcore', 'error'));
}
$oldversion = "$CFG->release ($CFG->version)";
$newversion = "$release ($version)";
// test environment first
@@ -103,6 +104,13 @@ if (!check_moodle_environment($version, $environment_results, false, ENV_SELECT_
exit(1);
}
if ($interactive) {
$a = new stdClass();
$a->oldversion = $oldversion;
$a->newversion = $newversion;
echo cli_heading(get_string('databasechecking', '', $a)) . PHP_EOL;
}
// make sure we are upgrading to a stable release or display a warning
if (isset($maturity)) {
if (($maturity < MATURITY_STABLE) and !$options['allow-unstable']) {
+4 -5
View File
@@ -130,8 +130,8 @@ if (!core_tables_exist()) {
if (empty($confirmrelease)) {
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_heading($strinstallation);
$PAGE->set_title($strinstallation);
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
$PAGE->set_cacheable(false);
echo $OUTPUT->header();
echo $OUTPUT->heading("Moodle $release");
@@ -201,9 +201,8 @@ if ($version > $CFG->version) { // upgrade
$strdatabasechecking = get_string('databasechecking', '', $a);
if (empty($confirmupgrade)) {
$PAGE->navbar->add($strdatabasechecking);
$PAGE->set_title($strdatabasechecking);
$PAGE->set_heading($stradministration);
$PAGE->set_title($stradministration);
$PAGE->set_heading($strdatabasechecking);
$PAGE->set_cacheable(false);
echo $OUTPUT->header();
if (isset($maturity)) {
+1 -1
View File
@@ -386,7 +386,7 @@ $string['currentlyselectedusers'] = 'Currently selected users';
$string['currentpicture'] = 'Current picture';
$string['currentrelease'] = 'Current release information';
$string['currentversion'] = 'Current version';
$string['databasechecking'] = 'Upgrading Moodle database from version {$a->oldversion} to {$a->newversion}...';
$string['databasechecking'] = 'Upgrading Moodle database from version {$a->oldversion} to {$a->newversion}';
$string['databaseperformance'] = 'Database performance';
$string['databasesetup'] = 'Setting up database';
$string['databasesuccess'] = 'Database was successfully upgraded';