Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
tool_usertours\manager Class Reference

Public Member Functions

 execute ($action)
 This is the entry point for this controller class.
 

Static Public Member Functions

static get_current_tours ($reset=false)
 Get all tours for the current page URL.
 
static get_matching_tours (\moodle_url $pageurl)
 Get all tours matching the specified URL.
 
static import_tour_from_json ($json)
 Import the provided tour JSON.
 
static update_shipped_tours ()
 Make sure all of the default tours that are shipped with Moodle are created and up to date with the latest version.
 

Public Attributes

ACTION_DELETESTEP const ACTION_DELETESTEP = 'deletestep'
 The action to delete a step.
 
ACTION_DELETETOUR const ACTION_DELETETOUR = 'deletetour'
 The action to delete the tour.
 
ACTION_DUPLICATETOUR const ACTION_DUPLICATETOUR = 'duplicatetour'
 The action to duplicate the tour.
 
ACTION_EDITSTEP const ACTION_EDITSTEP = 'editstep'
 The action to edit step configuration.
 
ACTION_EDITTOUR const ACTION_EDITTOUR = 'edittour'
 The action to edit the tour.
 
ACTION_EXPORTTOUR const ACTION_EXPORTTOUR = 'exporttour'
 The action to export the tour.
 
ACTION_HIDETOUR const ACTION_HIDETOUR = 'hidetour'
 The action to hide a tour.
 
ACTION_IMPORTTOUR const ACTION_IMPORTTOUR = 'importtour'
 The action to import the tour.
 
ACTION_LISTTOURS const ACTION_LISTTOURS = 'listtours'
 The action to get the list of tours.
 
ACTION_MOVESTEP const ACTION_MOVESTEP = 'movestep'
 The action to move a step up or down.
 
ACTION_MOVETOUR const ACTION_MOVETOUR = 'movetour'
 The action to move a tour up or down.
 
ACTION_NEWSTEP const ACTION_NEWSTEP = 'newstep'
 The action to create a new step.
 
ACTION_NEWTOUR const ACTION_NEWTOUR = 'newtour'
 The action to create a new tour.
 
ACTION_RESETFORALL const ACTION_RESETFORALL = 'resetforall'
 
ACTION_SHOWTOUR const ACTION_SHOWTOUR = 'showtour'
 The action to show a tour.
 
ACTION_VIEWSTEP const ACTION_VIEWSTEP = 'viewstep'
 The action to view a step.
 
ACTION_VIEWTOUR const ACTION_VIEWTOUR = 'viewtour'
 The action to view the tour.
 
CONFIG_SHIPPED_FILENAME const CONFIG_SHIPPED_FILENAME = 'shipped_filename'
 
CONFIG_SHIPPED_TOUR const CONFIG_SHIPPED_TOUR = 'shipped_tour'
 
CONFIG_SHIPPED_VERSION const CONFIG_SHIPPED_VERSION = 'shipped_version'
 

Protected Member Functions

 delete_step ($stepid)
 Delete the step.
 
 delete_tour ($tourid)
 Delete the tour.
 
 duplicate_tour ($tourid)
 Duplicate an existing tour.
 
 edit_step ($id)
 Display the edit step form for the specified step.
 
 edit_tour ($id=null)
 Print the edit tour page.
 
 export_tour ($id)
 Print the export tour page.
 
 footer ()
 Print out the page footer.
 
 get_edit_tour_link ($id=null)
 Return the edit tour link.
 
 get_import_tour_link ()
 Get the import tour link.
 
 get_renderer ()
 Helper to fetch the renderer.
 
 header ($title=null)
 Print out the page header.
 
 hide_tour ($tourid)
 Hide the tour.
 
 import_tour ()
 Handle tour import.
 
 move_step ($id)
 Move a step up or down.
 
 move_tour ($id)
 Move a tour up or down and redirect once complete.
 
 print_edit_step_link ($tourid, $stepid=null)
 Print the edit step link.
 
 print_edit_tour_link ($id=null)
 Print the edit tour link.
 
 print_tour_list ()
 Print the the list of tours.
 
 reset_tour_for_all ($tourid)
 Reset the tour state for all users.
 
 setup_admin_externalpage (string $action)
 Helper method to initialize admin page, setting appropriate extra URL parameters.
 
 show_hide_tour ($tourid, $visibility)
 Show or Hide the tour.
 
 show_tour ($tourid)
 Show the tour.
 
 view_tour ($tourid)
 Print the view tour page.
 

Static Protected Member Functions

