Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
tool_usertours\manager Class Reference

Tour manager. More...

Public Member Functions

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

Static Public Member Functions

static get_current_tour ($reset=false)
 Get the first tour matching the current page URL. More...
 
static get_matching_tours (\moodle_url $pageurl)
 Get the first tour matching the specified URL. More...
 
static import_tour_from_json ($json)
 Import the provided tour JSON. More...
 
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. More...
 
 delete_tour ($tourid)
 Delete the tour. More...
 
 duplicate_tour ($tourid)
 Duplicate an existing tour. More...
 
 edit_step ($id)
 Display the edit step form for the specified step. More...
 
 edit_tour ($id=null)
 Print the edit tour page. More...
 
 export_tour ($id)
 Print the export tour page. More...
 
 footer ()
 Print out the page footer. More...
 
 get_edit_tour_link ($id=null)
 Return the edit tour link. More...
 
 get_import_tour_link ()
 Get the import tour link. More...
 
 get_renderer ()
 Helper to fetch the renderer. More...
 
 header ($title=null)
 Print out the page header. More...
 
 hide_tour ($tourid)
 Hide the tour. More...
 
 import_tour ()
 Handle tour import.
 
 move_step ($id)
 Move a step up or down. More...
 
 move_tour ($id)
 Move a tour up or down and redirect once complete. More...
 
 print_edit_step_link ($tourid, $stepid=null)
 Print the edit step link. More...
 
 print_edit_tour_link ($id=null)
 Print the edit tour link. More...
 
 print_tour_list ()
 Print the the list of tours.
 
 reset_tour_for_all ($tourid)
 Reset the tour state for all users. More...
 
 setup_admin_externalpage (string $action)
 Helper method to initialize admin page, setting appropriate extra URL parameters. More...
 
 show_hide_tour ($tourid, $visibility)
 Show or Hide the tour. More...
 
 show_tour ($tourid)
 Show the tour. More...
 
 view_tour ($tourid)
 Print the view tour page. More...
 

Static Protected Member Functions

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

Detailed Description

Tour manager.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

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_tour()

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

Get the first tour matching the current page URL.

Parameters
bool$resetForcibly update the current tour
Return values
tour

◆ 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 the first tour matching the specified URL.

Parameters
moodle_url$pageurlThe URL to match.
Return values
tour

◆ 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: