Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Standard HTML output renderer for core_admin subsystem. More...
Public Member Functions | |
__call ($method, $arguments) | |
Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief. More... | |
add_action_handler (component_action $action, $id=null) | |
Adds a JS action for the element with the provided id. More... | |
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) | |
Display the admin notifications page. More... | |
cache_warnings (array $cachewarnings) | |
Renders cache warnings if there are any. More... | |
check_for_updates_button (\core\update\checker $checker, $reloadurl) | |
Renders a button to fetch for available updates. More... | |
cron_infrequent_warning (bool $croninfrequent) | |
Render an appropriate message if cron is not being run frequently (recommended every minute). More... | |
cron_overdue_warning ($cronoverdue) | |
Render an appropriate message if cron has not been run recently. More... | |
db_problems ($dbproblems) | |
Render an appropriate message if there are any problems with the DB set-up. More... | |
environment_check_page ($versions, $version, $envstatus, $environment_results) | |
Display the plugin management page (admin/environment.php). More... | |
environment_check_table ($result, $environment_results) | |
This function will render one beautiful table with all the environmental configuration and how it suits Moodle needs. More... | |
events_handlers ($eventshandlers) | |
Renders events 1 API handlers warning. More... | |
get_compact_logo_url ($maxwidth=300, $maxheight=300) | |
Return the site's compact logo URL, if any. More... | |
get_logo_url ($maxwidth=null, $maxheight=200) | |
Return the site's logo URL, if any. More... | |
has_started () | |
Returns true is output has already started, and false if not. More... | |
image_url ($imagename, $component='moodle') | |
Return the moodle_url for an image. More... | |
install_environment_page ($maturity, $envstatus, $environment_results, $release) | |
Display the 'environment check' page that is displayed during install. More... | |
install_licence_page () | |
Display the 'Do you acknowledge the terms of the GPL' page. More... | |
maintenance_mode_warning ($maintenancemode) | |
Render an appropriate message if the site in in maintenance mode. More... | |
moodleorg_registration_message () | |
Display message about the benefits of registering on Moodle.org. More... | |
pix_url ($imagename, $component='moodle') | |
Return the direct URL for an image from the pix folder. More... | |
plugin_management_page (core_plugin_manager $pluginman, core\update\checker $checker, array $options=array()) | |
Display the plugin management page (admin/plugins.php). More... | |
plugin_uninstall_confirm_page (core_plugin_manager $pluginman, core\plugininfo\base $pluginfo, moodle_url $continueurl, moodle_url $cancelurl) | |
Display a page to confirm the plugin uninstallation. More... | |
plugin_uninstall_results_page (core_plugin_manager $pluginman, core\plugininfo\base $pluginfo, progress_trace_buffer $progress) | |
Display a page with results of plugin uninstallation and inform about the need to remove plugin files manually. More... | |
plugin_uninstall_results_removable_page (core_plugin_manager $pluginman, core\plugininfo\base $pluginfo, progress_trace_buffer $progress, moodle_url $continueurl) | |
Display a page with results of plugin uninstallation and offer removal of plugin files. More... | |
plugins_check_table (core_plugin_manager $pluginman, $version, array $options=array()) | |
Displays all known plugins and information about their installation or upgrade. More... | |
plugins_control_panel (core_plugin_manager $pluginman, array $options=array()) | |
Displays all known plugins and links to manage them. More... | |
plugins_management_confirm_buttons (moodle_url $continue=null, moodle_url $cancel=null) | |
Display the continue / cancel widgets for the plugins management pages. More... | |
plugins_overview_panel (core_plugin_manager $pluginman, array $options=array()) | |
Prints an overview about the plugins - number of installed, number of extensions etc. More... | |
render (renderable $widget) | |
Renders the provided widget and returns the HTML to display it. More... | |
render_from_template ($templatename, $context) | |
Renders a template by name with the given context. More... | |
should_display_main_logo ($headinglevel=1) | |
Whether we should display the main logo. More... | |
should_display_navbar_logo () | |
Whether we should display the logo in the navbar. More... | |
unsatisfied_dependencies_page ($version, array $failed, moodle_url $reloadurl) | |
Displays the list of plugins with unsatisfied dependencies. More... | |
upgrade_confirm_abort_install_page (array $abortable, moodle_url $continue) | |
Display a page to confirm plugin installation cancelation. More... | |
upgrade_confirm_page ($strnewversion, $maturity, $testsite) | |
Display the 'You are about to upgrade Moodle' page. More... | |
upgrade_environment_page ($release, $envstatus, $environment_results) | |
Display the environment page during the upgrade process. More... | |
upgrade_plugin_check_page (core_plugin_manager $pluginman, core\update\checker $checker, $version, $showallplugins, $reloadurl, $continueurl) | |
Display the upgrade page that lists all the plugins that require attention. More... | |
upgrade_reload ($url) | |
Display the reload link that appears on several upgrade/install pages. More... | |
upgrade_stale_php_files_page () | |
Display page explaining proper upgrade process, there can not be any PHP file leftovers... More... | |
upgradekey_form_page ($url) | |
Render a simple page for providing the upgrade key. More... | |
warn_if_not_registered () | |
Return an admin page warning if site is not registered with moodle.org. More... | |
Static Public Member Functions | |
static | prepare_classes ($classes) |
Given an array or space-separated list of classes, prepares and returns the HTML class attribute value. More... | |
Protected Member Functions | |
available_missing_dependencies_list (core_plugin_manager $pluginman, array $dependencies) | |
Displays the list if available missing dependencies. More... | |
available_updates ($updates, $fetch) | |
Displays the info about available Moodle core and plugin updates. More... | |
buggy_iconv_warning ($buggyiconvnomb) | |
Render an appropriate message if iconv is buggy and mbstring missing. More... | |
development_libs_directories_warning ($devlibdir) | |
Render a warning that a directory with development libs is present. More... | |
display_errors_warning ($errorsdisplayed) | |
Render an appropriate message if dataroot is insecure. More... | |
forgotten_password_url_warning ($invalidforgottenpasswordurl) | |
Display a warning about the forgotten password URL not linking to a valid URL. More... | |
get_mustache () | |
Return an instance of the mustache class. More... | |
info_remote_plugin_not_installable ($reason) | |
Explain why core_plugin_manager::is_remote_plugin_installable() returned false. More... | |
insecure_dataroot_warning ($insecuredataroot) | |
Render an appropriate message if dataroot is insecure. More... | |
legacy_log_store_writing_error () | |
Check to see if writing to the deprecated legacy log store is enabled. More... | |
maturity_info ($maturity) | |
Display a warning about installing development code if necesary. More... | |
maturity_warning ($maturity) | |
Display a warning about installing development code if necesary. More... | |
missing_dependencies (core_plugin_manager $pluginman) | |
Displays the information about missing dependencies. More... | |
mobile_configuration_warning ($mobileconfigured) | |
Display a warning about the Mobile Web Services being disabled. More... | |
moodle_available_update_info (\core\update\info $updateinfo) | |
Helper method to render the information about the available Moodle update. More... | |
moodle_copyright () | |
Output the copyright notice. More... | |
overridetossl_warning ($overridetossl) | |
Render a warning that ssl is forced because the site was on loginhttps. More... | |
plugin_available_update_info (core_plugin_manager $pluginman, core\update\info $updateinfo) | |
Helper method to render the information about the available plugin update. More... | |
registration_warning ($registered) | |
Display a warning about not being registered on Moodle.org if necesary. More... | |
release_notes_link () | |
Display a link to the release notes. More... | |
required_column (\core\plugininfo\base $plugin, core_plugin_manager $pluginman, $version) | |
Formats the information that needs to go in the 'Requires' column. More... | |
test_site_warning ($testsite) | |
themedesignermode_warning ($themedesignermode) | |
Render an appropriate message if themdesignermode is enabled. More... | |
warning ($message, $type='warning') | |
Output a warning message, of the type that appears on the admin notifications page. More... | |
Protected Attributes | |
xhtml_container_stack | $opencontainers |
The xhtml_container_stack to use. | |
renderer_base core_renderer | $output |
A reference to the current renderer. More... | |
moodle_page | $page |
The Moodle page the renderer has been created to assist with. | |
string | $target |
The requested rendering target. | |
Standard HTML output renderer for core_admin subsystem.
|
inherited |
Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief.
string | $method | |
array | $arguments |
mixed |
|
inherited |
Adds a JS action for the element with the provided id.
This method adds a JS event for the provided component action to the page and then returns the id that the event has been attached to. If no id has been provided then a new ID is generated by html_writer::random_id()
component_action | $action | |
string | $id |
string | id of element, either original submitted or random new if not supplied |
core_admin_renderer::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 |
|||
) |
Display the admin notifications page.
int | $maturity | |
bool | $insecuredataroot | warn dataroot is invalid |
bool | $errorsdisplayed | warn invalid dispaly error setting |
bool | $cronoverdue | warn cron not running |
bool | $dbproblems | warn db has problems |
bool | $maintenancemode | warn in maintenance mode |
bool | $buggyiconvnomb | warn iconv problems |
array | null | $availableupdates | array of core\update\info objects or null |
int | null | $availableupdatesfetch | timestamp of the most recent updates fetch or null (unknown) |
string[] | $cachewarnings | An array containing warnings from the Cache API. |
array | $eventshandlers | Events 1 API handlers. |
bool | $themedesignermode | Warn about the theme designer mode. |
bool | $devlibdir | Warn about development libs directory presence. |
bool | $mobileconfigured | Whether the mobile web services have been enabled |
bool | $overridetossl | Whether or not ssl is being forced. |
bool | $invalidforgottenpasswordurl | Whether the forgotten password URL does not link to a valid URL. |
bool | $croninfrequent | If true, warn that cron hasn't run in the past few minutes |
string | HTML to output. |
|
protected |
Displays the list if available missing dependencies.
core_plugin_manager | $pluginman | |
array | $dependencies |
string |
|
protected |
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.
array | null | $updates | array of (string)component => array of core\update\info objects or null |
int | null | $fetch | timestamp of the most recent updates fetch or null (unknown) |
string |
|
protected |
Render an appropriate message if iconv is buggy and mbstring missing.
bool | $buggyiconvnomb |
string | HTML to output. |
core_admin_renderer::cache_warnings | ( | array | $cachewarnings | ) |
Renders cache warnings if there are any.
string[] | $cachewarnings |
string |
core_admin_renderer::check_for_updates_button | ( | \core\update\checker | $checker, |
$reloadurl | |||
) |
Renders a button to fetch for available updates.
core\update\checker | $checker | |
moodle_url | $reloadurl |
string | HTML |
core_admin_renderer::cron_infrequent_warning | ( | bool | $croninfrequent | ) |
Render an appropriate message if cron is not being run frequently (recommended every minute).
bool | $croninfrequent |
string | HTML to output. |
core_admin_renderer::cron_overdue_warning | ( | $cronoverdue | ) |
Render an appropriate message if cron has not been run recently.
bool | $cronoverdue |
string | HTML to output. |
core_admin_renderer::db_problems | ( | $dbproblems | ) |
Render an appropriate message if there are any problems with the DB set-up.
bool | $dbproblems |
string | HTML to output. |
|
protected |
Render a warning that a directory with development libs is present.
bool | $devlibdir | True if the warning should be displayed. |
string |
|
protected |
Render an appropriate message if dataroot is insecure.
bool | $errorsdisplayed |
string | HTML to output. |
core_admin_renderer::environment_check_page | ( | $versions, | |
$version, | |||
$envstatus, | |||
$environment_results | |||
) |
Display the plugin management page (admin/environment.php).
array | $versions | |
string | $version | |
boolean | $envstatus | final result of env check (true/false) |
array | $environment_results | array of results gathered |
string | HTML to output. |
core_admin_renderer::environment_check_table | ( | $result, | |
$environment_results | |||
) |
This function will render one beautiful table with all the environmental configuration and how it suits Moodle needs.
boolean | $result | final result of the check (true/false) |
environment_results[] | $environment_results | array of results gathered |
string | HTML to output. |
core_admin_renderer::events_handlers | ( | $eventshandlers | ) |
Renders events 1 API handlers warning.
array | $eventshandlers |
string |
|
protected |
Display a warning about the forgotten password URL not linking to a valid URL.
boolean | $invalidforgottenpasswordurl | true if the forgotten password URL is not valid |
string | HTML to output. |
|
inherited |
Return the site's compact logo URL, if any.
int | $maxwidth | The maximum width, or null when the maximum width does not matter. |
int | $maxheight | The maximum height, or null when the maximum height does not matter. |
moodle_url|false |
|
inherited |
Return the site's logo URL, if any.
int | $maxwidth | The maximum width, or null when the maximum width does not matter. |
int | $maxheight | The maximum height, or null when the maximum height does not matter. |
moodle_url|false |
|
protectedinherited |
Return an instance of the mustache class.
Mustache_Engine |
|
inherited |
Returns true is output has already started, and false if not.
boolean | true if the header has been printed. |
|
inherited |
Return the moodle_url for an image.
The exact image location and extension is determined automatically by searching for gif|png|jpg|jpeg, please note there can not be diferent images with the different extension. The imagename is for historical reasons a relative path name, it may be changed later for core images. It is recommended to not use subdirectories in plugin and theme pix directories.
There are three types of images: 1/ theme images - stored in theme/mytheme/pix/, use component 'theme' 2/ core images - stored in /pix/, overridden via theme/mytheme/pix_core/ 3/ plugin images - stored in mod/mymodule/pix, overridden via theme/mytheme/pix_plugins/mod/mymodule/, example: image_url('comment', 'mod_glossary')
string | $imagename | the pathname of the image |
string | $component | full plugin name (aka component) or 'theme' |
moodle_url |
|
protected |
Explain why core_plugin_manager::is_remote_plugin_installable() returned false.
string | $reason | the reason code as returned by the plugin manager |
string |
|
protected |
Render an appropriate message if dataroot is insecure.
bool | $insecuredataroot |
string | HTML to output. |
core_admin_renderer::install_environment_page | ( | $maturity, | |
$envstatus, | |||
$environment_results, | |||
$release | |||
) |
Display the 'environment check' page that is displayed during install.
int | $maturity | |
boolean | $envstatus | final result of the check (true/false) |
array | $environment_results | array of results gathered |
string | $release | moodle release |
string | HTML to output. |
core_admin_renderer::install_licence_page | ( | ) |
Display the 'Do you acknowledge the terms of the GPL' page.
The first page during install.
string | HTML to output. |
|
protected |
Check to see if writing to the deprecated legacy log store is enabled.
string | An error message if writing to the legacy log store is enabled. |
core_admin_renderer::maintenance_mode_warning | ( | $maintenancemode | ) |
Render an appropriate message if the site in in maintenance mode.
bool | $maintenancemode |
string | HTML to output. |
|
protected |
Display a warning about installing development code if necesary.
int | $maturity |
string | HTML to output. |
|
protected |
Display a warning about installing development code if necesary.
int | $maturity |
string | HTML to output. |
|
protected |
Displays the information about missing dependencies.
core_plugin_manager | $pluginman |
string |
|
protected |
Display a warning about the Mobile Web Services being disabled.
boolean | $mobileconfigured | true if mobile web services are enabled |
string | HTML to output. |
|
protected |
Helper method to render the information about the available Moodle update.
core\update\info | $updateinfo | information about the available Moodle core update |
|
protected |
Output the copyright notice.
string | HTML to output. |
core_admin_renderer::moodleorg_registration_message | ( | ) |
Display message about the benefits of registering on Moodle.org.
string |
|
protected |
Render a warning that ssl is forced because the site was on loginhttps.
bool | $overridetossl | Whether or not ssl is being forced. |
string |
|
inherited |
Return the direct URL for an image from the pix folder.
Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template.
string | $imagename | the name of the icon. |
string | $component | specification of one plugin like in get_string() |
moodle_url |
|
protected |
Helper method to render the information about the available plugin update.
core_plugin_manager | $pluginman | plugin manager instance |
core\update\info | $updateinfo | information about the available update for the plugin |
core_admin_renderer::plugin_management_page | ( | core_plugin_manager | $pluginman, |
core\update\checker | $checker, | ||
array | $options = array() |
||
) |
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
core_plugin_manager | $pluginman | |
core\update\checker | $checker | |
array | $options | filtering options |
string | HTML to output. |
core_admin_renderer::plugin_uninstall_confirm_page | ( | core_plugin_manager | $pluginman, |
core\plugininfo\base | $pluginfo, | ||
moodle_url | $continueurl, | ||
moodle_url | $cancelurl | ||
) |
Display a page to confirm the plugin uninstallation.
core_plugin_manager | $pluginman | |
core\plugininfo\base | $pluginfo | |
moodle_url | $continueurl | URL to continue after confirmation |
moodle_url | $cancelurl | URL to to go if cancelled |
string |
core_admin_renderer::plugin_uninstall_results_page | ( | core_plugin_manager | $pluginman, |
core\plugininfo\base | $pluginfo, | ||
progress_trace_buffer | $progress | ||
) |
Display a page with results of plugin uninstallation and inform about the need to remove plugin files manually.
core_plugin_manager | $pluginman | |
core\plugininfo\base | $pluginfo | |
progress_trace_buffer | $progress |
string |
core_admin_renderer::plugin_uninstall_results_removable_page | ( | core_plugin_manager | $pluginman, |
core\plugininfo\base | $pluginfo, | ||
progress_trace_buffer | $progress, | ||
moodle_url | $continueurl | ||
) |
Display a page with results of plugin uninstallation and offer removal of plugin files.
core_plugin_manager | $pluginman | |
core\plugininfo\base | $pluginfo | |
progress_trace_buffer | $progress | |
moodle_url | $continueurl | URL to continue to remove the plugin folder |
string |
core_admin_renderer::plugins_check_table | ( | core_plugin_manager | $pluginman, |
$version, | |||
array | $options = array() |
||
) |
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
core_plugin_manager | $pluginman | provides information about the plugins. |
int | $version | the version of the Moodle code from version.php. |
array | $options | rendering options |
string | HTML code |
core_admin_renderer::plugins_control_panel | ( | core_plugin_manager | $pluginman, |
array | $options = array() |
||
) |
Displays all known plugins and links to manage them.
This default implementation renders all plugins into one big table.
core_plugin_manager | $pluginman | provides information about the plugins. |
array | $options | filtering options |
string | HTML code |
core_admin_renderer::plugins_management_confirm_buttons | ( | moodle_url | $continue = null , |
moodle_url | $cancel = null |
||
) |
Display the continue / cancel widgets for the plugins management pages.
null | moodle_url | $continue | URL for the continue button, should it be displayed |
null | moodle_url | $cancel | URL for the cancel link, defaults to the current page |
string | HTML |
core_admin_renderer::plugins_overview_panel | ( | core_plugin_manager | $pluginman, |
array | $options = array() |
||
) |
Prints an overview about the plugins - number of installed, number of extensions etc.
core_plugin_manager | $pluginman | provides information about the plugins |
array | $options | filtering options |
string | as usually |
|
staticinherited |
Given an array or space-separated list of classes, prepares and returns the HTML class attribute value.
mixed | $classes | Space-separated string or array of classes |
string | HTML class attribute value |
|
protected |
Display a warning about not being registered on Moodle.org if necesary.
boolean | $registered | true if the site is registered on Moodle.org |
string | HTML to output. |
|
protected |
Display a link to the release notes.
string | HTML to output. |
|
inherited |
Renders the provided widget and returns the HTML to display it.
renderable | $widget | instance with renderable interface |
string |
Reimplemented from renderer_base.
Reimplemented in tool_policy\output\renderer.
|
inherited |
Renders a template by name with the given context.
The provided data needs to be array/stdClass made up of only simple types. Simple types are array,stdClass,bool,int,float,string
array | stdClass | $context | Context containing data for the template. |
string|boolean |
|
protected |
Formats the information that needs to go in the 'Requires' column.
core\plugininfo\base | $plugin | the plugin we are rendering the row for. |
core_plugin_manager | $pluginman | provides data on all the plugins. |
string | $version |
string | HTML code |
|
inherited |
Whether we should display the main logo.
int | $headinglevel | The heading level we want to check against. |
bool |
|
inherited |
Whether we should display the logo in the navbar.
We will when there are no main logos, and we have compact logo.
bool |
|
protected |
Render an appropriate message if themdesignermode is enabled.
bool | $themedesignermode | true if enabled |
string | HTML to output. |
core_admin_renderer::unsatisfied_dependencies_page | ( | $version, | |
array | $failed, | ||
moodle_url | $reloadurl | ||
) |
Displays the list of plugins with unsatisfied dependencies.
double | string | int | $version | Moodle on-disk version |
array | $failed | list of plugins with unsatisfied dependecies |
moodle_url | $reloadurl | URL of the page to recheck the dependencies |
string | HTML |
core_admin_renderer::upgrade_confirm_abort_install_page | ( | array | $abortable, |
moodle_url | $continue | ||
) |
Display a page to confirm plugin installation cancelation.
array | $abortable | list of core\update\plugininfo |
moodle_url | $continue |
string |
core_admin_renderer::upgrade_confirm_page | ( | $strnewversion, | |
$maturity, | |||
$testsite | |||
) |
Display the 'You are about to upgrade Moodle' page.
The first page during upgrade.
string | $strnewversion | |
int | $maturity | |
string | $testsite |
string | HTML to output. |
core_admin_renderer::upgrade_environment_page | ( | $release, | |
$envstatus, | |||
$environment_results | |||
) |
Display the environment page during the upgrade process.
string | $release | |
boolean | $envstatus | final result of env check (true/false) |
array | $environment_results | array of results gathered |
string | HTML to output. |
core_admin_renderer::upgrade_plugin_check_page | ( | core_plugin_manager | $pluginman, |
core\update\checker | $checker, | ||
$version, | |||
$showallplugins, | |||
$reloadurl, | |||
$continueurl | |||
) |
Display the upgrade page that lists all the plugins that require attention.
core_plugin_manager | $pluginman | provides information about the plugins. |
core\update\checker | $checker | provides information about available updates. |
int | $version | the version of the Moodle code from version.php. |
bool | $showallplugins | |
moodle_url | $reloadurl | |
moodle_url | $continueurl |
string | HTML to output. |
core_admin_renderer::upgrade_reload | ( | $url | ) |
Display the reload link that appears on several upgrade/install pages.
string | HTML to output. |
core_admin_renderer::upgrade_stale_php_files_page | ( | ) |
Display page explaining proper upgrade process, there can not be any PHP file leftovers...
string | HTML to output. |
core_admin_renderer::upgradekey_form_page | ( | $url | ) |
Render a simple page for providing the upgrade key.
moodle_url | string | $url |
string |
core_admin_renderer::warn_if_not_registered | ( | ) |
Return an admin page warning if site is not registered with moodle.org.
string |
|
protected |
Output a warning message, of the type that appears on the admin notifications page.
string | $message | the message to display. |
string | $type | type class |
string | HTML to output. |
|
protectedinherited |
A reference to the current renderer.
The renderer provided here will be determined by the page but will in 90% of cases by the core_renderer