Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

Output rendering for the plugin.

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

Defines 1 class

tool_task_renderer:: (7 methods):
  scheduled_tasks_table()
  component_name()
  last_run_time()
  next_run_time()
  time_cell()
  cron_disabled()
  link_back()


Class: tool_task_renderer  - X-Ref

Implements the plugin renderer

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