Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
/admin/ -> renderer.php (source)

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

(no description)

File Size: 2256 lines (97 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_admin_renderer:: (56 methods):
  install_licence_page()
  upgrade_stale_php_files_page()
  install_environment_page()
  unsatisfied_dependencies_page()
  upgrade_confirm_page()
  upgrade_environment_page()
  upgrade_plugin_check_page()
  upgrade_confirm_abort_install_page()
  admin_notifications_page()
  plugin_management_page()
  check_for_updates_button()
  plugin_uninstall_confirm_page()
  plugin_uninstall_results_removable_page()
  plugin_uninstall_results_page()
  environment_check_page()
  warning()
  insecure_dataroot_warning()
  development_libs_directories_warning()
  display_errors_warning()
  themedesignermode_warning()
  buggy_iconv_warning()
  cron_overdue_warning()
  cron_infrequent_warning()
  db_problems()
  cache_warnings()
  events_handlers()
  maintenance_mode_warning()
  overridetossl_warning()
  maturity_warning()
  test_site_warning()
  moodle_copyright()
  maturity_info()
  available_updates()
  registration_warning()
  warn_if_not_registered()
  mobile_configuration_warning()
  campaign_content()
  services_and_support_content()
  forgotten_password_url_warning()
  moodle_available_update_info()
  release_notes_link()
  upgrade_reload()
  plugins_check_table()
  plugins_management_confirm_buttons()
  missing_dependencies()
  available_missing_dependencies_list()
  info_remote_plugin_not_installable()
  required_column()
  plugins_overview_panel()
  plugins_control_panel()
  plugin_available_update_info()
  environment_check_table()
  upgradekey_form_page()
  moodleorg_registration_message()
  userfeedback_encouragement()
  mnet_deprecation_warning()


Class: core_admin_renderer  - X-Ref

Standard HTML output renderer for core_admin subsystem.

install_licence_page()   X-Ref
Display the 'Do you acknowledge the terms of the GPL' page. The first page
during install.

return: string HTML to output.

upgrade_stale_php_files_page()   X-Ref
Display page explaining proper upgrade process,
there can not be any PHP file leftovers...

return: string HTML to output.

install_environment_page($maturity, $envstatus, $environment_results, $release)   X-Ref
Display the 'environment check' page that is displayed during install.

param: int $maturity
param: boolean $envstatus final result of the check (true/false)
param: array $environment_results array of results gathered
param: string $release moodle release
return: string HTML to output.

unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl)   X-Ref
Displays the list of plugins with unsatisfied dependencies

param: double|string|int $version Moodle on-disk version
param: array $failed list of plugins with unsatisfied dependecies
param: moodle_url $reloadurl URL of the page to recheck the dependencies
return: string HTML

upgrade_confirm_page($strnewversion, $maturity, $testsite)   X-Ref
Display the 'You are about to upgrade Moodle' page. The first page
during upgrade.

param: string $strnewversion
param: int $maturity
param: string $testsite
return: string HTML to output.

upgrade_environment_page($release, $envstatus, $environment_results)   X-Ref
Display the environment page during the upgrade process.

param: string $release
param: boolean $envstatus final result of env check (true/false)
param: array $environment_results array of results gathered
return: string HTML to output.

upgrade_plugin_check_page(core_plugin_manager $pluginman, \core\update\checker $checker,$version, $showallplugins, $reloadurl, $continueurl)   X-Ref
Display the upgrade page that lists all the plugins that require attention.

param: core_plugin_manager $pluginman provides information about the plugins.
param: \core\update\checker $checker provides information about available updates.
param: int $version the version of the Moodle code from version.php.
param: bool $showallplugins
param: moodle_url $reloadurl
param: moodle_url $continueurl
return: string HTML to output.

upgrade_confirm_abort_install_page(array $abortable, moodle_url $continue)   X-Ref
Display a page to confirm plugin installation cancelation.

param: array $abortable list of \core\update\plugininfo
param: moodle_url $continue
return: string

admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch,$buggyiconvnomb, $registered, array $cachewarnings = array()   X-Ref
Display the admin notifications page.

param: int $maturity
param: bool $insecuredataroot warn dataroot is invalid
param: bool $errorsdisplayed warn invalid dispaly error setting
param: bool $cronoverdue warn cron not running
param: bool $dbproblems warn db has problems
param: bool $maintenancemode warn in maintenance mode
param: bool $buggyiconvnomb warn iconv problems
param: array|null $availableupdates array of \core\update\info objects or null
param: int|null $availableupdatesfetch timestamp of the most recent updates fetch or null (unknown)
param: string[] $cachewarnings An array containing warnings from the Cache API.
param: array $eventshandlers Events 1 API handlers.
param: bool $themedesignermode Warn about the theme designer mode.
param: bool $devlibdir Warn about development libs directory presence.
param: bool $mobileconfigured Whether the mobile web services have been enabled
param: bool $overridetossl Whether or not ssl is being forced.
param: bool $invalidforgottenpasswordurl Whether the forgotten password URL does not link to a valid URL.
param: bool $croninfrequent If true, warn that cron hasn't run in the past few minutes
param: bool $showcampaigncontent Whether the campaign content should be visible or not.
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.
return: string HTML to output.

