$submitlabel = get_string('savechanges');
}
+ if ($action == 'view') {
?>
-
-<div align="right">
-<a href="manage.php?roleid=<?php p($roleid); ?>&action=duplicate"><?php print_string('duplicaterole'); ?></a>
+<div class="duplicaterole">
+<a href="manage.php?roleid=<?php p($roleid); ?>&action=duplicate"><?php print_string('duplicaterole', 'role'); ?></a>
</div>
+<?php
+ }
+?>
<form id="rolesform" action="manage.php" method="post">
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
break;
}
- echo '<div align="center" class="selector">';
+ echo '<div class="selector">';
if ($action == 'view') {
- echo get_string('selectrole', 'role').': ';
- echo '<form style="display:inline;" id="switchrole" action="manage.php" method="get">';
- echo '<input type="hidden" name="action" value="view" />';
- choose_from_menu ($roleoptions, 'roleid', $roleid, get_string('listallroles', 'role').'...', $script='switchrole.submit()');
- echo '</form>';
- echo '<form style="display:inline;" id="editrole" action="manage.php" method="get">';
- echo '<input type="hidden" name="roleid" value="'.$roleid.'" />';
- echo '<input type="hidden" name="action" value="edit" />';
- echo '<input type="submit" value="'.get_string('edit').'" />';
- echo '</form>';
+ popup_form('manage.php?action=view&roleid=', $roleoptions, 'switchrole', $roleid, '', '', '',
+ false, 'self', get_string('selectrole', 'role').': ');
+
+ $options = array();
+ $options['roleid'] = $roleid;
+ $options['action'] = 'edit';
+ print_single_button('manage.php', $options, get_string('edit'));
}
echo '</div>';
$string['defaultrole'] = 'Default role';
$string['defineroles'] = 'Define roles';
$string['deleterolesure'] = 'Are you sure that you want to delete role \"$a->name ($a->shortname)\"?</p><p>Currently this role is assigned to $a->count users.';
+$string['duplicaterole'] = 'Duplicate this role';
$string['editrole'] = 'Edit role';
$string['errorbadrolename'] = 'Incorrect role name';
$string['errorbadroleshortname'] = 'Incorrect role name';
margin-top: 1em;
}
+#admin-roles-manage .duplicaterole {
+ text-align: right;
+}
+
#admin-roles-manage .singlebutton,
#admin-roles-allowoverride .singlebutton,
#admin-roles-allowassign .singlebutton {
text-align:center;
}
+#admin-roles-manage .selector {
+ text-align:center;
+}
+
.rolecap .inherit,
.rolecap .allow,
.rolecap .prevent,