Merge "Added getMessage() method"
authorawjrichards <arichards@wikimedia.org>
Fri, 12 Oct 2012 23:37:29 +0000 (23:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 12 Oct 2012 23:37:29 +0000 (23:37 +0000)
Asirra.class.php

index a3b12b74657a81d35ede1614967652d5e5a52f86..cbe51e2626a508f4006d0c32c8140e5e5aac835d 100644 (file)
@@ -29,6 +29,14 @@ JAVASCRIPT
                return $js;
        }
 
+       function getMessage( $action ) {
+               $name = 'asirra-' . $action;
+               $text = wfMessage( $name )->text();
+               # Obtain a more tailored message, if possible, otherwise, fall
+               # back to the default for edits
+               return wfMessage( $name, $text )->isDisabled() ? wfMessage( 'asirra-edit' )->text() : $text;
+       }
+
        function passCaptcha() {
                global $wgRequest;