]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fixes from 1.8 stable for role menu fixes MDL-8558
authormoodler <moodler>
Sun, 18 Feb 2007 13:01:15 +0000 (13:01 +0000)
committermoodler <moodler>
Sun, 18 Feb 2007 13:01:15 +0000 (13:01 +0000)
admin/roles/manage.html
admin/roles/manage.php
lang/en_utf8/role.php
theme/standard/styles_layout.css

index 7401712c643c52a1741263b218621288194565e5..7a21c673961f1e4988b1a9709b7e9496b89a6983 100755 (executable)
             $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()) ?>" />
index 99c55d358898a763ebb3dd8b3e2d807659dd8322..87745efdc4054d3548bab2b527a16aa6f8becb50 100755 (executable)
                 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>';
 
index 71f0c12190dbe522b567ba51667886ea50612ad8..3c5421f3989e6e482ff2ab161249a0c02b793ea4 100644 (file)
@@ -49,6 +49,7 @@ $string['currentrole'] = 'Current role';
 $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';
index f727cde7a92e560695d4d7d2ab9f136e19d9d081..95451ab7aa43251152e041ee31e88a9029630810 100644 (file)
@@ -738,6 +738,10 @@ 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 {
@@ -745,6 +749,10 @@ body#admin-blocks table#incompatible th.c0 {
   text-align:center;
 }
 
+#admin-roles-manage .selector {
+  text-align:center;
+}
+
 .rolecap .inherit,
 .rolecap .allow,
 .rolecap .prevent,