Daniel Werner has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/211899

Change subject: Updated documentation for HTMLForm "hide-if" field
......................................................................

Updated documentation for HTMLForm "hide-if" field

Change-Id: I410c58dc0586cfe97e39668c9608ce0d9e10a08b
---
M includes/htmlform/HTMLForm.php
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/211899/1

diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index 738fec3..bef4dc0 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -84,6 +84,27 @@
  *                             is "wp{$fieldname}".  If you want a different 
name
  *                             (eg one without the "wp" prefix), specify it 
here and
  *                             it will be used without modification.
+ *    'hide-if'             -- expression given as an array stating when the 
field
+ *                             should be hidden. The first array value has to 
be the
+ *                             expression's logic operator. Supported 
expressions:
+ *                               'NOT'
+ *                                 [ 'NOT', array $expression ]
+ *                                 To hide a field if a given expression is 
not true.
+ *                               '==='
+ *                                 [ '===', string $fieldName, string $value ]
+ *                                 To hide a field if another field identified 
by
+ *                                 $field has the value $value.
+ *                               '!=='
+ *                                 [ '!==', string $fieldName, string $value ]
+ *                                 Same as [ 'NOT', [ '===', $fieldName, 
$value ]
+ *                               'OR', 'AND', 'NOR', 'NAND'
+ *                                 [ 'XXX', array $expression1, ..., array 
$expressionN ]
+ *                                 To hide a field if one or more (OR), all 
(AND),
+ *                                 neither (NOR) or not all (NAND) given 
expressions
+ *                                 are evaluated as true.
+ *                             The expressions will be given to a JavaScript 
frontend
+ *                             module which will continually update the field's
+ *                             visibility.
  *
  * Since 1.20, you can chain mutators to ease the form generation:
  * @par Example:

-- 
To view, visit https://gerrit.wikimedia.org/r/211899
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I410c58dc0586cfe97e39668c9608ce0d9e10a08b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Daniel Werner <daniel.a.r.wer...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to