);
protected $mMessagePrefix;
+
+ /** @var HTMLFormField[] */
protected $mFlatFields;
+
protected $mFieldTree;
protected $mShowReset = false;
public $mFieldData;
$data = $this->filterDataForSubmit( $this->mFieldData );
- $res = call_user_func( $callback, $data );
+ $res = call_user_func( $callback, $data, $this );
return $res;
}
/**
* Get the whole body of the form.
+ * @return String
*/
function getBody() {
return $this->displaySection( $this->mFieldTree );
/**
* TODO: Document
- * @param $fields array of fields (either arrays or objects)
+ * @param $fields array[]|HTMLFormField[] array of fields (either arrays or objects)
* @param $sectionName string ID attribute of the <table> tag for this section, ignored if empty
* @param $fieldsetIDPrefix string ID prefix for the <fieldset> tag of each subsection, ignored if empty
+ * @return String
*/
function displaySection( $fields, $sectionName = '', $fieldsetIDPrefix = '' ) {
$tableHtml = '';
/**
* For a checkbox, the label goes on the right hand side, and is
* added in getInputHTML(), rather than HTMLFormField::getRow()
+ * @return String
*/
function getLabel() {
return ' ';
} else {
$final = $this->getDefault();
- $list = $text = '';
+
+ $list = 'other';
+ $text = $final;
+ foreach ( $this->mFlatOptions as $option ) {
+ $match = $option . wfMsgForContent( 'colon-separator' );
+ if( strpos( $text, $match ) === 0 ) {
+ $list = $option;
+ $text = substr( $text, strlen( $match ) );
+ break;
+ }
+ }
}
return array( $final, $list, $text );
}
/**
* This returns a block of all the radio options, in one cell.
* @see includes/HTMLFormField#getInputHTML()
+ * @param $value String
+ * @return String
*/
function getInputHTML( $value ) {
$html = $this->formatOptions( $this->mParams['options'], $value );
/**
* Button cannot be invalid
+ * @param $value String
+ * @param $alldata Array
+ * @return Bool
*/
public function validate( $value, $alldata ){
return true;