Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Tour manager.

Copyright: 2016 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 957 lines (29 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: manager  - X-Ref

Tour manager.

setup_admin_externalpage(string $action)   X-Ref
Helper method to initialize admin page, setting appropriate extra URL parameters

param: string $action

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

param: string  $action     The action to perform.

header($title = null)   X-Ref
Print out the page header.

param: string  $title     The title to display.

footer()   X-Ref
Print out the page footer.

return: void

print_tour_list()   X-Ref
Print the the list of tours.


get_edit_tour_link($id = null)   X-Ref
Return the edit tour link.

param: int         $id     The ID of the tour
return: string

print_edit_tour_link($id = null)   X-Ref
Print the edit tour link.

param: int         $id     The ID of the tour

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

return: string

edit_tour($id = null)   X-Ref
Print the edit tour page.

param: int         $id     The ID of the tour

export_tour($id)   X-Ref
Print the export tour page.

param: int         $id     The ID of the tour

import_tour()   X-Ref
Handle tour import.


view_tour($tourid)   X-Ref
Print the view tour page.

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

duplicate_tour($tourid)   X-Ref
Duplicate an existing tour.

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

show_tour($tourid)   X-Ref
Show the tour.

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

hide_tour($tourid)   X-Ref
Hide the tour.

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

show_hide_tour($tourid, $visibility)   X-Ref
Show or Hide the tour.

param: int         $tourid     The ID of the tour to display.
param: int         $visibility The intended visibility.

delete_tour($tourid)   X-Ref
Delete the tour.

param: int         $tourid     The ID of the tour to remove.

reset_tour_for_all($tourid)   X-Ref
Reset the tour state for all users.

param: int         $tourid     The ID of the tour to remove.

get_current_tours($reset = false)   X-Ref
Get all tours for the current page URL.

param: bool        $reset      Forcibly update the current tours
return: array

get_matching_tours(\moodle_url $pageurl)   X-Ref
Get all tours matching the specified URL.

param: moodle_url  $pageurl        The URL to match.
return: array

import_tour_from_json($json)   X-Ref
Import the provided tour JSON.

param: string      $json           The tour configuration.
return: tour

get_renderer()   X-Ref
Helper to fetch the renderer.

return: renderer

print_edit_step_link($tourid, $stepid = null)   X-Ref
Print the edit step link.

param: int     $tourid     The ID of the tour.
param: int     $stepid     The ID of the step.
return: string

edit_step($id)   X-Ref
Display the edit step form for the specified step.

param: int     $id     The step to edit.

move_tour($id)   X-Ref
Move a tour up or down and redirect once complete.

param: int     $id     The tour to move.

_move_tour(tour $tour, $direction)   X-Ref
Move a tour up or down.

param: tour    $tour   The tour to move.
param: int     $direction

move_step($id)   X-Ref
Move a step up or down.

param: int     $id     The step to move.

delete_step($stepid)   X-Ref
Delete the step.

param: int         $stepid     The ID of the step to remove.

update_shipped_tours()   X-Ref
Make sure all of the default tours that are shipped with Moodle are created
and up to date with the latest version.