Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

Output rendering for the plugin.

Copyright: 2014 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 565 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: tool_task_renderer  - X-Ref

Implements the plugin renderer

adhoc_tasks_summary_table(array $summary)   X-Ref
This function will render a table with the summary of all adhoc tasks.

param: array $summary
return: string HTML to output.

adhoc_tasks_class_table(string $classname, array $tasks, ?array $params = [])   X-Ref
This function will render a table with all the adhoc tasks for the class.

param: string $classname
param: array $tasks - list of all adhoc tasks.
param: array|null $params
return: string HTML to output.

adhoc_tasks_simple_table(array $tasks)   X-Ref
This function will render a plain adhoc tasks table.

param: array $tasks - list of adhoc tasks.
return: string HTML to output.

generate_adhoc_tasks_simple_table(array $tasks, bool $wantruntasks = false)   X-Ref
This function will render a plain adhoc tasks table.

param: array $tasks - list of adhoc tasks.
param: bool $wantruntasks add 'Run now' link
return: html_table

adhoc_task_run()   X-Ref
Displays a notification on ad hoc task run request.

return: string HTML notification block for task initiated message

scheduled_tasks_table($tasks, $lastchanged = '')   X-Ref
This function will render one beautiful table with all the scheduled tasks.

param: \core\task\scheduled_task[] $tasks - list of all scheduled tasks.
param: string $lastchanged (optional) the last task edited. Gets highlighted in teh table.
return: string HTML to output.

component_name(string $component)   X-Ref
Nicely display the name of a component, with its disabled status and internal name.

param: string $component component name, e.g. 'core' or 'mod_forum'.
return: string HTML.

last_run_time(scheduled_task $task)   X-Ref
Standard display of a tasks last run time.

param: scheduled_task $task
return: string HTML.

next_run_time(scheduled_task $task)   X-Ref
Standard display of a tasks next run time.

param: scheduled_task $task
return: string HTML.

time_cell(string $current, string $default)   X-Ref
Get a table cell to show one time, comparing it to the default.

param: string $current the current setting.
param: string $default the default setting from the db/tasks.php file.
return: html_table_cell for use in the table.

cron_disabled()   X-Ref
Displays a warning on the page if cron is disabled.

return: string HTML code for information about cron being disabled

link_back($taskclassname = '')   X-Ref
Renders a link back to the scheduled tasks page (used from the 'run now' screen).

param: string $taskclassname if specified, the list of tasks will scroll to show this task.
return: string HTML code