|
| __construct ($context, $roleid) |
|
| add_classes ($classnames) |
| Use this to add class="" attributes to the table.
|
|
| display () |
| Display the table.
|
|
| force_archetype ($archetype, array $options) |
| Change the role definition to match given archetype.
|
|
| force_duplicate ($roleid, array $options) |
| Call this after the table has been initialised, this resets everything to that role.
|
|
| force_preset ($xml, array $options) |
| Change the role definition to match given preset.
|
|
| get_archetype () |
|
| get_risk_icon ($type) |
| Print a risk icon, as a link to the Risks page on Moodle Docs.
|
|
| get_role_id () |
|
| get_role_name () |
|
| is_submission_valid () |
|
| read_submitted_permissions () |
| Update $this->permissions based on submitted data, while making a list of changed capabilities in $this->changed.
|
|
| save_changes () |
| Save the new values of any permissions that have been changed.
|
|
|
const | NUM_CAPS_FOR_SEARCH = 12 |
| Default number of capabilities in the table for the search UI to be shown.
|
|
|
| $allcontextlevels |
|
| $allowassign |
|
| $allowoverride |
|
| $allowswitch |
|
| $allowview |
|
| $allpermissions |
|
| $allrisks |
|
| $capabilities = array() |
| The capabilities to display.
|
|
| $changed |
|
| $classes = array('rolecap table-hover') |
| Added to the class="" attribute on output.
|
|
| $context |
| The context this table relates to.
|
|
| $contextlevels |
|
| $disabled = '' |
|
| $displaypermissions |
|
array | $errors |
| Used to store errors found when validating the data.
|
|
| $id |
| Added as an id="" attribute to the table on output.
|
|
array | $parentpermissions |
| The capabilities to highlight as default/inherited.
|
|
| $permissions |
|
| $risksurl |
|
stdClass | $role |
| Used to store other information (besides permissions) about the role we are creating/editing.
|
|
| $roleid |
|
| $strperms |
|
◆ __construct()
core_role_view_role_definition_table::__construct |
( |
| $context, |
|
|
| $roleid ) |
◆ add_classes()
core_role_capability_table_base::add_classes |
( |
| $classnames | ) |
|
|
inherited |
Use this to add class="" attributes to the table.
You get the rolecap by default.
- Parameters
-
array | $classnames | of class names. |
◆ add_header_cells()
core_role_capability_table_with_risks::add_header_cells |
( |
| ) |
|
|
protectedinherited |
◆ add_permission_cells()
core_role_view_role_definition_table::add_permission_cells |
( |
| $capability | ) |
|
|
protected |
◆ add_row_cells()
core_role_capability_table_with_risks::add_row_cells |
( |
| $capability | ) |
|
|
protectedinherited |
For subclasses to override.
Output the data cells for this capability. The capability name cell will already have been output.
You can rely on get_row_classes always being called before add_row_cells.
- Parameters
-
stdClass | $capability | the capability this row relates to. |
- Return values
-
Reimplemented from core_role_capability_table_base.
◆ display()
core_role_define_role_table_advanced::display |
( |
| ) |
|
|
inherited |
◆ force_archetype()
core_role_define_role_table_advanced::force_archetype |
( |
| $archetype, |
|
|
array | $options ) |
|
inherited |
Change the role definition to match given archetype.
- Parameters
-
string | $archetype | |
array | $options | array with following keys: 'name', 'shortname', 'description', 'permissions', 'archetype', 'contextlevels', 'allowassign', 'allowoverride', 'allowswitch', 'allowview' |
◆ force_duplicate()
core_role_define_role_table_advanced::force_duplicate |
( |
| $roleid, |
|
|
array | $options ) |
|
inherited |
Call this after the table has been initialised, this resets everything to that role.
- Parameters
-
int | $roleid | role id or 0 for no role |
array | $options | array with following keys: 'name', 'shortname', 'description', 'permissions', 'archetype', 'contextlevels', 'allowassign', 'allowoverride', 'allowswitch', 'allowview' |
◆ force_preset()
core_role_define_role_table_advanced::force_preset |
( |
| $xml, |
|
|
array | $options ) |
|
inherited |
Change the role definition to match given preset.
- Parameters
-
string | $xml | |
array | $options | array with following keys: 'name', 'shortname', 'description', 'permissions', 'archetype', 'contextlevels', 'allowassign', 'allowoverride', 'allowswitch', 'allowview' |
◆ get_allow_role_control()
core_role_view_role_definition_table::get_allow_role_control |
( |
| $type | ) |
|
|
protected |
Returns an array of roles with the allowed type.
- Parameters
-
string | $type | Must be one of: assign, switch, override or view. |
- Return values
-
array | Am array of role names with the allowed type |
Reimplemented from core_role_define_role_table_advanced.
◆ get_allow_roles_list()
core_role_define_role_table_advanced::get_allow_roles_list |
( |
| $type, |
|
|
| $roleid = null ) |
|
protectedinherited |
Returns an array of roles of the allowed type.
- Parameters
-
string | $type | Must be one of: assign, switch, or override. |
int | $roleid | (null means current role) |
- Return values
-
◆ get_archetype_field()
core_role_view_role_definition_table::get_archetype_field |
( |
| $id | ) |
|
|
protected |
◆ get_description_field()
core_role_view_role_definition_table::get_description_field |
( |
| $id | ) |
|
|
protected |
◆ get_name_field()
core_role_view_role_definition_table::get_name_field |
( |
| $id | ) |
|
|
protected |
◆ get_risk_icon()
core_role_capability_table_with_risks::get_risk_icon |
( |
| $type | ) |
|
|
inherited |
Print a risk icon, as a link to the Risks page on Moodle Docs.
- Parameters
-
string | $type | the type of risk, will be one of the keys from the get_all_risks array. Must start with 'risk'. |
◆ get_role_risks_info()
core_role_view_role_definition_table::get_role_risks_info |
( |
| ) |
|
|
protected |
◆ get_row_attributes()
core_role_capability_table_base::get_row_attributes |
( |
| $capability | ) |
|
|
protectedinherited |
◆ get_row_classes()
core_role_capability_table_with_risks::get_row_classes |
( |
| $capability | ) |
|
|
protectedinherited |
For subclasses to override.
A change to reaturn class names that are added to the class="" attribute on the <tr> for this capability.
- Parameters
-
stdClass | $capability | the capability this row relates to. |
- Return values
-
array | of class name strings. |
Reimplemented from core_role_capability_table_base.
◆ get_shortname_field()
core_role_view_role_definition_table::get_shortname_field |
( |
| $id | ) |
|
|
protected |
◆ load_current_permissions()
core_role_define_role_table_advanced::load_current_permissions |
( |
| ) |
|
|
protectedinherited |
◆ load_parent_permissions()
core_role_define_role_table_advanced::load_parent_permissions |
( |
| ) |
|
|
protectedinherited |
◆ num_extra_columns()
core_role_capability_table_with_risks::num_extra_columns |
( |
| ) |
|
|
protectedinherited |
◆ print_field()
core_role_define_role_table_advanced::print_field |
( |
| $name, |
|
|
| $caption, |
|
|
| $field, |
|
|
| $helpicon = null ) |
|
protectedinherited |
Print labels, fields and help icon on role administration page.
- Parameters
-
string | $name | The field name. |
string | $caption | The field caption. |
string | $field | The field type. |
null | string | $helpicon | The help icon content. |
◆ print_heading_row()
core_role_capability_table_base::print_heading_row |
( |
| $capability | ) |
|
|
protectedinherited |
Used to output a heading rows when the context level or component changes.
- Parameters
-
stdClass | $capability | gives the new component and contextlevel. |
◆ print_show_hide_advanced_button()
core_role_view_role_definition_table::print_show_hide_advanced_button |
( |
| ) |
|
|
protected |
◆ read_submitted_permissions()
core_role_define_role_table_advanced::read_submitted_permissions |
( |
| ) |
|
|
inherited |
◆ save_changes()
core_role_view_role_definition_table::save_changes |
( |
| ) |
|
◆ skip_row()
core_role_view_role_definition_table::skip_row |
( |
| $capability | ) |
|
|
protected |
◆ $capabilities
core_role_capability_table_base::$capabilities = array() |
|
protectedinherited |
The capabilities to display.
Initialised as $context->get_capabilities().
The documentation for this class was generated from the following file: