diff --git a/admin/index.php b/admin/index.php index 33786fc3af6..e6815e03fce 100644 --- a/admin/index.php +++ b/admin/index.php @@ -937,20 +937,31 @@ $result = new environment_results('custom_checks'); $result = check_xmlrpc_usage($result); $xmlrpcwarning = !is_null($result) ? get_string($result->getFeedbackStr(), 'admin') : ''; -// Check whether MoodleNet features are enabled and warn about removal. -$moodlenetwarning = ''; -$moodlenetenabled = get_config('tool_moodlenet', 'enablemoodlenet'); -if ($moodlenetenabled) { - $moodlenetwarning = get_string('moodlenetremovalwarning', 'admin'); -} - admin_externalpage_setup('adminnotifications'); $output = $PAGE->get_renderer('core', 'admin'); -echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems, - $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb, - $registered, $cachewarnings, $eventshandlers, $themedesignermode, $devlibdir, - $mobileconfigured, $overridetossl, $invalidforgottenpasswordurl, $croninfrequent, - $showcampaigncontent, $showfeedbackencouragement, $servicesandsupportcontent, - $xmlrpcwarning, $moodlenetwarning); +echo $output->admin_notifications_page( + $maturity, + $insecuredataroot, + $errorsdisplayed, + $cronoverdue, + $dbproblems, + $maintenancemode, + $availableupdates, + $availableupdatesfetch, + $buggyiconvnomb, + $registered, + $cachewarnings, + $eventshandlers, + $themedesignermode, + $devlibdir, + $mobileconfigured, + $overridetossl, + $invalidforgottenpasswordurl, + $croninfrequent, + $showcampaigncontent, + $showfeedbackencouragement, + $servicesandsupportcontent, + $xmlrpcwarning +); diff --git a/admin/renderer.php b/admin/renderer.php index 57873da1b8c..41e91dff3ea 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -279,17 +279,33 @@ class core_admin_renderer extends plugin_renderer_base { * @param bool $showfeedbackencouragement Whether the feedback encouragement content should be displayed or not. * @param bool $showservicesandsupport Whether the services and support content should be displayed or not. * @param string $xmlrpcwarning XML-RPC deprecation warning message. - * @param string $moodlenetwarning MoodleNet removal warning message. * * @return string HTML to output. */ - public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, - $cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, - $buggyiconvnomb, $registered, array $cachewarnings = array(), $eventshandlers = 0, - $themedesignermode = false, $devlibdir = false, $mobileconfigured = false, - $overridetossl = false, $invalidforgottenpasswordurl = false, $croninfrequent = false, - $showcampaigncontent = false, bool $showfeedbackencouragement = false, bool $showservicesandsupport = false, - $xmlrpcwarning = '', $moodlenetwarning = '') { + public function admin_notifications_page( + $maturity, + $insecuredataroot, + $errorsdisplayed, + $cronoverdue, + $dbproblems, + $maintenancemode, + $availableupdates, + $availableupdatesfetch, + $buggyiconvnomb, + $registered, + array $cachewarnings = [], + $eventshandlers = 0, + $themedesignermode = false, + $devlibdir = false, + $mobileconfigured = false, + $overridetossl = false, + $invalidforgottenpasswordurl = false, + $croninfrequent = false, + $showcampaigncontent = false, + bool $showfeedbackencouragement = false, + bool $showservicesandsupport = false, + $xmlrpcwarning = '' + ) { global $CFG; $output = ''; @@ -314,7 +330,7 @@ class core_admin_renderer extends plugin_renderer_base { $output .= $this->mobile_configuration_warning($mobileconfigured); $output .= $this->forgotten_password_url_warning($invalidforgottenpasswordurl); $output .= $this->mnet_deprecation_warning($xmlrpcwarning); - $output .= $this->moodlenet_removal_warning($moodlenetwarning); + $output .= $this->moodlenet_removal_warning(); $output .= $this->userfeedback_encouragement($showfeedbackencouragement); $output .= $this->services_and_support_content($showservicesandsupport); $output .= $this->campaign_content($showcampaigncontent); @@ -2331,15 +2347,16 @@ class core_admin_renderer extends plugin_renderer_base { /** * Display a warning about the removal of MoodleNet integration. * - * @param string $moodlenetwarning The warning message * @return string HTML to output. */ - protected function moodlenet_removal_warning($moodlenetwarning) { - if (empty($moodlenetwarning)) { - return ''; + protected function moodlenet_removal_warning(): string { + $moodlenetenabled = get_config('tool_moodlenet', 'enablemoodlenet'); + if (empty($moodlenetenabled)) { + $moodlenetwarning = get_string('moodlenetremovalwarning', 'admin'); + return $this->warning($moodlenetwarning); } - return $this->warning($moodlenetwarning); + return ''; } /**