Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
tool_usertours\helper Class Reference

Static Public Member Functions

static bootstrap ()
 Handle addition of the tour into the current page.
 
static count_tours ()
 Return the count of all tours.
 
static format_icon_link ($url, $icon, $alt, $iconcomponent='moodle', $options=[])
 Get a filler icon for display in the actions column of a table.
 
static get_all_clientside_filters ()
 Get a list of all clientside filters.
 
static get_all_filters ()
 Get a list of all possible filters.
 
static get_clientside_filter_module_names (array $filters)
 Get the JS module names for the filters.
 
static get_delete_step_link ($stepid)
 Get the link for deleting steps.
 
static get_delete_tour_link ($tourid)
 Get the link used to delete the tour.
 
static get_duplicate_tour_link ($tourid)
 Get the link used to duplicate the tour.
 
static get_edit_step_link ($tourid, $stepid=null, $targettype=null)
 Get the link to edit the step.
 
static get_edit_tour_link ($tourid=null)
 Get the link used to edit the tour.
 
static get_export_tour_link ($tourid)
 Get the link used to export the tour.
 
static get_filler_icon ($options=[])
 Get a filler icon for display in the actions column of a table.
 
static get_import_tour_link ()
 Get the link used to import the tour.
 
static get_list_tour_link ()
 Get the link for listing tours.
 
static get_move_step_link ($stepid, $direction=self::MOVE_DOWN)
 Get the link to move the step.
 
static get_move_tour_link ($tourid, $direction=self::MOVE_DOWN)
 Get the link to move the tour.
 
static get_new_step_link ($tourid, $targettype=null)
 Get the link ot create a new step.
 
static get_reset_tour_for_all_link ($tourid)
 Get the link used to reset the tour state for all users.
 
static get_step ($stepid)
 Fetch the specified step.
 
static get_step_from_sortorder ($tourid, $sortorder)
 Fetch the step with the specified sortorder.
 
static get_steps ($tourid)
 Get all of the steps in the tour.
 
static get_string_from_input (string $content)
 Attempt to fetch any matching langstring if the content is in the format identifier,component.
 
static get_tour ($tourid)
 Get the specified tour.
 
static get_tour_from_sortorder ($sortorder)
 Fetch the tour with the specified sortorder.
 
static get_tours ()
 Get all of the tours.
 
static get_view_tour_link ($tourid)
 Get the link used to view the tour.
 
static is_language_string_from_input (string $string)
 Check if the given string contains any matching langstring.
 
static render_stepname_inplace_editable (step $step)
 Render the inplace editable used to edit the step name.
 
static render_tourdescription_inplace_editable (tour $tour)
 Render the inplace editable used to edit the tour description.
 
static render_tourenabled_inplace_editable (tour $tour)
 Render the inplace editable used to edit the tour enable state.
 
static render_tourname_inplace_editable (tour $tour)
 Render the inplace editable used to edit the tour name.
 
static reset_tour_sortorder ()
 Reset the sortorder for all tours.
 

Public Attributes

MOVE_DOWN const MOVE_DOWN = 1
 
MOVE_UP const MOVE_UP = -1
 

Protected Attributes

string const LANG_STRING_REGEX = '|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9::.:/_-]*)$|'
 Regex to check any matching lang string.
 

Member Function Documentation

◆ count_tours()

static tool_usertours\helper::count_tours ( )
static

Return the count of all tours.

Return values
int

◆ format_icon_link()

static tool_usertours\helper::format_icon_link ( $url,
$icon,
$alt,
$iconcomponent = 'moodle',
$options = [] )
static

Get a filler icon for display in the actions column of a table.

Parameters
string$urlThe URL for the icon.
string$iconThe icon identifier.
string$altThe alt text for the icon.
string$iconcomponentThe icon component.
array$optionsDisplay options.
Return values
string

◆ get_all_clientside_filters()

static tool_usertours\helper::get_all_clientside_filters ( )
static

Get a list of all clientside filters.

Return values
array

◆ get_all_filters()

static tool_usertours\helper::get_all_filters ( )
static

Get a list of all possible filters.

Return values
array

◆ get_clientside_filter_module_names()

static tool_usertours\helper::get_clientside_filter_module_names ( array $filters)
static

Get the JS module names for the filters.

Parameters
array$filters
Return values
array
Exceptions
coding_exception

◆ get_delete_step_link()

static tool_usertours\helper::get_delete_step_link ( $stepid)
static

Get the link for deleting steps.

Parameters
int$stepidThe ID of the step to display.
Return values
moodle_urlThe URL.

◆ get_delete_tour_link()

static tool_usertours\helper::get_delete_tour_link ( $tourid)
static

Get the link used to delete the tour.

Parameters
int$touridThe ID of the tour to delete.
Return values
moodle_urlThe URL.

◆ get_duplicate_tour_link()

static tool_usertours\helper::get_duplicate_tour_link ( $tourid)
static

Get the link used to duplicate the tour.

Parameters
int$touridThe ID of the tour to duplicate.
Return values
moodle_urlThe URL.

◆ get_edit_step_link()

static tool_usertours\helper::get_edit_step_link ( $tourid,
$stepid = null,
$targettype = null )
static

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.

