From fa1d403f2e0002188a6ad17162bd94e36899d359 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Tue, 15 May 2012 14:23:48 +0200 Subject: [PATCH] MDL-32610 available updates info at the Plugins check upgrade page can be hidden --- admin/renderer.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/admin/renderer.php b/admin/renderer.php index f8c408dc5d1..9efc5172ee7 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -174,6 +174,7 @@ class core_admin_renderer extends plugin_renderer_base { */ public function upgrade_plugin_check_page(plugin_manager $pluginman, available_update_checker $checker, $version, $showallplugins, $reloadurl, $continueurl) { + global $CFG; $output = ''; @@ -181,14 +182,16 @@ class core_admin_renderer extends plugin_renderer_base { $output .= $this->box_start('generalbox'); $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')))); + if (empty($CFG->disableupdatenotifications)) { + $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->container_end(); $output .= $this->plugins_check_table($pluginman, $version, array('full' => $showallplugins)); $output .= $this->box_end(); @@ -563,6 +566,8 @@ class core_admin_renderer extends plugin_renderer_base { * @return string HTML code */ public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) { + global $CFG; + $plugininfo = $pluginman->get_plugins(); if (empty($plugininfo)) { @@ -645,7 +650,7 @@ class core_admin_renderer extends plugin_renderer_base { $status = get_string('status_' . $statuscode, 'core_plugin'); $availableupdates = $plugin->available_updates(); - if (!empty($availableupdates)) { + if (!empty($availableupdates) and empty($CFG->disableupdatenotifications)) { foreach ($availableupdates as $availableupdate) { $status .= $this->plugin_available_update_info($availableupdate); }