[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/htmlform/ -> HTMLFormFieldCloner.php (summary)

(no description)

File Size: 382 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLFormFieldCloner:: (10 methods):
  __construct()
  createFieldsForKey()
  rekeyValuesArray()
  needsLabel()
  loadDataFromRequest()
  getDefault()
  cancelSubmit()
  validate()
  getInputHTMLForKey()
  getInputHTML()


Class: HTMLFormFieldCloner  - X-Ref

A container for HTMLFormFields that allows for multiple copies of the set of
fields to be displayed to and entered by the user.

Recognized parameters, besides the general ones, include:
fields - HTMLFormField descriptors for the subfields this cloner manages.
The format is just like for the HTMLForm. A field with key 'delete' is
special: it must have type = submit and will serve to delete the group
of fields.
required - If specified, at least one group of fields must be submitted.
format - HTMLForm display format to use when displaying the subfields:
'table', 'div', or 'raw'.
row-legend - If non-empty, each group of subfields will be enclosed in a
fieldset. The value is the name of a message key to use as the legend.
create-button-message - Message key to use as the text of the button to
add an additional group of fields.
delete-button-message - Message key to use as the text of automatically-
generated 'delete' button. Ignored if 'delete' is included in 'fields'.

In the generated HTML, the subfields will be named along the lines of
"clonerName[index][fieldname]", with ids "clonerId--index--fieldid". 'index'
may be a number or an arbitrary string, and may likely change when the page
is resubmitted. Cloners may be nested, resulting in field names along the
lines of "cloner1Name[index1][cloner2Name][index2][fieldname]" and
corresponding ids.

Use of cloner may result in submissions of the page that are not submissions
of the HTMLForm, when non-JavaScript clients use the create or remove buttons.

The result is an array, with values being arrays mapping subfield names to
their values. On non-HTMLForm-submission page loads, there may also be
additional (string) keys present with other types of values.

__construct( $params )   X-Ref


createFieldsForKey( $key )   X-Ref
Create the HTMLFormFields that go inside this element, using the
specified key.

param: string $key Array key under which these fields should be named
return: HTMLFormField[]

rekeyValuesArray( $key, $values )   X-Ref
Re-key the specified values array to match the names applied by
createFieldsForKey().

param: string $key Array key under which these fields should be named
param: array $values Values array from the request
return: array

needsLabel()   X-Ref
No description

loadDataFromRequest( $request )   X-Ref
No description

getDefault()   X-Ref
No description

cancelSubmit( $values, $alldata )   X-Ref
No description

validate( $values, $alldata )   X-Ref
No description

getInputHTMLForKey( $key, $values )   X-Ref
Get the input HTML for the specified key.

param: string $key Array key under which the fields should be named
param: array $values
return: string

getInputHTML( $values )   X-Ref
No description



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1