// the main area with the checkboxes or images foreach ($tool_rights as $tool => $rights) { echo "\t<tr>\n"; echo "\t\t<td>\n"; echo get_lang($tool); echo "\t\t</td>\n"; foreach ($header_array as $key => $value) { echo "\t\t<td align='center'>\n"; if (in_array($value, $rights)) { if ($setting_visualisation == 'checkbox') { //display_checkbox_matrix($current_group_permissions, $tool, $value); display_checkbox_matrix($current_group_permissions, $tool, $value, $inherited_permissions, $course_admin); } if ($setting_visualisation == 'image') { //display_image_matrix($current_group_permissions, $tool, $value); display_image_matrix($current_group_permissions, $tool, $value, $inherited_permissions, $course_admin); } } // note: in a later stage this part will be replaced by a function // so that we can easily switch between a checkbox approach or an image approach // where every click is in fact a change of status. In the checkbox approach you first have to // do the changes and then store them by clicking the submit button. echo "\t\t</td>\n"; } echo "\t</tr>\n"; } echo "</table>\n"; if ($setting_visualisation == 'checkbox') { echo "<input type=\"Submit\" name=\"StoreGroupPermissions\" value=\"" . get_lang('StorePermissions') . "\">"; } echo "</form>";
foreach ($tool_rights as $tool => $rights) { echo "\t<tr>\n"; echo "\t\t<td>\n"; echo get_lang($tool); echo "\t\t</td>\n"; foreach ($header_array as $key => $value) { echo "\t\t<td align='center'>\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</td>\n"; } echo "\t</tr>\n"; } echo "</table>\n"; if ($setting_visualisation == 'checkbox') { echo "<input type=\"Submit\" name=\"StoreRolePermissions\" value=\"" . get_lang('StorePermissions') . "\">"; } echo "</form>"; } Display::display_footer();