MDL-41840 Restore: Page title, breadcrumbs show incorrect stage
authorsam marshall <s.marshall@open.ac.uk>
Tue, 17 Sep 2013 13:43:25 +0000 (14:43 +0100)
committersam marshall <s.marshall@open.ac.uk>
Tue, 17 Sep 2013 15:33:39 +0000 (16:33 +0100)
Unfortunately it isn't possible to display the current stage before
printing header any more, because we need to be able to show a
progress bar while doing the code that considers whether or not
priunt stage. So this change removes stage information from page
title. It is still present (in bold) in the strip that shows where
you are within the restore/import.

This display was inconsistent anyway; change makes it consistent
between Restore and Import.

backup/import.php
backup/restore.php

index 13ad15a..8c75014 100644 (file)
@@ -25,11 +25,9 @@ require_login($course);
 // Must hold restoretargetimport in the current course
 require_capability('moodle/restore:restoretargetimport', $context);
 
-$heading = get_string('import');
-
 // Set up the page
-$PAGE->set_title($heading);
-$PAGE->set_heading($heading);
+$PAGE->set_title($course->shortname . ': ' . get_string('import'));
+$PAGE->set_heading($course->fullname);
 $PAGE->set_url(new moodle_url('/backup/import.php', array('id'=>$courseid)));
 $PAGE->set_context($context);
 $PAGE->set_pagelayout('incourse');
@@ -182,11 +180,6 @@ if ($backup->get_stage() == backup_ui::STAGE_FINAL) {
     $backup->save_controller();
 }
 
-// Adjust the page for the stage
-$PAGE->set_title($heading.': '.$backup->get_stage_name());
-$PAGE->set_heading($heading.': '.$backup->get_stage_name());
-$PAGE->navbar->add($backup->get_stage_name());
-
 // Display the current stage
 echo $OUTPUT->header();
 if ($backup->enforce_changed_dependencies()) {
index 6040d4b..7a6ed73 100644 (file)
@@ -43,11 +43,8 @@ if ($stage & restore_ui::STAGE_CONFIRM + restore_ui::STAGE_DESTINATION) {
     }
 }
 
-$heading = $course->fullname;
-
-$PAGE->set_title($heading.': '.$restore->get_stage_name());
-$PAGE->set_heading($heading);
-$PAGE->navbar->add($restore->get_stage_name());
+$PAGE->set_title($course->shortname . ': ' . get_string('restore'));
+$PAGE->set_heading($course->fullname);
 
 $renderer = $PAGE->get_renderer('core','backup');
 echo $OUTPUT->header();