Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
tool_policy\privacy\local\sitepolicy\handler Class Reference

Class implementation for a site policy handler. More...

Inheritance diagram for tool_policy\privacy\local\sitepolicy\handler:
core_privacy\local\sitepolicy\handler

Static Public Member Functions

static accept ()
 Accept site policy for the current user.
 
static get_embed_url ($forguests=false)
 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)
 
static get_redirect_url ($forguests=false)
 Returns URL to redirect user to when user needs to agree to site policy.
 
static is_defined ($forguests=false)
 Checks if the site has site policy defined.
 
static signup_form ($mform)
 Adds "Agree to site policy" checkbox to the signup form.
 

Detailed Description

Class implementation for a site policy handler.

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

Member Function Documentation

◆ accept()

static tool_policy\privacy\local\sitepolicy\handler::accept ( )
static

Accept site policy for the current user.

Return values
bool- false if sitepolicy not defined, user is not logged in or user has already agreed to site policy; true - if we have successfully marked the user as agreed to the site policy

Reimplemented from core_privacy\local\sitepolicy\handler.

◆ get_embed_url()

static tool_policy\privacy\local\sitepolicy\handler::get_embed_url ( $forguests = false)
static

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 self::accept() on completion.

Parameters
bool$forguests
Return values
moodle_url|null

Reimplemented from core_privacy\local\sitepolicy\handler.

◆ get_redirect_url()

static tool_policy\privacy\local\sitepolicy\handler::get_redirect_url ( $forguests = false)
static

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.

Parameters
bool$forguests
Return values
moodle_url|null(returns null if site policy is not defined)

Reimplemented from core_privacy\local\sitepolicy\handler.

◆ is_defined()

static core_privacy\local\sitepolicy\handler::is_defined ( $forguests = false)
staticinherited

Checks if the site has site policy defined.

Parameters
bool$forguests
Return values
bool

Reimplemented in core_privacy\local\sitepolicy\default_handler.

◆ signup_form()

static tool_policy\privacy\local\sitepolicy\handler::signup_form ( $mform)
static

Adds "Agree to site policy" checkbox to the signup form.

Parameters
MoodleQuickForm$mform

Reimplemented from core_privacy\local\sitepolicy\handler.


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