Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

Advanced role definition form.

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

Defines 1 class


Class: core_role_define_role_table_advanced  - X-Ref

As well as tracking the permissions information about the role we are creating
or editing, we also track the other information about the role. (This class is
starting to be more and more like a formslib form in some respects.)

__construct($context, $roleid)   X-Ref
No description

load_current_permissions()   X-Ref
No description

read_submitted_permissions()   X-Ref
No description

is_submission_valid()   X-Ref
No description

force_duplicate($roleid, array $options)   X-Ref
Call this after the table has been initialised,
this resets everything to that role.

param: int $roleid role id or 0 for no role
param: array $options array with following keys:

force_archetype($archetype, array $options)   X-Ref
Change the role definition to match given archetype.

param: string $archetype
param: array $options array with following keys:

force_preset($xml, array $options)   X-Ref
Change the role definition to match given preset.

param: string $xml
param: array $options array with following keys:

get_role_name()   X-Ref
No description

get_role_id()   X-Ref
No description

get_archetype()   X-Ref
No description

load_parent_permissions()   X-Ref
No description

save_changes()   X-Ref
No description

save_allow($type)   X-Ref
No description

get_name_field($id)   X-Ref
No description

get_shortname_field($id)   X-Ref
No description

get_description_field($id)   X-Ref
No description

get_archetype_field($id)   X-Ref
No description

get_assignable_levels_control()   X-Ref
No description

get_allow_roles_list($type, $roleid = null)   X-Ref
Returns an array of roles of the allowed type.

param: string $type Must be one of: assign, switch, or override.
param: int $roleid (null means current role)
return: array

get_allow_role_control($type)   X-Ref
Returns an array of roles with the allowed type.

param: string $type Must be one of: assign, switch, override or view.
return: array Am array of role names with the allowed type

get_role_risks_info()   X-Ref
Returns information about the risks associated with a role.

return: string

print_field($name, $caption, $field, $helpicon = null)   X-Ref
Print labels, fields and help icon on role administration page.

param: string $name The field name.
param: string $caption The field caption.
param: string $field The field type.
param: null|string $helpicon The help icon content.

print_show_hide_advanced_button()   X-Ref
No description

display()   X-Ref
No description

add_permission_cells($capability)   X-Ref
No description