Skip to content

Commit

Permalink
Merged fixes from 1.8 stable for role menu fixes MDL-8558
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Feb 18, 2007
1 parent e168115 commit 08c7d26
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
9 changes: 6 additions & 3 deletions admin/roles/manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
$submitlabel = get_string('savechanges');
}

if ($action == 'view') {
?>

<div align="right">
<a href="manage.php?roleid=<?php p($roleid); ?>&amp;action=duplicate"><?php print_string('duplicaterole'); ?></a>
<div class="duplicaterole">
<a href="manage.php?roleid=<?php p($roleid); ?>&amp;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()) ?>" />
Expand Down
19 changes: 8 additions & 11 deletions admin/roles/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,15 @@
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&amp;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>';

Expand Down
1 change: 1 addition & 0 deletions lang/en_utf8/role.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$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';
Expand Down
8 changes: 8 additions & 0 deletions theme/standard/styles_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -738,13 +738,21 @@ body#admin-blocks table#incompatible th.c0 {
margin-top: 1em;
}

#admin-roles-manage .duplicaterole {
text-align: right;
}

#admin-roles-manage .singlebutton,
#admin-roles-allowoverride .singlebutton,
#admin-roles-allowassign .singlebutton {
padding: 10px;
text-align:center;
}

#admin-roles-manage .selector {
text-align:center;
}

.rolecap .inherit,
.rolecap .allow,
.rolecap .prevent,
Expand Down

0 comments on commit 08c7d26

Please sign in to comment.