Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tool_policy\output\page_viewdoc Class Reference

Represents a page for showing the given policy document version. More...

Inheritance diagram for tool_policy\output\page_viewdoc:
renderable templatable

Public Member Functions

 __construct ($policyid, $versionid, $returnurl, $behalfid, $manage, $numpolicy=0, $totalpolicies=0)
 Prepare the page for rendering. More...
 
 export_for_template (renderer_base $output)
 Export the page data for the mustache template. More...
 

Protected Member Functions

 prepare_global_page_access ()
 Sets up the global $PAGE and performs the access checks.
 
 prepare_policy ($policyid, $versionid)
 Loads the policy version to display on the page. More...
 

Protected Attributes

int $behalfid = null
 User id who wants to view this page.
 
stdClass $policy
 Exported tool_policy\policy_version_exporter to display on this page.
 
string $returnurl = null
 Return URL.
 

Detailed Description

Represents a page for showing the given policy document version.

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

Constructor & Destructor Documentation

◆ __construct()

tool_policy\output\page_viewdoc::__construct (   $policyid,
  $versionid,
  $returnurl,
  $behalfid,
  $manage,
  $numpolicy = 0,
  $totalpolicies = 0 
)

Prepare the page for rendering.

Parameters
int$policyidThe policy id for this page.
int$versionidThe version id to show. Empty tries to load the current one.
string$returnurlURL of a page to continue after reading the policy text.
int$behalfidThe userid to view this policy version as (such as child's id).
bool$manageView the policy as a part of the management UI.
int$numpolicyPosition of the current policy with respect to the total of policy docs to display.
int$totalpoliciesTotal number of policy documents which the user has to agree to.

Member Function Documentation

◆ export_for_template()

tool_policy\output\page_viewdoc::export_for_template ( renderer_base  $output)

Export the page data for the mustache template.

Parameters
renderer_base$outputrenderer to be used to render the page elements.
Return values
stdClass

Implements templatable.

◆ prepare_policy()

tool_policy\output\page_viewdoc::prepare_policy (   $policyid,
  $versionid 
)
protected

Loads the policy version to display on the page.

Parameters
int$policyidThe policy id for this page.
int$versionidThe version id to show. Empty tries to load the current one.

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