Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct ( $input_number, $cur_value, $input_name, $disabled, array $other_args) | |
getDefaultParameters () | |
getHtmlText () | |
getJsInitFunctionData () | |
getJsValidationFunctionData () | |
getResourceModuleNames () | |
addJsInitFunctionData ( $name, $param=null) | |
addJsValidationFunctionData ( $name, $param='null') | |
addJavaScript () | |
Static Public Member Functions | |
static | getName () |
static | getHandledPropertyTypes () |
static | getParameters () |
static | canHandleLists () |
static | getDefaultPropTypes () |
static | getDefaultPropTypeLists () |
static | getOtherPropTypesHandled () |
static | getOtherPropTypeListsHandled () |
static | getDefaultCargoTypes () |
static | getDefaultCargoTypeLists () |
static | getOtherCargoTypesHandled () |
static | getOtherCargoTypeListsHandled () |
Protected Attributes | |
$mInputNumber | |
$mCurrentValue | |
$mInputName | |
$mIsMandatory | |
$mIsDisabled | |
$mOtherArgs | |
$mJsInitFunctionData = array() | |
$mJsValidationFunctionData = array() | |
Parent class for all form input classes.
PFFormInput::__construct | ( | $input_number, | |
$cur_value, | |||
$input_name, | |||
$disabled, | |||
array | $other_args | ||
) |
string | $input_number | The number of the input in the form. For a simple HTML input element this should end up in the id attribute in the format 'input_<number>'. |
string | $cur_value | The current value of the input field. For a simple HTML input element this should end up in the value attribute. |
string | $input_name | The name of the input. For a simple HTML input element this should end up in the name attribute. |
bool | $disabled | Is this input disabled? |
array | $other_args | An associative array of other parameters that were present in the input definition. |
PFFormInput::addJavaScript | ( | ) |
Add the necessary JavaScript for this input.
PFFormInput::addJsInitFunctionData | ( | $name, | |
$param = null |
|||
) |
For each input type one or more JavaScript initialization functions may be specified.
This function is not used yet.
They are called to initialize the input after the page html has loaded (or for "multiple" templates after the page fragment has loaded).
The JavaScript function specified here must be in the top level scope of the document. When it is called it will get the input's id attribute as the first parameter and the specified param as the second.
Examples:
Adding initFoo like this: addJsInitFunctionData( "initFoo", "'bar'" );
will result in this JavaScript call: initFoo( inputID, 'bar' );
.
Adding initFoo like this: addJsInitFunctionData( "initFoo", "array('bar', 'baz'" );
will result in this JavaScript call: initFoo( inputID, array('bar', 'baz') );
.
string | $name | The name of the initialization function. |
string | null | $param | The parameter passed to the initialization function. |
PFFormInput::addJsValidationFunctionData | ( | $name, | |
$param = 'null' |
|||
) |
For each input type one or more JavaScript validation functions may be specified.
Not used yet.
They are called to validate the input before the form is submitted for saving or preview.
The JavaScript function specified here must be in the top level scope of the document. When it is called it will get the input's id attribute as the first parameter and the specified param as the second.
Examples:
Adding validateFoo like this: addJsValidationFunctionData( "initFoo", "'bar'" );
will result in this JavaScript call: validateFoo( inputID, 'bar' );
.
Adding validateFoo like this: addJsValidationFunctionData( "initFoo", "array('bar', 'baz'" );
will result in this JavaScript call: validateFoo( inputID, array('bar', 'baz') );
.
string | $name | The name of the initialization function. |
string | $param | The parameter passed to the initialization function. |
|
static |
PFFormInput::getDefaultParameters | ( | ) |
Return an array of the default parameters for this input where the parameter name is the key while the parameter value is the value.
|
static |
Returns the set of SMW property types for which this input is meant to be the default one - ideally, no more than one input should declare itself the default for any specific type.
|
static |
Returns the set of SMW property types for which this input is meant to be the default one - ideally, no more than one input should declare itself the default for any specific type.
|
static |
PFFormInput::getHtmlText | ( | ) |
Returns the HTML code to be included in the output page for this input.
Ideally this HTML code should provide a basic functionality even if the browser is not JavaScript capable. I.e. even without JavaScript the user should be able to input values.
PFFormInput::getJsInitFunctionData | ( | ) |
Returns the name and parameters for the initialization JavaScript function for this input type, if any.
This function is not used yet.
PFFormInput::getJsValidationFunctionData | ( | ) |
Returns the name and parameters for the validation JavaScript functions for this input type, if any.
This function is not used yet.
|
static |
Returns the name of the input type this class handles.
This is the name to be used in the field definition for the "input type" parameter.
|
static |
Returns the set of SMW property types which this input can handle, but for which it isn't the default input.
|
static |
Returns the set of SMW property types which this input can handle, but for which it isn't the default input.
|
static |
Returns the set of parameters for this form input.
PFFormInput::getResourceModuleNames | ( | ) |
Returns the names of the resource modules this input type uses.
Returns the names of the modules as an array or - if there is only one module - as a string.