From 9d200a16d75835b2372bc624d4c79f5a26d45f77 Mon Sep 17 00:00:00 2001
From: skodak <skodak>
Date: Wed, 14 Mar 2007 22:07:59 +0000
Subject: [PATCH] MDL-8522 better label for role reset button and confirmation
 text; merged from MOODLE_18_STABLE

---
 admin/roles/manage.html | 2 +-
 admin/roles/manage.php  | 7 ++++++-
 lang/en_utf8/role.php   | 4 +++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/admin/roles/manage.html b/admin/roles/manage.html
index 18f5f3e460b..60ace42e1d9 100755
--- a/admin/roles/manage.html
+++ b/admin/roles/manage.html
@@ -125,7 +125,7 @@ if (!empty($role->legacytype)) {
 foreach ($capabilities as $capability) {
 
     //legacy caps have their own selector
-    if (strpos($capability->name, 'moodle/legacy:') === 0 ) {
+    if (islegacy($capability->name)) {
         continue;
     }
 
diff --git a/admin/roles/manage.php b/admin/roles/manage.php
index 20896cce809..bf20749d875 100755
--- a/admin/roles/manage.php
+++ b/admin/roles/manage.php
@@ -440,12 +440,17 @@
 
             echo '<div class="buttons">';
 
+            $legacytype = get_legacy_type($roleid); 
             $options = array();
             $options['roleid'] = $roleid;
             $options['action'] = 'edit';
             print_single_button('manage.php', $options, get_string('edit'));
             $options['action'] = 'reset';
-            print_single_button('manage.php', $options, get_string('reset'));
+            if (empty($legacytype)) {
+                print_single_button('manage.php', $options, get_string('resetrolenolegacy', 'role'));
+            } else {
+                print_single_button('manage.php', $options, get_string('resetrole', 'role'));
+            }
             $options['action'] = 'duplicate';
             print_single_button('manage.php', $options, get_string('duplicaterole', 'role'));
             print_single_button('manage.php', null, get_string('listallroles', 'role'));
diff --git a/lang/en_utf8/role.php b/lang/en_utf8/role.php
index 75172632ab0..639fff39160 100644
--- a/lang/en_utf8/role.php
+++ b/lang/en_utf8/role.php
@@ -81,8 +81,10 @@ $string['question:export'] = 'Export questions';
 $string['question:import'] = 'Import questions';
 $string['question:manage'] = 'Manage questions';
 $string['question:managecategory'] = 'Manage question category';
+$string['resetrole'] = 'Reset to defaults';
+$string['resetrolenolegacy'] = 'Clear permissions';
 $string['resetrolesure'] = 'Are you sure that you want to reset role \"$a->name ($a->shortname)\" to defaults?<p></p>The defaults are taken from the selected legacy capability ($a->legacytype).';
-$string['resetrolesurenolegacy'] = 'Are you sure that you want to removed all permissions defined in this role \"$a->name ($a->shortname)\"?';
+$string['resetrolesurenolegacy'] = 'Are you sure that you want to clear all permissions defined in this role \"$a->name ($a->shortname)\"?';
 $string['risks'] = 'Risks';
 $string['role:assign'] = 'Assign roles to users';
 $string['role:manage'] = 'Create and manage roles';