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 401] [Versions 310 and 402] [Versions 310 and 403]

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