From 40044554004d05dd6a61757c98d8caae4327434e Mon Sep 17 00:00:00 2001 From: Laurent David Date: Mon, 15 Jul 2024 18:20:52 +0200 Subject: [PATCH] MDL-82297 core: Add notification to warn admins * In Moodle 5.0 we will remove Chat and Survey module and we will need to announce it beforehand --- admin/renderer.php | 17 +++++++++++++++++ lang/en/admin.php | 5 +++++ theme/boost/scss/moodle/admin.scss | 5 +++++ theme/boost/style/moodle.css | 5 +++++ theme/classic/style/moodle.css | 5 +++++ 5 files changed, 37 insertions(+) diff --git a/admin/renderer.php b/admin/renderer.php index 6e53a42ad2ed2..1d683ed96731e 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -295,6 +295,7 @@ public function admin_notifications_page($maturity, $insecuredataroot, $errorsdi $output .= $this->header(); $output .= $this->output->heading(get_string('notifications', 'admin')); + $output .= $this->upgrade_news_message(); $output .= $this->maturity_info($maturity); $output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : ''; $output .= $this->insecure_dataroot_warning($insecuredataroot); @@ -754,6 +755,22 @@ protected function moodle_copyright() { return $this->box($copyrighttext, 'copyright'); } + /** + * Display a transient notification for important upgrades messages for + * specific releases. + * + * @return string HTML to output. + */ + protected function upgrade_news_message() { + return $this->notification( + get_string('importantupdates_content', 'admin'), + 'info', + false, + get_string('importantupdates_title', 'admin'), + true + ); + } + /** * Display a warning about installing development code if necesary. * @param int $maturity diff --git a/lang/en/admin.php b/lang/en/admin.php index be392c748380c..fbce62b784e8c 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -764,6 +764,11 @@ $string['iconvrequired'] = 'Installing ICONV extension is required.'; $string['igbinary322buggyversion'] = 'The php-igbinary extension installed on the site can lead to problems when running with PHP 7.2. You are recommended to either upgrade to php-igbinary 3.2.5 or later, or alternatively to upgrade to PHP 7.3 or later.'; $string['ignore'] = 'Ignore'; +$string['importantupdates_content'] = '

In the next Moodle 5.0, planned for release in April 2025, the Chat and Survey activities will +be removed from core Moodle. They will be available as plugins in the +Moodle plugins directory.

+

If you wish to continue using Chat or Survey in your site, you will be able to install them as plugins before upgrading to Moodle 5.0.

'; +$string['importantupdates_title'] = 'Important update about Chat and Survey activities'; $string['includemoduleuserdata'] = 'Include module user data'; $string['incompatibleblocks'] = 'Incompatible blocks'; $string['indexdata'] = 'Index data'; diff --git a/theme/boost/scss/moodle/admin.scss b/theme/boost/scss/moodle/admin.scss index c1aba6f31136f..33c9cfd213d77 100644 --- a/theme/boost/scss/moodle/admin.scss +++ b/theme/boost/scss/moodle/admin.scss @@ -427,6 +427,11 @@ text-align: center; } +#page-admin-index #page-content a { + font-weight: normal; + text-decoration: underline; +} + // Plugins overview page at admin/plugins.php #page-admin-plugins { #plugins-overview-panel { diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index bba582f17a008..8c21cf71c923b 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -26830,6 +26830,11 @@ body.behat-site .action-menu .dropdown-subpanel-content.show { text-align: center; } +#page-admin-index #page-content a { + font-weight: normal; + text-decoration: underline; +} + #page-admin-plugins #plugins-overview-panel .info { display: inline-block; margin-right: 1em; diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index abf1af20e4afd..b02273a87af4c 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -26830,6 +26830,11 @@ body.behat-site .action-menu .dropdown-subpanel-content.show { text-align: center; } +#page-admin-index #page-content a { + font-weight: normal; + text-decoration: underline; +} + #page-admin-plugins #plugins-overview-panel .info { display: inline-block; margin-right: 1em;