Moodle  2.2.1
http://www.collinsharper.com
define_role_table_advanced Class Reference
Inheritance diagram for define_role_table_advanced:
Collaboration diagram for define_role_table_advanced:

Public Member Functions

 __construct ($context, $roleid)
 read_submitted_permissions ()
 is_submission_valid ()
 make_copy ()
 get_role_name ()
 get_role_id ()
 get_archetype ()
 save_changes ()
 display ()

Protected Member Functions

 load_current_permissions ()
 load_parent_permissions ()
 get_name_field ($id)
 get_shortname_field ($id)
 get_description_field ($id)
 get_archetype_field ($id)
 get_assignable_levels_control ()
 print_field ($name, $caption, $field)
 print_show_hide_advanced_button ()
 add_permission_cells ($capability)

Protected Attributes

 $role
 $errors
 $contextlevels
 $allcontextlevels
 $disabled = ''

Detailed Description

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.)

Definition at line 543 of file lib.php.


Constructor & Destructor Documentation

__construct ( context,
id 
)

Constructor

Parameters:
object$contextthe context this table relates to.
string$idwhat to put in the id="" attribute.

Reimplemented from capability_table_base.

Reimplemented in view_role_definition_table, and define_role_table_basic.

Definition at line 552 of file lib.php.


Member Function Documentation

add_permission_cells ( capability) [protected]

One cell for each possible permission.

Reimplemented from capability_table_with_risks.

Reimplemented in view_role_definition_table, and define_role_table_basic.

Definition at line 795 of file lib.php.

display ( )

Display the table.

Loop over capabilities.

Prints a breaker if component or name or context level has changed

Start the row.

Table cell for the capability name.

Add the cells specific to this table.

End the row.

End of the table.

Reimplemented from capability_table_with_risks.

Definition at line 778 of file lib.php.

Here is the call graph for this function:

Definition at line 679 of file lib.php.

get_archetype_field ( id) [protected]

Reimplemented in view_role_definition_table.

Definition at line 718 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 727 of file lib.php.

Here is the caller graph for this function:

get_description_field ( id) [protected]

Reimplemented in view_role_definition_table.

Definition at line 714 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_name_field ( id) [protected]

Reimplemented in view_role_definition_table.

Definition at line 706 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 675 of file lib.php.

Definition at line 671 of file lib.php.

get_shortname_field ( id) [protected]

Reimplemented in view_role_definition_table.

Definition at line 710 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 656 of file lib.php.

load_current_permissions ( ) [protected]

Reimplemented from capability_table_with_risks.

Definition at line 568 of file lib.php.

Here is the call graph for this function:

load_parent_permissions ( ) [protected]

Reimplemented from capability_table_with_risks.

Definition at line 683 of file lib.php.

Here is the call graph for this function:

make_copy ( )

Call this after the table has been initialised, so to indicate that when save is called, we want to make a duplicate role.

Definition at line 664 of file lib.php.

print_field ( name,
caption,
field 
) [protected]

Definition at line 744 of file lib.php.

Here is the caller graph for this function:

Reimplemented in view_role_definition_table, and define_role_table_basic.

Definition at line 771 of file lib.php.

Here is the caller graph for this function:

Update $this->permissions based on submitted data, while making a list of changed capabilities in $this->changed.

The user is not allowed to change the permission for this capability

A permission was not specified in submitted data.

If the permission has changed, update $this->permissions and Record the fact there is data to save.

Reimplemented from capability_table_with_risks.

Definition at line 592 of file lib.php.

Here is the call graph for this function:

Save the new values of any permissions that have been changed.

Set the permissions.

Force accessinfo refresh for users visiting this context.

Reimplemented from capability_table_with_risks.

Reimplemented in view_role_definition_table.

Definition at line 687 of file lib.php.

Here is the call graph for this function:


Field Documentation

$allcontextlevels [protected]

Definition at line 549 of file lib.php.

$contextlevels [protected]

Definition at line 548 of file lib.php.

$disabled = '' [protected]

Definition at line 550 of file lib.php.

$errors [protected]

Used to store errors found when validating the data.

Definition at line 547 of file lib.php.

$role [protected]

Used to store other information (besides permissions) about the role we are creating/editing.

Definition at line 545 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations