From: Daniel A. R. Werner Date: Mon, 18 May 2015 22:11:59 +0000 (+0200) Subject: Added documentation for HTMLFormField's "hide-if" X-Git-Tag: 1.31.0-rc.0~11362^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=def394bea7cdb7df11a342c268b2f7e20ea5802a;p=lhc%2Fweb%2Fwiklou.git Added documentation for HTMLFormField's "hide-if" Change-Id: I410c58dc0586cfe97e39668c9608ce0d9e10a08b --- diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 738fec3b1e..bef4dc091e 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: