Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 402] [Versions 310 and 403]

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: 191 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