Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Default (core) handler for site policies.

Copyright: 2018 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 96 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

default_handler:: (3 methods):
  is_defined()
  get_redirect_url()
  get_embed_url()


Class: default_handler  - X-Ref

Default (core) handler for site policies.

is_defined($forguests = false)   X-Ref
Checks if the site has site policy defined

param: bool $forguests
return: bool

get_redirect_url($forguests = false)   X-Ref
Returns URL to redirect user to when user needs to agree to site policy

This is a regular interactive page for web users. It should have normal Moodle header/footers, it should
allow user to view policies and accept them.

param: bool $forguests
return: moodle_url|null (returns null if site policy is not defined)

get_embed_url($forguests = false)   X-Ref
Returns URL of the site policy that needs to be displayed to the user (inside iframe or to use in WS such as mobile app)

This page should not have any header/footer, it does not also have any buttons/checkboxes. The caller needs to implement
the "Accept" button and call {@link self::accept()} on completion.

param: bool $forguests
return: moodle_url|null