Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.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