From: toyomoyo Date: Tue, 8 Aug 2006 08:31:21 +0000 (+0000) Subject: some UI change for roles X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e9871557bee461edd5e632e2cfb86d0481cdabef;p=moodle.git some UI change for roles --- diff --git a/admin/index.php b/admin/index.php index ff563380eb..ca1d205112 100644 --- a/admin/index.php +++ b/admin/index.php @@ -458,6 +458,15 @@ $testingdata = ''; + $testingdata .= ''; + + $table->data[] = array(''.get_string('tests','admin').'', + $testingdata); + + $testingdata = ''; + $testingdata .= ''; @@ -537,4 +546,4 @@ epository').'', print_footer($site); -?> +?> \ No newline at end of file diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 0d82b8b349..5884d0d603 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -61,6 +61,7 @@ */ $straction = get_string('roleassignment'); $context = get_record('context', 'id', $contextid); + $currenttab = ''; $tabsmode = 'assign'; include_once('tabs.php'); diff --git a/admin/roles/manage.html b/admin/roles/manage.html index 8338c45046..ca1e0ca5eb 100755 --- a/admin/roles/manage.html +++ b/admin/roles/manage.html @@ -3,7 +3,10 @@
Role Name: -
Role Description: +
Role Description: + +htmleditor, 10, 50, 50, 10, 'description', "$role->description"); ?> +

@@ -57,4 +60,4 @@


- + \ No newline at end of file diff --git a/admin/roles/manage.php b/admin/roles/manage.php index 146052b2f8..8cc53666fe 100755 --- a/admin/roles/manage.php +++ b/admin/roles/manage.php @@ -24,10 +24,20 @@ $stradministration = get_string('administration'); $strmanageroles = get_string('manageroles'); + + if ($roleid && $action!='delete') { + $role = get_record('role', 'id', $roleid); + + $edittingstr = '-> '.get_string('editting', $role->name); + } else { + $edittingstr =''; + } print_header("$site->shortname: $strmanageroles", "$site->fullname", - "$stradministration -> $strmanageroles"); + "$stradministration -> $strmanageroles + $edittingstr + "); // form processing, editting a role, adding a role or deleting a role if ($action && confirm_sesskey()) { @@ -136,52 +146,68 @@ } - if ($roleid) { // load the role if id is present - $role = get_record('role', 'id', $roleid); - $action = 'edit'; - } else { - $role->name=''; - $role->description=''; - $action = 'add'; - } - $roles = get_records('role'); - foreach ($roles as $rolex) { - $options[$rolex->id] = $rolex->name; - } - - // prints a form to swap roles - print ('
'); - print ('
Select a Role: '); - choose_from_menu ($options, 'roleid', $roleid, 'choose', $script='rolesform1.submit()'); - print ('
'); - - $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID); - $contextid = $sitecontext->id; - - // this is the array holding capabilities of this role sorted till this context - $r_caps = role_context_capabilities($roleid, $sitecontext->id); - - // this is the available capabilities assignable in this context - $capabilities = fetch_context_capabilities($sitecontext->id); + if (($roleid && $action!='delete') || $action=='new') { // load the role if id is present + + if ($roleid) { + $action='edit'; + $role = get_record('role', 'id', $roleid); + } else { + $action='add'; + $role->name=''; + $role->description=''; + } + + foreach ($roles as $rolex) { + $options[$rolex->id] = $rolex->name; + } + + // prints a form to swap roles + print ('
'); + print ('
Select a Role: '); + choose_from_menu ($options, 'roleid', $roleid, 'choose', $script='rolesform1.submit()'); + print ('
'); + + $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID); + $contextid = $sitecontext->id; + + // this is the array holding capabilities of this role sorted till this context + $r_caps = role_context_capabilities($roleid, $sitecontext->id); + + // this is the available capabilities assignable in this context + $capabilities = fetch_context_capabilities($sitecontext->id); + + print_simple_box_start(); + include_once('manage.html'); + print_simple_box_end(); - if (!$roleid) { - $action='add'; } else { - $action='edit'; - } - - print_simple_box_start(); - include_once('manage.html'); - print_simple_box_end(); - /************************************************* - * List all roles and link them to override page * - *************************************************/ - - foreach ($roles as $role) { - echo ('
'.$role->name.' delete'); + + $table->tablealign = "center"; + $table->align = array ("middle", "left"); + $table->wrap = array ("nowrap", "nowrap"); + $table->cellpadding = 5; + $table->cellspacing = 0; + $table->width = '40%'; + /************************* + * List all current roles * + **************************/ + + $table->data[] = array('roles', 'description', 'delete'); + foreach ($roles as $role) { + + $table->data[] = array(''.$role->name.'', $role->description, 'delete'); + + } + print_table($table); + + echo ('
'); + echo (''); + echo (''); + echo (''); } + use_html_editor("description"); print_footer($course); ?> diff --git a/admin/roles/tabs.php b/admin/roles/tabs.php index 04824627e8..151d00edfe 100755 --- a/admin/roles/tabs.php +++ b/admin/roles/tabs.php @@ -5,7 +5,8 @@ if ($currenttab != 'update') { switch ($context->level) { case CONTEXT_SYSTEM: - print_header($site->fullname, "$site->fullname","$straction"); + $stradministration = get_string('administration'); + print_header($site->fullname, "$site->fullname","$stradministration -> $straction"); break; case CONTEXT_PERSONAL: @@ -110,7 +111,8 @@ if ($currenttab != 'update') { $tabs = array($toprow); } - print_tabs($tabs, $currenttab, $inactive); - + if ($context->level != CONTEXT_SYSTEM) { // do not show tabs otherwise + print_tabs($tabs, $currenttab, $inactive); + } ?>