plugin_management_page(core_plugin_manager $pluginman, \core\update\checker $checker, array $options = array()   X-Ref
Display the plugin management page (admin/plugins.php).

The filtering options array may contain following items:
bool contribonly - show only contributed extensions
bool updatesonly - show only plugins with an available update

param: core_plugin_manager $pluginman
param: \core\update\checker $checker
param: array $options filtering options
return: string HTML to output.

check_for_updates_button(\core\update\checker $checker, $reloadurl)   X-Ref
Renders a button to fetch for available updates.

param: \core\update\checker $checker
param: moodle_url $reloadurl
return: string HTML

plugin_uninstall_confirm_page(core_plugin_manager $pluginman, \core\plugininfo\base $pluginfo, moodle_url $continueurl, moodle_url $cancelurl)   X-Ref
Display a page to confirm the plugin uninstallation.

param: core_plugin_manager $pluginman
param: \core\plugininfo\base $pluginfo
param: moodle_url $continueurl URL to continue after confirmation
param: moodle_url $cancelurl URL to to go if cancelled
return: string

plugin_uninstall_results_removable_page(core_plugin_manager $pluginman, \core\plugininfo\base $pluginfo,progress_trace_buffer $progress, moodle_url $continueurl)   X-Ref
Display a page with results of plugin uninstallation and offer removal of plugin files.

param: core_plugin_manager $pluginman
param: \core\plugininfo\base $pluginfo
param: progress_trace_buffer $progress
param: moodle_url $continueurl URL to continue to remove the plugin folder
return: string

plugin_uninstall_results_page(core_plugin_manager $pluginman, \core\plugininfo\base $pluginfo, progress_trace_buffer $progress)   X-Ref
Display a page with results of plugin uninstallation and inform about the need to remove plugin files manually.

param: core_plugin_manager $pluginman
param: \core\plugininfo\base $pluginfo
param: progress_trace_buffer $progress
return: string

environment_check_page($versions, $version, $envstatus, $environment_results)   X-Ref
Display the plugin management page (admin/environment.php).

param: array $versions
param: string $version
param: boolean $envstatus final result of env check (true/false)
param: array $environment_results array of results gathered
return: string HTML to output.

warning($message, $type = 'warning')   X-Ref
Output a warning message, of the type that appears on the admin notifications page.

param: string $message the message to display.
param: string $type type class
return: string HTML to output.

insecure_dataroot_warning($insecuredataroot)   X-Ref
Render an appropriate message if dataroot is insecure.

param: bool $insecuredataroot
return: string HTML to output.

development_libs_directories_warning($devlibdir)   X-Ref
Render a warning that a directory with development libs is present.

param: bool $devlibdir True if the warning should be displayed.
return: string

display_errors_warning($errorsdisplayed)   X-Ref
Render an appropriate message if dataroot is insecure.

param: bool $errorsdisplayed
return: string HTML to output.

themedesignermode_warning($themedesignermode)   X-Ref
Render an appropriate message if themdesignermode is enabled.

param: bool $themedesignermode true if enabled
return: string HTML to output.

buggy_iconv_warning($buggyiconvnomb)   X-Ref
Render an appropriate message if iconv is buggy and mbstring missing.

param: bool $buggyiconvnomb
return: string HTML to output.

cron_overdue_warning($cronoverdue)   X-Ref
Render an appropriate message if cron has not been run recently.

param: bool $cronoverdue
return: string HTML to output.

cron_infrequent_warning(bool $croninfrequent)   X-Ref
Render an appropriate message if cron is not being run frequently (recommended every minute).

param: bool $croninfrequent
return: string HTML to output.

db_problems($dbproblems)   X-Ref
Render an appropriate message if there are any problems with the DB set-up.

param: bool $dbproblems
return: string HTML to output.

cache_warnings(array $cachewarnings)   X-Ref
Renders cache warnings if there are any.

param: string[] $cachewarnings
return: string

events_handlers($eventshandlers)   X-Ref
Renders events 1 API handlers warning.

param: array $eventshandlers
return: string

maintenance_mode_warning($maintenancemode)   X-Ref
Render an appropriate message if the site in in maintenance mode.

param: bool $maintenancemode
return: string HTML to output.

overridetossl_warning($overridetossl)   X-Ref
Render a warning that ssl is forced because the site was on loginhttps.

param: bool $overridetossl Whether or not ssl is being forced.
return: string

maturity_warning($maturity)   X-Ref
Display a warning about installing development code if necesary.

param: int $maturity
return: string HTML to output.

test_site_warning($testsite)   X-Ref
No description

moodle_copyright()   X-Ref
Output the copyright notice.

return: string HTML to output.

maturity_info($maturity)   X-Ref
Display a warning about installing development code if necesary.

param: int $maturity
return: string HTML to output.

available_updates($updates, $fetch)   X-Ref
Displays the info about available Moodle core and plugin updates

The structure of the $updates param has changed since 2.4. It contains not only updates
for the core itself, but also for all other installed plugins.

param: array|null $updates array of (string)component => array of \core\update\info objects or null
param: int|null $fetch timestamp of the most recent updates fetch or null (unknown)
return: string

registration_warning($registered)   X-Ref
Display a warning about not being registered on Moodle.org if necesary.

param: boolean $registered true if the site is registered on Moodle.org
return: string HTML to output.

warn_if_not_registered()   X-Ref
Return an admin page warning if site is not registered with moodle.org

return: string

mobile_configuration_warning($mobileconfigured)   X-Ref
Display a warning about the Mobile Web Services being disabled.

param: boolean $mobileconfigured true if mobile web services are enabled
return: string HTML to output.

campaign_content(bool $showcampaigncontent)   X-Ref
Display campaign content.

param: bool $showcampaigncontent Whether the campaign content should be visible or not.
return: string the campaign content raw html.

services_and_support_content(bool $showservicesandsupport)   X-Ref
Display services and support content.

param: bool $showservicesandsupport Whether the services and support content should be visible or not.
return: string the campaign content raw html.

forgotten_password_url_warning($invalidforgottenpasswordurl)   X-Ref
Display a warning about the forgotten password URL not linking to a valid URL.

param: boolean $invalidforgottenpasswordurl true if the forgotten password URL is not valid
return: string HTML to output.

moodle_available_update_info(\core\update\info $updateinfo)   X-Ref
Helper method to render the information about the available Moodle update

param: \core\update\info $updateinfo information about the available Moodle core update

release_notes_link()   X-Ref
Display a link to the release notes.

return: string HTML to output.

upgrade_reload($url)   X-Ref
Display the reload link that appears on several upgrade/install pages.

return: string HTML to output.

plugins_check_table(core_plugin_manager $pluginman, $version, array $options = array()   X-Ref
Displays all known plugins and information about their installation or upgrade

This default implementation renders all plugins into one big table. The rendering
options support:
(bool)full = false: whether to display up-to-date plugins, too
(bool)xdep = false: display the plugins with unsatisified dependecies only

param: core_plugin_manager $pluginman provides information about the plugins.
param: int $version the version of the Moodle code from version.php.
param: array $options rendering options
return: string HTML code

plugins_management_confirm_buttons(moodle_url $continue=null, moodle_url $cancel=null)   X-Ref
Display the continue / cancel widgets for the plugins management pages.

param: null|moodle_url $continue URL for the continue button, should it be displayed
param: null|moodle_url $cancel URL for the cancel link, defaults to the current page
return: string HTML

missing_dependencies(core_plugin_manager $pluginman)   X-Ref
Displays the information about missing dependencies

param: core_plugin_manager $pluginman
return: string

available_missing_dependencies_list(core_plugin_manager $pluginman, array $dependencies)   X-Ref
Displays the list if available missing dependencies.

param: core_plugin_manager $pluginman
param: array $dependencies
return: string

info_remote_plugin_not_installable($reason)   X-Ref
Explain why {@link core_plugin_manager::is_remote_plugin_installable()} returned false.

param: string $reason the reason code as returned by the plugin manager
return: string

required_column(\core\plugininfo\base $plugin, core_plugin_manager $pluginman, $version, $branch = null)   X-Ref
Formats the information that needs to go in the 'Requires' column.

param: \core\plugininfo\base $plugin the plugin we are rendering the row for.
param: core_plugin_manager $pluginman provides data on all the plugins.
param: string $version
param: int $branch the current Moodle branch
return: string HTML code

plugins_overview_panel(core_plugin_manager $pluginman, array $options = array()   X-Ref
Prints an overview about the plugins - number of installed, number of extensions etc.

param: core_plugin_manager $pluginman provides information about the plugins
param: array $options filtering options
return: string as usually

plugins_control_panel(core_plugin_manager $pluginman, array $options = array()   X-Ref
Displays all known plugins and links to manage them

This default implementation renders all plugins into one big table.

param: core_plugin_manager $pluginman provides information about the plugins.
param: array $options filtering options
return: string HTML code

plugin_available_update_info(core_plugin_manager $pluginman, \core\update\info $updateinfo)   X-Ref
Helper method to render the information about the available plugin update

param: core_plugin_manager $pluginman plugin manager instance
param: \core\update\info $updateinfo information about the available update for the plugin

environment_check_table($result, $environment_results)   X-Ref
This function will render one beautiful table with all the environmental
configuration and how it suits Moodle needs.

param: boolean $result final result of the check (true/false)
param: environment_results[] $environment_results array of results gathered
return: string HTML to output.

upgradekey_form_page($url)   X-Ref
Render a simple page for providing the upgrade key.

param: moodle_url|string $url
return: string

moodleorg_registration_message()   X-Ref
Display message about the benefits of registering on Moodle.org

return: string

userfeedback_encouragement(bool $showfeedbackencouragement)   X-Ref
Display message about benefits of enabling the user feedback feature.

param: bool $showfeedbackencouragement Whether the encouragement content should be displayed or not
return: string

mnet_deprecation_warning($xmlrpcwarning)   X-Ref
Display a warning about the deprecation of Mnet.

param: string $xmlrpcwarning The warning message
return: string HTML to output.