Parameters
int$touridThe tour that the step belongs to.
int$stepidThe step ID.
int$targettypeThe type of step.
Return values
moodle_url

◆ get_edit_tour_link()

static tool_usertours\helper::get_edit_tour_link ( $tourid = null)
static

Get the link used to edit the tour.

Parameters
int$touridThe ID of the tour to edit.
Return values
moodle_urlThe URL.

◆ get_export_tour_link()

static tool_usertours\helper::get_export_tour_link ( $tourid)
static

Get the link used to export the tour.

Parameters
int$touridThe ID of the tour to export.
Return values
moodle_urlThe URL.

◆ get_filler_icon()

static tool_usertours\helper::get_filler_icon ( $options = [])
static

Get a filler icon for display in the actions column of a table.

Parameters
array$optionsDisplay options.
Return values
string

◆ get_import_tour_link()

static tool_usertours\helper::get_import_tour_link ( )
static

Get the link used to import the tour.

Return values
moodle_urlThe URL.

◆ get_list_tour_link()

static tool_usertours\helper::get_list_tour_link ( )
static

Get the link for listing tours.

Return values
moodle_urlThe URL.

◆ get_move_step_link()

static tool_usertours\helper::get_move_step_link ( $stepid,
$direction = self::MOVE_DOWN )
static

Get the link to move the step.

Parameters
int$stepidThe step ID.
int$directionThe direction to move in
Return values
moodle_url

◆ get_move_tour_link()

static tool_usertours\helper::get_move_tour_link ( $tourid,
$direction = self::MOVE_DOWN )
static

Get the link to move the tour.

Parameters
int$touridThe tour ID.
int$directionThe direction to move in
Return values
moodle_url

◆ get_new_step_link()

static tool_usertours\helper::get_new_step_link ( $tourid,
$targettype = null )
static

Get the link ot create a new step.

Parameters
int$touridThe ID of the tour to attach this step to.
int$targettypeThe type of target.
Return values
moodle_urlThe required URL.

◆ get_reset_tour_for_all_link()

static tool_usertours\helper::get_reset_tour_for_all_link ( $tourid)
static

Get the link used to reset the tour state for all users.

Parameters
int$touridThe ID of the tour to display.
Return values
moodle_urlThe URL.

◆ get_step()

static tool_usertours\helper::get_step ( $stepid)
static

Fetch the specified step.

Parameters
int$stepidThe id of the step to fetch.
Return values
step

◆ get_step_from_sortorder()

static tool_usertours\helper::get_step_from_sortorder ( $tourid,
$sortorder )
static

Fetch the step with the specified sortorder.

Parameters
int$touridThe tour that the step belongs to.
int$sortorderThe sortorder of the step.
Return values
step

◆ get_steps()

static tool_usertours\helper::get_steps ( $tourid)
static

Get all of the steps in the tour.

Parameters
int$touridThe tour that the step belongs to.
Return values
step[]

◆ get_string_from_input()

static tool_usertours\helper::get_string_from_input ( string $content)
static

Attempt to fetch any matching langstring if the content is in the format identifier,component.

Parameters
string$contentStep's content or Tour's name or Tour's description
Return values
stringProcessed content, any langstring will be converted to translated text

◆ get_tour()

static tool_usertours\helper::get_tour ( $tourid)
static

Get the specified tour.

Parameters
int$touridThe tour that the step belongs to.
Return values
tour

◆ get_tour_from_sortorder()

static tool_usertours\helper::get_tour_from_sortorder ( $sortorder)
static

Fetch the tour with the specified sortorder.

Parameters
int$sortorderThe sortorder of the tour.
Return values
tour

◆ get_tours()

static tool_usertours\helper::get_tours ( )
static

Get all of the tours.

Return values
stdClass[]

◆ get_view_tour_link()

static tool_usertours\helper::get_view_tour_link ( $tourid)
static

Get the link used to view the tour.

Parameters
int$touridThe ID of the tour to display.
Return values
moodle_urlThe URL.

◆ is_language_string_from_input()

static tool_usertours\helper::is_language_string_from_input ( string $string)
static

Check if the given string contains any matching langstring.

Parameters
string$string
Return values
bool

◆ render_stepname_inplace_editable()

static tool_usertours\helper::render_stepname_inplace_editable ( step $step)
static

Render the inplace editable used to edit the step name.

Parameters
step$stepThe step to edit.
Return values
inplace_editable

◆ render_tourdescription_inplace_editable()

static tool_usertours\helper::render_tourdescription_inplace_editable ( tour $tour)
static

Render the inplace editable used to edit the tour description.

Parameters
tour$tourThe tour to edit.
Return values
inplace_editable

◆ render_tourenabled_inplace_editable()

static tool_usertours\helper::render_tourenabled_inplace_editable ( tour $tour)
static

Render the inplace editable used to edit the tour enable state.

Parameters
tour$tourThe tour to edit.
Return values
inplace_editable

◆ render_tourname_inplace_editable()

static tool_usertours\helper::render_tourname_inplace_editable ( tour $tour)
static

Render the inplace editable used to edit the tour name.

Parameters
tour$tourThe tour to edit.
Return values
inplace_editable

The documentation for this class was generated from the following file: