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.

Class: helper  - X-Ref

Tour helper.

get_edit_step_link($tourid, $stepid = null, $targettype = null)   X-Ref
Get the link to edit the step.

If no stepid is specified, then a link to create a new step is provided. The $targettype must be specified in this case.

param: int     $tourid     The tour that the step belongs to.
param: int     $stepid     The step ID.
param: int     $targettype The type of step.
return: \moodle_url

get_move_tour_link($tourid, $direction = self::MOVE_DOWN)   X-Ref
Get the link to move the tour.

param: int     $tourid     The tour ID.
param: int     $direction  The direction to move in
return: \moodle_url

get_move_step_link($stepid, $direction = self::MOVE_DOWN)   X-Ref
Get the link to move the step.

param: int     $stepid     The step ID.
param: int     $direction  The direction to move in
return: \moodle_url

get_new_step_link($tourid, $targettype = null)   X-Ref
Get the link ot create a new step.

param: int         $tourid     The ID of the tour to attach this step to.
param: int         $targettype The type of target.
return: \moodle_url             The required URL.

get_view_tour_link($tourid)   X-Ref
Get the link used to view the tour.

param: int         $tourid     The ID of the tour to display.
return: \moodle_url             The URL.

get_reset_tour_for_all_link($tourid)   X-Ref
Get the link used to reset the tour state for all users.

param: int         $tourid     The ID of the tour to display.
return: \moodle_url             The URL.

get_edit_tour_link($tourid = null)   X-Ref
Get the link used to edit the tour.

param: int         $tourid     The ID of the tour to edit.
return: \moodle_url             The URL.

get_import_tour_link()   X-Ref
Get the link used to import the tour.

return: \moodle_url             The URL.

get_export_tour_link($tourid)   X-Ref
Get the link used to export the tour.

param: int         $tourid     The ID of the tour to export.
return: \moodle_url             The URL.

get_duplicate_tour_link($tourid)   X-Ref
Get the link used to duplicate the tour.

param: int         $tourid     The ID of the tour to duplicate.
return: \moodle_url             The URL.

get_delete_tour_link($tourid)   X-Ref
Get the link used to delete the tour.

param: int         $tourid     The ID of the tour to delete.
return: \moodle_url             The URL.

get_list_tour_link()   X-Ref
Get the link for listing tours.

return: \moodle_url             The URL.

format_icon_link($url, $icon, $alt, $iconcomponent = 'moodle', $options = array()   X-Ref
Get a filler icon for display in the actions column of a table.

param: string      $url            The URL for the icon.
param: string      $icon           The icon identifier.
param: string      $alt            The alt text for the icon.
param: string      $iconcomponent  The icon component.
param: array       $options        Display options.
return: string

get_filler_icon($options = array()   X-Ref
Get a filler icon for display in the actions column of a table.

param: array       $options        Display options.
return: string

get_delete_step_link($stepid)   X-Ref
Get the link for deleting steps.

param: int         $stepid     The ID of the step to display.
return: \moodle_url             The URL.

render_tourname_inplace_editable(tour $tour)   X-Ref
Render the inplace editable used to edit the tour name.

param: tour $tour The tour to edit.
return: inplace_editable

render_tourdescription_inplace_editable(tour $tour)   X-Ref
Render the inplace editable used to edit the tour description.

param: tour $tour The tour to edit.
return: inplace_editable

render_tourenabled_inplace_editable(tour $tour)   X-Ref
Render the inplace editable used to edit the tour enable state.

param: tour $tour The tour to edit.
return: inplace_editable

render_stepname_inplace_editable(step $step)   X-Ref
Render the inplace editable used to edit the step name.

param: step $step The step to edit.
return: inplace_editable

get_tours()   X-Ref
Get all of the tours.

return: stdClass[]

get_tour($tourid)   X-Ref
Get the specified tour.

param: int         $tourid     The tour that the step belongs to.
return: tour

get_tour_from_sortorder($sortorder)   X-Ref
Fetch the tour with the specified sortorder.

param: int         $sortorder  The sortorder of the tour.
return: tour

count_tours()   X-Ref
Return the count of all tours.

return: int

reset_tour_sortorder()   X-Ref
Reset the sortorder for all tours.


get_steps($tourid)   X-Ref
Get all of the steps in the tour.

param: int         $tourid     The tour that the step belongs to.
return: step[]

get_step($stepid)   X-Ref
Fetch the specified step.

param: int         $stepid     The id of the step to fetch.
return: step

get_step_from_sortorder($tourid, $sortorder)   X-Ref
Fetch the step with the specified sortorder.

param: int         $tourid     The tour that the step belongs to.
param: int         $sortorder  The sortorder of the step.
return: step

bootstrap()   X-Ref
Handle addition of the tour into the current page.


get_all_filters()   X-Ref
Get a list of all possible filters.

return: array

get_all_clientside_filters()   X-Ref
Get a list of all clientside filters.

return: array

get_string_from_input(string $content)   X-Ref
Attempt to fetch any matching langstring if the content is in the
format identifier,component.

param: string $content Step's content or Tour's name or Tour's description
return: string Processed content, any langstring will be converted to translated text

is_language_string_from_input(string $string)   X-Ref
Check if the given string contains any matching langstring.

param: string $string
return: bool