Search moodle.org's
Developer Documentation

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
  • /admin/ -> renderer.php (source)

    Differences Between: [Versions 310 and 34] [Versions 310 and 35] [Versions 310 and 36] [Versions 310 and 37] [Versions 310 and 38] [Versions 34 and 310] [Versions 35 and 310] [Versions 36 and 310] [Versions 37 and 310] [Versions 38 and 310]

    Renderer for core_admin subsystem

    Copyright: 2011 David Mudrak <david@moodle.com>
    License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
    File Size: 2200 lines (95 kb)
    Included or required:0 times
    Referenced: 0 times
    Includes or requires: 0 files

    Defines 1 class

    core_admin_renderer:: (55 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()
      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()
      legacy_log_store_writing_error()
      moodleorg_registration_message()
      userfeedback_encouragement()


    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.

    return: string HTML to output.
    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

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

    return: string HTML
    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

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

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

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

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

    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.

    return: string HTML to output.
    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

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

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

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

    return: string HTML to output.
    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.

    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

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

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

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

    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.

    return: string
    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

    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.

    return: string
    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

    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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    return: string
    param: string[] $cachewarnings

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

    return: string
    param: array $eventshandlers

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

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

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

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

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

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

    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.

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

    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.

    return: string
    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)

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

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

    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.

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

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

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

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

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

    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

    return: string HTML code
    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

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

    return: string HTML
    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

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

    return: string
    param: core_plugin_manager $pluginman

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

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

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

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

    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.

    return: string HTML code
    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

    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.

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

    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.

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

    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.

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

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

    return: string
    param: moodle_url|string $url

    legacy_log_store_writing_error()   X-Ref
    Check to see if writing to the deprecated legacy log store is enabled.

    return: string An error message if writing to the legacy log store is enabled.

    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.

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