some UI changes

This commit is contained in:
toyomoyo 2006-08-14 08:46:44 +00:00
parent b367b152ad
commit 7e2d7c92ad
6 changed files with 88 additions and 26 deletions

View file

@ -1,6 +1,14 @@
<form name="assignform" id="assignform" method="post" action="assign.php">
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>" />
<?php
if ($userid) {
print ('<input type="hidden" name="userid" value="'.$userid.'"/>');
}
if ($course->id) {
print ('<input type="hidden" name="courseid" value="'.$courseid.'" />');
}
?>
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="hidden" name="contextid" value="<?php echo $contextid ?>" />
<input type="hidden" name="roleid" value="<?php echo $roleid ?>" />

View file

@ -16,7 +16,13 @@
$previoussearch = ($searchtext != '') or ($previoussearch) ? 1:0;
$timestart = optional_param('timestart', 0, PARAM_INT);
$timeend = optional_param('timened', 0, PARAM_INT);
$userid = optional_param('userid', 0, PARAM_INT); // needed for user tabs
$courseid = optional_param('courseid', 0, PARAM_INT); // needed for user tabs
if ($courseid) {
$course = get_record('course', 'id', $courseid);
}
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
@ -37,7 +43,6 @@
* 2) not in role_deny_grant
* end of permission checking
*/
$strassignusers = get_string('assignusers', 'role');
$strpotentialusers = get_string('potentialusers', 'role');
@ -48,10 +53,21 @@
$strsearch = get_string('search');
$strshowall = get_string('showall');
$currenttab = '';
$tabsmode = 'assign';
include_once('tabs.php');
$context = get_record('context', 'id', $contextid);
// we got a few tabs there
if ($context->level == CONTEXT_USERID) {
print_header();
$currenttab = 'roles';
include_once($CFG->dirroot.'/user/tabs.php');
} else {
$currenttab = '';
$tabsmode = 'assign';
include_once('tabs.php');
}
/// Print a help notice about the need to use this page
if (!$frm = data_submitted()) {
@ -129,7 +145,13 @@
// prints a form to swap roles
print ('<form name="rolesform" action="assign.php" method="post">');
print ('<div align="center">'.$strcurrentcontext.': '.print_context_name($context).'<br/>');
print ('<input type="hidden" name="contextid" value="'.$context->id.'">'.$strcurrentrole.': ');
if ($userid) {
print ('<input type="hidden" name="userid" value="'.$userid.'" />');
}
if ($course->id) {
print ('<input type="hidden" name="courseid" value="'.$courseid.'" />');
}
print ('<input type="hidden" name="contextid" value="'.$context->id.'" />'.$strcurrentrole.': ');
choose_from_menu ($options, 'roleid', $roleid, 'choose', $script='rolesform.submit()');
print ('</div></form>');

View file

@ -13,6 +13,7 @@ if ($currenttab != 'update') {
break;
case CONTEXT_USERID:
print_header();
break;
case CONTEXT_COURSECAT:
@ -82,7 +83,7 @@ if ($currenttab != 'update') {
}
$toprow[] = new tabobject('roles', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id, get_string('roles'));
$toprow[] = new tabobject('roles', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id, get_string('roles'));
if (isset($tabsmode)) {
$inactive[] = 'roles';