Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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.

return: string
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.

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

return: string
param: array       $options        Display options.

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

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

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

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

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

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

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

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

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

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

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

return: stdClass[]

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

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

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

return: tour
param: int         $sortorder  The sortorder of the 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.

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

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

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

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

return: step
param: int         $tourid     The tour that the step belongs to.
param: int         $sortorder  The sortorder of the 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.

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

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

return: bool
param: string $string