mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-20438 display available updates during the upgrade, too
We are displaying available updates for installed plugins only. It was decided (by me and Eloy) that we will not display info about available Moodle update during the upgrade. It seems to be redundant as the admin just uploaded a new version of Moodle so they probably chose what they wanted.
This commit is contained in:
parent
bc06cbc36b
commit
96dd92376f
3 changed files with 53 additions and 8 deletions
|
@ -232,9 +232,17 @@ if ($version > $CFG->version) { // upgrade
|
||||||
$PAGE->set_heading($strplugincheck);
|
$PAGE->set_heading($strplugincheck);
|
||||||
$PAGE->set_cacheable(false);
|
$PAGE->set_cacheable(false);
|
||||||
|
|
||||||
|
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1));
|
||||||
|
|
||||||
|
if ($fetchupdates) {
|
||||||
|
require_sesskey();
|
||||||
|
available_update_checker::instance()->fetch();
|
||||||
|
redirect($reloadurl);
|
||||||
|
}
|
||||||
|
|
||||||
$output = $PAGE->get_renderer('core', 'admin');
|
$output = $PAGE->get_renderer('core', 'admin');
|
||||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||||
new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1)),
|
$version, $showallplugins, $reloadurl,
|
||||||
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
|
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
|
||||||
die();
|
die();
|
||||||
|
|
||||||
|
@ -265,9 +273,16 @@ if (moodle_needs_upgrading()) {
|
||||||
$PAGE->set_heading($strplugincheck);
|
$PAGE->set_heading($strplugincheck);
|
||||||
$PAGE->set_cacheable(false);
|
$PAGE->set_cacheable(false);
|
||||||
|
|
||||||
|
if ($fetchupdates) {
|
||||||
|
require_sesskey();
|
||||||
|
available_update_checker::instance()->fetch();
|
||||||
|
redirect($PAGE->url);
|
||||||
|
}
|
||||||
|
|
||||||
$output = $PAGE->get_renderer('core', 'admin');
|
$output = $PAGE->get_renderer('core', 'admin');
|
||||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||||
new moodle_url('/admin/index.php'),
|
$version, $showallplugins,
|
||||||
|
new moodle_url($PAGE->url),
|
||||||
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
|
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,18 +165,31 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||||
/**
|
/**
|
||||||
* Display the upgrade page that lists all the plugins that require attention.
|
* Display the upgrade page that lists all the plugins that require attention.
|
||||||
* @param plugin_manager $pluginman provides information about the plugins.
|
* @param plugin_manager $pluginman provides information about the plugins.
|
||||||
|
* @param available_update_checker $checker provides information about available updates.
|
||||||
* @param int $version the version of the Moodle code from version.php.
|
* @param int $version the version of the Moodle code from version.php.
|
||||||
* @param bool $showallplugins
|
* @param bool $showallplugins
|
||||||
* @param moodle_url $reloadurl
|
* @param moodle_url $reloadurl
|
||||||
* @param moodle_url $continueurl
|
* @param moodle_url $continueurl
|
||||||
* @return string HTML to output.
|
* @return string HTML to output.
|
||||||
*/
|
*/
|
||||||
public function upgrade_plugin_check_page(plugin_manager $pluginman, $version, $showallplugins, $reloadurl, $continueurl) {
|
public function upgrade_plugin_check_page(plugin_manager $pluginman, available_update_checker $checker,
|
||||||
|
$version, $showallplugins, $reloadurl, $continueurl) {
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
$output .= $this->header();
|
$output .= $this->header();
|
||||||
$output .= $this->box_start('generalbox');
|
$output .= $this->box_start('generalbox');
|
||||||
$output .= $this->container(get_string('pluginchecknotice', 'core_plugin'), 'generalbox', 'notice');
|
$output .= $this->container_start('generalbox', 'notice');
|
||||||
|
$output .= html_writer::tag('p', get_string('pluginchecknotice', 'core_plugin'));
|
||||||
|
$output .= $this->container_start('checkforupdates');
|
||||||
|
$output .= $this->single_button(new moodle_url($reloadurl, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin'));
|
||||||
|
if ($timefetched = $checker->get_last_timefetched()) {
|
||||||
|
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||||
|
userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'))));
|
||||||
|
}
|
||||||
|
$output .= $this->container_end();
|
||||||
|
$output .= $this->container_end();
|
||||||
|
|
||||||
$output .= $this->plugins_check_table($pluginman, $version, array('full' => $showallplugins));
|
$output .= $this->plugins_check_table($pluginman, $version, array('full' => $showallplugins));
|
||||||
$output .= $this->box_end();
|
$output .= $this->box_end();
|
||||||
$output .= $this->upgrade_reload($reloadurl);
|
$output .= $this->upgrade_reload($reloadurl);
|
||||||
|
@ -592,8 +605,16 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||||
|
|
||||||
$statuscode = $plugin->get_status();
|
$statuscode = $plugin->get_status();
|
||||||
$row->attributes['class'] .= ' status-' . $statuscode;
|
$row->attributes['class'] .= ' status-' . $statuscode;
|
||||||
|
$status = get_string('status_' . $statuscode, 'core_plugin');
|
||||||
|
|
||||||
$status = new html_table_cell(get_string('status_' . $statuscode, 'core_plugin'));
|
$availableupdates = $plugin->available_updates();
|
||||||
|
if (!empty($availableupdates)) {
|
||||||
|
foreach ($availableupdates as $availableupdate) {
|
||||||
|
$status .= $this->plugin_available_update_info($availableupdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$status = new html_table_cell($status);
|
||||||
|
|
||||||
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version));
|
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version));
|
||||||
|
|
||||||
|
@ -601,7 +622,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||||
plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE));
|
plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE));
|
||||||
$dependenciesok = $pluginman->are_dependencies_satisfied(
|
$dependenciesok = $pluginman->are_dependencies_satisfied(
|
||||||
$plugin->get_other_required_plugins());
|
$plugin->get_other_required_plugins());
|
||||||
if ($isstandard and $statusisboring and $dependenciesok) {
|
if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
|
||||||
if (empty($options['full'])) {
|
if (empty($options['full'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,9 @@
|
||||||
.dir-rtl.path-admin .roleassigntable p {text-align: right;}
|
.dir-rtl.path-admin .roleassigntable p {text-align: right;}
|
||||||
|
|
||||||
/** Plugins check */
|
/** Plugins check */
|
||||||
|
#page-admin-index #notice .checkforupdates {text-align:center;}
|
||||||
#page-admin-index #plugins-check-info {text-align:center;margin:1em;}
|
#page-admin-index #plugins-check-info {text-align:center;margin:1em;}
|
||||||
|
#page-admin-index #plugins-check td {vertical-align: top;}
|
||||||
#page-admin-index #plugins-check {margin-left:auto; margin-right:auto;}
|
#page-admin-index #plugins-check {margin-left:auto; margin-right:auto;}
|
||||||
#page-admin-index #plugins-check .displayname .pluginicon {width:16px;}
|
#page-admin-index #plugins-check .displayname .pluginicon {width:16px;}
|
||||||
#page-admin-index #plugins-check .missingfromdisk .displayname {background-color:#ffd3d9;}
|
#page-admin-index #plugins-check .missingfromdisk .displayname {background-color:#ffd3d9;}
|
||||||
|
@ -211,6 +213,13 @@
|
||||||
#page-admin-index #plugins-check .requires li {display:block;}
|
#page-admin-index #plugins-check .requires li {display:block;}
|
||||||
#page-admin-index #plugins-check .requires-ok {color:#999;}
|
#page-admin-index #plugins-check .requires-ok {color:#999;}
|
||||||
#page-admin-index #plugins-check .requires-failed {background-color:#ffd3d9;}
|
#page-admin-index #plugins-check .requires-failed {background-color:#ffd3d9;}
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo {padding:5px 10px;margin:10px;background-color:#d2ebff;-moz-border-radius: 10px;-webkit-border-radius: 10px;border-radius: 10px;}
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo.maturity50 {background-color:#ffd3d9;}
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo.maturity100,
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo.maturity150 {background-color:#f3f2aa;}
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo span,
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo a {padding-right:1em;}
|
||||||
|
#page-admin-index #plugins-check .status .pluginupdateinfo .separator {border-left:1px dotted #333;}
|
||||||
|
|
||||||
/** Plugins management */
|
/** Plugins management */
|
||||||
#page-admin-plugins .checkforupdates {margin:0 auto 1em;text-align:center;}
|
#page-admin-plugins .checkforupdates {margin:0 auto 1em;text-align:center;}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue