Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
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.
 
 export_for_template (renderer_base $output)
 Export the page data for the mustache template.
 

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.
 

Protected Attributes

int $behalfid = null
 User id who wants to view this page.
 
bool $manage
 View the policy as a part of the management UI.
 
int $numpolicy = 0
 Position of the current policy with respect to the total of policy docs to display.
 
stdClass $policy
 Exported tool_policy::policy_version_exporter to display on this page.
 
string $returnurl = null
 Return URL.
 
int $totalpolicies = 0
 Total number of policy documents which the user has to agree to.
 

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: