r92893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92892‎ | r92893 | r92894 >
Date:21:16, 22 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added message field to Parameter class so documentation hooks can properly handle multiple languages and incremented version number
Modified paths:
  • /trunk/extensions/Validator/INSTALL (modified) (history)
  • /trunk/extensions/Validator/Validator.php (modified) (history)
  • /trunk/extensions/Validator/includes/Parameter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/INSTALL
@@ -1,4 +1,4 @@
2 -[[Validator 0.4.8]]
 2+[[Validator 0.4.9]]
33
44 Once you have downloaded the code, place the 'Validator' directory within
55 your MediaWiki 'extensions' directory. Then add the following code to your
Index: trunk/extensions/Validator/includes/Parameter.php
@@ -189,6 +189,16 @@
190190 protected $description = false;
191191
192192 /**
 193+ * A message that acts as description for the parameter or false when there is none.
 194+ * Can be obtained via getMessage and set via setMessage.
 195+ *
 196+ * @since 0.4.9
 197+ *
 198+ * @var mixed string or false
 199+ */
 200+ protected $message = false;
 201+
 202+ /**
193203 * Constructor.
194204 *
195205 * @since 0.4
@@ -785,6 +795,29 @@
786796 */
787797 public function setDescription( $descriptionMessage ) {
788798 $this->description = $descriptionMessage;
789 - }
 799+ }
 800+
 801+ /**
 802+ * Returns a message that will act as a description message for the parameter, or false when there is none.
 803+ * Override in deriving classes to add a message.
 804+ *
 805+ * @since 0.4.9
 806+ *
 807+ * @return mixed string or false
 808+ */
 809+ public function getDescription() {
 810+ return $this->message;
 811+ }
790812
 813+ /**
 814+ * Sets a message for the parameter that will act as description.
 815+ *
 816+ * @since 0.4.9
 817+ *
 818+ * @param string $message
 819+ */
 820+ public function setDescription( $message ) {
 821+ $this->message = $message;
 822+ }
 823+
791824 }
\ No newline at end of file
Index: trunk/extensions/Validator/Validator.php
@@ -25,7 +25,7 @@
2626 die( 'Not an entry point.' );
2727 }
2828
29 -define( 'Validator_VERSION', '0.4.8' );
 29+define( 'Validator_VERSION', '0.4.9 alpha' );
3030
3131 // Register the internationalization file.
3232 $wgExtensionMessagesFiles['Validator'] = dirname( __FILE__ ) . '/Validator.i18n.php';