|
| setup_task_data () |
| Fetch the task record matching the current task, if there is one.
|
|
|
stored_progress_bar stored_progress_bar | $progressbar |
| $progressbar
|
|
string string | $runlabel = '' |
| $runlabel Label for the link to run the task.
|
|
url url | $runurl = null |
| $runurl The URL to manually run the task.
|
|
stdClass stdClass | $taskrecord |
| $taskrecord
|
|
◆ __construct()
core\output\task_indicator::__construct |
( |
protected adhoc_task adhoc_task | $task, |
|
|
protected string string | $heading, |
|
|
protected string string | $message, |
|
|
protected ?url ?url | $redirecturl = null, |
|
|
protected ?pix_icon ?pix_icon | $icon = new pix_icon('i/timer', ''), |
|
|
protected array array | $extraclasses = [] ) |
Find the task record, and get the progress bar object.
- Parameters
-
adhoc_task | $task | The task whose progress is being indicated. The task class must use stored_progress_task_trait. |
string | $heading | The header text for the indicator. |
string | $message | A message to explain what is happening while the task is running. |
?url | $redirecturl | An optional URL to redirect to when the task completes. |
?pix_icon | $icon | An optional icon to display with the heading. |
array | $extraclasses | Extra class names to apply to the indicator's container. |
- Exceptions
-
- Parameters
-
$task | $task The task whose progress is being indicated. The task class must use stored_progress_task_trait. |
$heading | $heading The header text for the indicator. |
$message | $message A message to explain what is happening while the task is running. |
$redirecturl | $redirecturl An optional URL to redirect to when the task completes. |
$icon | $icon An optional icon to display with the heading. |
$extraclasses | $extraclasses Extra class names to apply to the indicator's container. |
◆ export_for_template()
core\output\task_indicator::export_for_template |
( |
renderer_base | $output | ) |
|
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
- No complex types - only stdClass, array, int, string, float, bool
- Any additional info that is required for the template is pre-calculated (e.g. capability checks).
- Parameters
-
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
- Return values
-
Implements core\output\templatable.
◆ has_task_record()
core\output\task_indicator::has_task_record |
( |
| ) |
|
Check if there is a task record matching the defined task.
If so, set the task ID and progress bar, then return true. If not, return false.
- Return values
-
◆ setup_task_data()
core\output\task_indicator::setup_task_data |
( |
| ) |
|
|
protected |
Fetch the task record matching the current task, if there is one.
If one exists, also set up a progress bar, and set up the "run now" link if permitted.
- Return values
-
The documentation for this class was generated from the following file:
- lib/classes/output/task_indicator.php