Search moodle.org's
Developer Documentation

See Release Notes

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

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

Base class for allow matrices.

Copyright: 1999 onwards Martin Dougiamas (http://dougiamas.com)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 193 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_role_allow_role_page:: (6 methods):
  __construct()
  load_required_roles()
  process_submission()
  load_current_settings()
  is_allowed_target()
  get_table()


Class: core_role_allow_role_page  - X-Ref

Base class for managing the data in the grid of checkboxes on the role allow
allow/overrides/switch editing pages (allow.php).

__construct($tablename, $targetcolname)   X-Ref
Constructor.

param: string $tablename the table where our data is stored.
param: string $targetcolname the name of the target role id column.

load_required_roles()   X-Ref
Load information about all the roles we will need information about.


process_submission()   X-Ref
Update the data with the new settings submitted by the user.


load_current_settings()   X-Ref
Load the current allows from the database.


is_allowed_target($targetroleid)   X-Ref
Is target allowed?

param: integer $targetroleid a role id.
return: boolean whether the user should be allowed to select this role as a target role.

get_table()   X-Ref
Returns structure that can be passed to print_table,
containing one cell for each checkbox.

return: html_table a table