Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

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

Copyright: 2018 Sara Arjona <sara@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 200 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

page_viewdoc:: (4 methods):
  __construct()
  prepare_policy()
  prepare_global_page_access()
  export_for_template()


Class: page_viewdoc  - X-Ref

Represents a page for showing the given policy document version.

__construct($policyid, $versionid, $returnurl, $behalfid, $manage, $numpolicy = 0, $totalpolicies = 0)   X-Ref
Prepare the page for rendering.

param: int $policyid The policy id for this page.
param: int $versionid The version id to show. Empty tries to load the current one.
param: string $returnurl URL of a page to continue after reading the policy text.
param: int $behalfid The userid to view this policy version as (such as child's id).
param: bool $manage View the policy as a part of the management UI.
param: int $numpolicy Position of the current policy with respect to the total of policy docs to display.
param: int $totalpolicies Total number of policy documents which the user has to agree to.

prepare_policy($policyid, $versionid)   X-Ref
Loads the policy version to display on the page.

param: int $policyid The policy id for this page.
param: int $versionid The version id to show. Empty tries to load the current one.

prepare_global_page_access()   X-Ref
Sets up the global $PAGE and performs the access checks.


export_for_template(renderer_base $output)   X-Ref
Export the page data for the mustache template.

param: renderer_base $output renderer to be used to render the page elements.
return: stdClass