Merge "Use isDisabled() instead of isBlank() in getGrantName in User.php"
[lhc/web/wiklou.git] / includes / user / User.php
index 4950e27..f07db0e 100644 (file)
@@ -5076,6 +5076,19 @@ class User implements IDBAccessObject {
                return $msg->isDisabled() ? $right : $msg->text();
        }
 
+       /**
+        * Get the name of a given grant
+        *
+        * @since 1.29
+        * @param string $grant Grant to query
+        * @return string Localized name of the grant
+        */
+       public static function getGrantName( $grant ) {
+               $key = "grant-$grant";
+               $msg = wfMessage( $key );
+               return $msg->isDisabled() ? $grant : $msg->text();
+       }
+
        /**
         * Make a new-style password hash
         *