'.get_lang('AddRole').''; if ($_GET['action'] == 'add') { echo "
"; echo "\n"; echo "\n\t"; echo "\n\t\t"; echo "\n\t\t"; echo "\n\t"; echo "\n\t"; echo "\n\t\t"; echo "\n\t\t"; echo "\n\t"; echo "\n\t"; echo "\n\t\t"; echo "\n\t\t"; echo "\n\t"; echo "\n
"; echo get_lang('RoleName'); echo "\n\t\t"; echo "\n\t\t\t"; echo "\n\t\t
"; echo get_lang('RoleComment'); echo "\n\t\t"; echo "\n\t\t\t"; echo "\n\t\t
"; echo get_lang('DefaultRole'); echo "\n\t\t"; echo "\n\t\t\t"; echo "\n\t\t
"; echo "\n"; // the header if (api_get_setting('permissions') == 'limited') { $header_array = $rights_limited; } if (api_get_setting('permissions') == 'full') { $header_array = $rights_full; } echo "\t\n"; echo "\t\t\n"; foreach ($header_array as $header_key => $header_value) { echo "\t\t\n"; } echo "\t\n"; // the main area with the checkboxes or images foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights { echo "\t\n"; echo "\t\t\n"; foreach ($header_array as $key => $value) { echo "\t\t\n"; } echo "\t\n"; } echo "
".get_lang('Module')."".get_lang($header_value)."
\n"; echo get_lang($tool); echo "\t\t\n"; display_checkbox_matrix(array(), $tool, $value); echo "\t\t
\n"; echo ""; echo "
"; } // DISPLAYING THE EXISTING ROLES // platform roles $all_roles = get_all_roles('platform'); foreach ($all_roles as $role) { echo '
'.$role['role_name'].'
'; echo '
'.$role['role_comment'].'

'; if ($role['role_id'] == $_GET['role_id']) { $current_role_info = $role; } } // course roles $all_roles = get_all_roles(); foreach ($all_roles as $role) { echo '
'.$role['role_name'].'
'; echo '
'.$role['role_comment'].'

'; if ($role['role_id'] == $_GET['role_id']) { $current_role_info = $role; } } // DISPLAYING THE PERMISSIONS OF A GIVEN ROLE if ($_GET['role_id']) { $current_role_permissions = get_permissions('role', $_GET['role_id']); // LIMITED OR FULL $current_role_permissions = limited_or_full($current_role_permissions); if (api_get_setting('permissions') == 'limited') { $header_array = $rights_limited; } if (api_get_setting('permissions') == 'full') { $header_array = $rights_full; } // --------------------------------------------------- // DISPLAYING THE MATRIX // --------------------------------------------------- echo "
"; // the list of the roles for the user echo get_lang('PermissionsOfRole').':'.$current_role_info['role_name'].'
'; if ($_GET['scope'] == 'platform') { echo get_lang('IsPlatformRoleNotEditable').'
'; } echo "\n"; // the header echo "\t\n"; echo "\t\t\n"; foreach ($header_array as $header_key => $header_value) { echo "\t\t\n"; } echo "\t\n"; // the main area with the checkboxes or images foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights { echo "\t\n"; echo "\t\t\n"; foreach ($header_array as $key => $value) { echo "\t\t\n"; } echo "\t\n"; } echo "
".get_lang('Module')."".get_lang($header_value)."
\n"; echo get_lang($tool); echo "\t\t\n"; if (in_array($value, $rights)) { if ($setting_visualisation == 'checkbox') { display_checkbox_matrix( $current_role_permissions, $tool, $value ); } if ($setting_visualisation == 'image') { if ($_GET['scope'] == 'platform') { $roles_editable = false; } else { $roles_editable = true; } display_image_matrix( $current_role_permissions, $tool, $value, '', '', $roles_editable ); } } echo "\t\t
\n"; if ($setting_visualisation == 'checkbox') { echo ""; } echo "
"; } Display::display_footer();