static _move_tour (tour $tour, $direction)
 Move a tour up or down.
 

Member Function Documentation

◆ _move_tour()

static tool_usertours\manager::_move_tour ( tour $tour,
$direction )
staticprotected

Move a tour up or down.

Parameters
tour$tourThe tour to move.
int$direction

◆ delete_step()

tool_usertours\manager::delete_step ( $stepid)
protected

Delete the step.

Parameters
int$stepidThe ID of the step to remove.

◆ delete_tour()

tool_usertours\manager::delete_tour ( $tourid)
protected

Delete the tour.

Parameters
int$touridThe ID of the tour to remove.

◆ duplicate_tour()

tool_usertours\manager::duplicate_tour ( $tourid)
protected

Duplicate an existing tour.

Parameters
int$touridThe ID of the tour to duplicate.

◆ edit_step()

tool_usertours\manager::edit_step ( $id)
protected

Display the edit step form for the specified step.

Parameters
int$idThe step to edit.

◆ edit_tour()

tool_usertours\manager::edit_tour ( $id = null)
protected

Print the edit tour page.

Parameters
int$idThe ID of the tour

◆ execute()

tool_usertours\manager::execute ( $action)

This is the entry point for this controller class.

Parameters
string$actionThe action to perform.

◆ export_tour()

tool_usertours\manager::export_tour ( $id)
protected

Print the export tour page.

Parameters
int$idThe ID of the tour

◆ footer()

tool_usertours\manager::footer ( )
protected

Print out the page footer.

Return values
void

◆ get_current_tours()

static tool_usertours\manager::get_current_tours ( $reset = false)
static

Get all tours for the current page URL.

Parameters
bool$resetForcibly update the current tours
Return values
array

◆ get_edit_tour_link()

tool_usertours\manager::get_edit_tour_link ( $id = null)
protected

Return the edit tour link.

Parameters
int$idThe ID of the tour
Return values
string

◆ get_import_tour_link()

tool_usertours\manager::get_import_tour_link ( )
protected

Get the import tour link.

Return values
string

◆ get_matching_tours()

static tool_usertours\manager::get_matching_tours ( \moodle_url $pageurl)
static

Get all tours matching the specified URL.

Parameters
moodle_url$pageurlThe URL to match.
Return values
array

◆ get_renderer()

tool_usertours\manager::get_renderer ( )
protected

Helper to fetch the renderer.

Return values
renderer

◆ header()

tool_usertours\manager::header ( $title = null)
protected

Print out the page header.

Parameters
string$titleThe title to display.

◆ hide_tour()

tool_usertours\manager::hide_tour ( $tourid)
protected

Hide the tour.

Parameters
int$touridThe ID of the tour to display.

◆ import_tour_from_json()

static tool_usertours\manager::import_tour_from_json ( $json)
static

Import the provided tour JSON.

Parameters
string$jsonThe tour configuration.
Return values
tour

◆ move_step()

tool_usertours\manager::move_step ( $id)
protected

Move a step up or down.

Parameters
int$idThe step to move.

◆ move_tour()

tool_usertours\manager::move_tour ( $id)
protected

Move a tour up or down and redirect once complete.

Parameters
int$idThe tour to move.

◆ print_edit_step_link()

tool_usertours\manager::print_edit_step_link ( $tourid,
$stepid = null )
protected

Print the edit step link.

Parameters
int$touridThe ID of the tour.
int$stepidThe ID of the step.
Return values
string

◆ print_edit_tour_link()

tool_usertours\manager::print_edit_tour_link ( $id = null)
protected

Print the edit tour link.

Parameters
int$idThe ID of the tour

◆ reset_tour_for_all()

tool_usertours\manager::reset_tour_for_all ( $tourid)
protected

Reset the tour state for all users.

Parameters
int$touridThe ID of the tour to remove.

◆ setup_admin_externalpage()

tool_usertours\manager::setup_admin_externalpage ( string $action)
protected

Helper method to initialize admin page, setting appropriate extra URL parameters.

Parameters
string$action

◆ show_hide_tour()

tool_usertours\manager::show_hide_tour ( $tourid,
$visibility )
protected

Show or Hide the tour.

Parameters
int$touridThe ID of the tour to display.
int$visibilityThe intended visibility.

◆ show_tour()

tool_usertours\manager::show_tour ( $tourid)
protected

Show the tour.

Parameters
int$touridThe ID of the tour to display.

◆ view_tour()

tool_usertours\manager::view_tour ( $tourid)
protected

Print the view tour page.

Parameters
int$touridThe ID of the tour to display.

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