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.

Provides {@link tool_policy\output\user_agreement} class.

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

Defines 1 class

user_agreement:: (3 methods):
  __construct()
  export_for_template()
  export_for_download()


Class: user_agreement  - X-Ref

List of users and their acceptances

__construct($userid, array $accepted, array $declined, moodle_url $pageurl, $versions, $onbehalf = false,$canaccept = null, $canrevoke = null)   X-Ref
user_agreement constructor

param: int $userid
param: array $accepted list of ids of accepted versions
param: array $declined list of ids of declined versions
param: moodle_url $pageurl
param: array $versions list of versions (id=>name)
param: bool $onbehalf whether at least one version was accepted by somebody else on behalf of the user
param: bool $canaccept does the current user have permission to accept/decline the policy on behalf of user $userid
param: bool $canrevoke does the current user have permission to revoke the policy on behalf of user $userid

export_for_template(\renderer_base $output)   X-Ref
Export data to be rendered.

param: renderer_base $output
return: stdClass

export_for_download()   X-Ref
Describe the status with a plain text for downloading purposes.

return: string