Merge branch 'MDL-41342_master' of git://github.com/dmonllao/moodle
Conflicts: theme/bootstrapbase/style/moodle.css
This commit is contained in:
+8
-1
@@ -249,6 +249,13 @@ if ($CFG->version != $DB->get_field('config', 'value', array('name'=>'version'))
|
||||
}
|
||||
|
||||
if (!$cache and $version > $CFG->version) { // upgrade
|
||||
|
||||
// Warning about upgrading a test site.
|
||||
$testsite = false;
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$testsite = 'behat';
|
||||
}
|
||||
|
||||
// We purge all of MUC's caches here.
|
||||
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
|
||||
// This ensures a real config object is loaded and the stores will be purged.
|
||||
@@ -283,7 +290,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_confirm_page($a->newversion, $maturity);
|
||||
echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
|
||||
die();
|
||||
|
||||
} else if (empty($confirmrelease)){
|
||||
|
||||
+21
-1
@@ -135,9 +135,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* during upgrade.
|
||||
* @param string $strnewversion
|
||||
* @param int $maturity
|
||||
* @param string $testsite
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_confirm_page($strnewversion, $maturity) {
|
||||
public function upgrade_confirm_page($strnewversion, $maturity, $testsite) {
|
||||
$output = '';
|
||||
|
||||
$continueurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1));
|
||||
@@ -146,6 +147,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->maturity_warning($maturity);
|
||||
$output .= $this->test_site_warning($testsite);
|
||||
$output .= $this->confirm(get_string('upgradesure', 'admin', $strnewversion), $continue, $cancelurl);
|
||||
$output .= $this->footer();
|
||||
|
||||
@@ -614,6 +616,24 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
'generalbox maturitywarning');
|
||||
}
|
||||
|
||||
/*
|
||||
* If necessary, displays a warning about upgrading a test site.
|
||||
*
|
||||
* @param string $testsite
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function test_site_warning($testsite) {
|
||||
|
||||
if (!$testsite) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->box(
|
||||
$this->container(get_string('testsiteupgradewarning', 'admin', $testsite)),
|
||||
'generalbox testsitewarning'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the copyright notice.
|
||||
* @return string HTML to output.
|
||||
|
||||
Reference in New Issue
Block a user