Added getMessage() method
authoryaron <yaron57@gmail.com>
Tue, 4 Sep 2012 14:50:06 +0000 (18:50 +0400)
committeryaron <yaron57@gmail.com>
Tue, 4 Sep 2012 14:50:38 +0000 (18:50 +0400)
Change-Id: I1c5b6985b04142b6998ac742b12903297c77dbc2

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;