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.

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

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: 956 lines (30 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.

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

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.

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

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

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

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

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

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.

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

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.