Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

Provides {@link tool_policy\form\accept_policy} class.

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

Defines 1 class

accept_policy:: (4 methods):
  definition()
  validate_and_get_users()
  validate_and_get_versions()
  process()


Class: accept_policy  - X-Ref

Represents the form for accepting or revoking a policy.

definition()   X-Ref
Defines the form fields.


validate_and_get_users($versionids, $userids, $action)   X-Ref
Validate userids and return usernames

param: array $versionids int[] List of policy version ids to process.
param: array $userids
param: string $action accept|decline|revoke
return: array (userid=>username)

validate_and_get_versions($versionids)   X-Ref
Validate versionids and return their names

param: array $versionids
return: array (versionid=>name)

process()   X-Ref
Process form submission