Represents a page for showing all the policy documents which a user has to agree to.  
 More...
|  | 
|  | __construct (array $listdocs, array $agreedocs=[], array $declinedocs=[], $behalfid=0, $action=null) | 
|  | Prepare the page for rendering. 
 | 
|  | 
|  | export_for_template (renderer_base $output) | 
|  | Export the page data for the mustache template. 
 | 
|  | 
|  | 
| string | $action = null | 
|  | $action Form action to identify when user agreeds policies. 
 | 
|  | 
| array | $agreedocs = null | 
|  | $agreedocs List of policy identifiers which the user has agreed using the form. 
 | 
|  | 
| int | $behalfid = null | 
|  | User id who wants to accept this page. 
 | 
|  | 
| object | $behalfuser = null | 
|  | User who wants to accept this page. 
 | 
|  | 
| array | $declinedocs = null | 
|  | $declinedocs List of policy identifiers that the user declined. 
 | 
|  | 
| bool | $isexistinguser | 
|  | This is an existing user (rather than non-loggedin/guest). 
 | 
|  | 
| array | $listdocs = null | 
|  | List of policy version ids that were displayed to the user to agree with. 
 | 
|  | 
| array | $messages = [] | 
|  | Info or error messages to show. 
 | 
|  | 
| array | $policies = null | 
|  | $policies List of public policies objects with information about the user acceptance. 
 | 
|  | 
| boolean | $signupuserpolicyagreed = false | 
|  | True if signup user has agreed to all the policies; false otherwise. 
 | 
|  | 
Represents a page for showing all the policy documents which a user has to agree to. 
- Copyright
- 2018 Sara Arjona sara@.nosp@m.mood.nosp@m.le.co.nosp@m.m 
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ __construct()
      
        
          | tool_policy\output\page_agreedocs::__construct | ( | array | $listdocs, | 
        
          |  |  | array | $agreedocs = [], | 
        
          |  |  | array | $declinedocs = [], | 
        
          |  |  |  | $behalfid = 0, | 
        
          |  |  |  | $action = null ) | 
      
 
Prepare the page for rendering. 
- Parameters
- 
  
    | array | $listdocs | List of policy version ids that were displayed to the user to agree with. |  | array | $agreedocs | List of policy version ids that the user actually agreed with. |  | array | $declinedocs | List of policy version ids that the user declined. |  | int | $behalfid | The userid to accept the policy versions as (such as child's id). |  | string | $action | Form action to identify when user agreeds policies. |  
 
 
 
◆ accept_and_revoke_policies()
  
  | 
        
          | tool_policy\output\page_agreedocs::accept_and_revoke_policies | ( |  | ) |  |  | protected | 
 
Accept and revoke the policy versions. 
The capabilities for accepting/revoking policies are checked into the api functions. 
 
 
◆ export_for_template()
      
        
          | tool_policy\output\page_agreedocs::export_for_template | ( | renderer_base | $output | ) |  | 
      
 
Export the page data for the mustache template. 
- Parameters
- 
  
    | renderer_base | $output | renderer to be used to render the page elements. |  
 
- Return values
- 
  
  
Implements templatable.
 
 
◆ prepare_global_page_access()
  
  | 
        
          | tool_policy\output\page_agreedocs::prepare_global_page_access | ( |  | $userid | ) |  |  | protected | 
 
Sets up the global $PAGE and performs the access checks. 
- Parameters
- 
  
  
 
 
◆ prepare_user_acceptances()
  
  | 
        
          | tool_policy\output\page_agreedocs::prepare_user_acceptances | ( |  | $userid | ) |  |  | protected | 
 
Prepare user acceptances. 
- Parameters
- 
  
  
 
 
◆ redirect_to_policies()
  
  | 
        
          | tool_policy\output\page_agreedocs::redirect_to_policies | ( |  | $userid, |  
          |  |  |  | $returnurl = null ) |  | protected | 
 
Before display the consent page, the user has to view all the still-non-accepted policy docs. 
This function checks if the non-accepted policy docs have been shown and redirect to them.
- Parameters
- 
  
    | int | $userid | User identifier who wants to access to the consent page. |  | moodle_url | $returnurl | URL to return after shown the policy docs. |  
 
 
 
The documentation for this class was generated from the following file: