
Public Member Functions | |
| __construct (spunQ_IFieldContainer $container, $name) | |
| Constructor. | |
| convertSpunQToRaw ($value) | |
| Converts an application value to a raw value. | |
| convertRawToSpunQ ($messagePrefix, &$value) | |
| Converts a raw value to an application value. | |
| show ($value=NULL, $template=NULL, $templateParameters=array(), $htmlIdPostFix= '') | |
| Will generate and display html for this form field. | |
| getFields () | |
| Returns all fields in this container, indexed by their names. | |
| getField ($name) | |
| Returns the field with given name. | |
| __clone () | |
| Called after this object was cloned (on the newly created object). | |
| wasSubmitted () | |
| Whether the form the field is in was submitted. | |
| addField (spunQ_IField $field) | |
| Adds a field to this container. | |
| removeField (spunQ_IField $field) | |
| Removes a field from this container. | |
| getTypeString () | |
| Returns a type string for the container. | |
| getFieldHtmlId ($field, $postfix) | |
| Provides the html id of a field. | |
| getFieldHtmlName ($field) | |
| Provides the html name of the field. | |
| submittedValueValid () | |
| Returns whether the value submitted by the browser is valid This will only check whether the values received are acceptable to this field type. | |
| showValidatorsJs () | |
| Prints javascript for validating this field. | |
| getFieldByPath ($path) | |
| Returns a field by its field path. | |
| setUseSubmittedValue ($useSubmittedValue=true) | |
| getDisplayValue ($originalValue) | |
| Returns the value to use for show(). | |
| getForm () | |
| Provides the form this field resides in. | |
| getContainer () | |
| setContainer (spunQ_IFieldContainer $container) | |
| getName () | |
| getTypePath () | |
| getTypePathPart () | |
| addConverter (spunQ_IFieldValueConverter $converter) | |
| addValidator (spunQ_IFieldValidator $validator) | |
| getConverters () | |
| getValidators () | |
| getHtmlId ($postfix= '') | |
| getHtmlName () | |
| getUseSubmittedValue () | |
| getSubmittedRawValue () | |
| getSubmittedValue () | |
| getValue () | |
| getValidationMessages () | |
| _processSubmission (&$rawValue) | |
Static Public Member Functions | |
| static | normalizeTemplateCssParameter ($class) |
Normalizes the $class parameter passed to a field template. | |
Protected Member Functions | |
| spunQToRaw ($value) | |
| rawToSpunQ (&$value) | |
| getDefaultTemplate () | |
| Provides a template to be used if the parameter was not passed to show(). | |
Protected Attributes | |
| $fields = array() | |
| All fields in this field group. | |
| $name | |
| Name of this field. | |
| $container | |
| The container this field is residing in. | |
| $useSubmittedValue = true | |
| Whether the submitted value should override the default value. | |
| $converters = array() | |
| The converters that have been registered with this field. | |
| $validators = array() | |
| Registered field validators. | |
| $validationMessages = NULL | |
| Messages generated by validators and converters. | |
| $submittedValue = NULL | |
| Value that was submitted for this field. | |
| $submittedRawValue = NULL | |
| Raw value that was submitted for this field. | |
Definition at line 6 of file DateField.class.php.
| spunQ_FieldGroup::__clone | ( | ) | [inherited] |
Called after this object was cloned (on the newly created object).
Will clone all its fields and reset their container.
Definition at line 84 of file FieldGroup.class.php.
| spunQ_FieldGroup::addField | ( | spunQ_IField $ | field | ) | [inherited] |
Adds a field to this container.
$field The field to add to this container.
this Implements spunQ_IFieldContainer.
Definition at line 104 of file FieldGroup.class.php.
| spunQ_DateField::convertRawToSpunQ | ( | $ | messagePrefix, | |
| &$ | value | |||
| ) |
Converts a raw value to an application value.
| $messagePrefix | String to be prefixed to translation key of validation messages. | |
| $value | The value to convert. This is also an out parameter that will contain the converted spunQ value. |
| spunQ_InvalidRawValueException | If the raw value has an unexpected type (i.e. array instead of string or vice versa.) |
Implements spunQ_IFieldValueConverter.
Definition at line 58 of file DateField.class.php.
| spunQ_DateField::convertSpunQToRaw | ( | $ | value | ) |
Converts an application value to a raw value.
| $value | The value to convert. |
Implements spunQ_IFieldValueConverter.
Definition at line 37 of file DateField.class.php.
| spunQ_Field::getDefaultTemplate | ( | ) | [protected, inherited] |
Provides a template to be used if the parameter was not passed to show().
The show() implementation in spunQ_IField uses this value.
Definition at line 391 of file Field.class.php.
| spunQ_FieldGroup::getDisplayValue | ( | $ | originalValue | ) | [inherited] |
Returns the value to use for show().
This is either the value given as parameter or the submitted value, depending on form submission and the value of getUseSubmittedValue().
| $originalValue | The original value to be displayed if the form was not submitted. |
Implements spunQ_IField.
Definition at line 195 of file FieldGroup.class.php.
| spunQ_FieldGroup::getField | ( | $ | name | ) | [inherited] |
Returns the field with given name.
| spunQ_HtmlException | If no field with given name was added to this container. |
Definition at line 72 of file FieldGroup.class.php.
| spunQ_FieldGroup::getFieldByPath | ( | $ | path | ) | [inherited] |
Returns a field by its field path.
| $path | Either a string or an array. The string should contain only the difference between this fields path and the searched field's path. |
| spunQ_HtmlException | If the field is not found. |
Implements spunQ_IField.
Definition at line 164 of file FieldGroup.class.php.
| spunQ_FieldGroup::getFieldHtmlId | ( | $ | field, | |
| $ | postfix | |||
| ) | [inherited] |
Provides the html id of a field.
The rationale of this function is the same as for getFieldHtmlName().
| $field | The field to get the html id for. |
Implements spunQ_IFieldContainer.
Definition at line 128 of file FieldGroup.class.php.
| spunQ_FieldGroup::getFieldHtmlName | ( | $ | field | ) | [inherited] |
Provides the html name of the field.
The container is respensible for all contained field's names. A form might just return the fields name, a FieldIterator will postfix the square brackets that PHP expects.
| $field | The field to get the html name for. |
Implements spunQ_IFieldContainer.
Definition at line 135 of file FieldGroup.class.php.
| spunQ_FieldGroup::getFields | ( | ) | [inherited] |
Returns all fields in this container, indexed by their names.
Definition at line 62 of file FieldGroup.class.php.
| spunQ_Field::getForm | ( | ) | [inherited] |
Provides the form this field resides in.
Definition at line 120 of file Field.class.php.
| spunQ_FieldGroup::getTypeString | ( | ) | [inherited] |
Returns a type string for the container.
The type string is - unlike the name - not unique. It is used for grouping forms and fields into types that have common functions. One example is error message translation. Although the forms with the names editUser<user:14> and editUser<user:15> are two completely distinct forms, they might have the exact same error messages for their fields.
Implements spunQ_IFieldContainer.
Definition at line 121 of file FieldGroup.class.php.
| static spunQ_Field::normalizeTemplateCssParameter | ( | $ | class | ) | [static, inherited] |
Normalizes the $class parameter passed to a field template.
Many field templates have an optional parameter called $class that can be passed either of the following:
NULL indicating, that no class declaration is to be added.| $class | The value that was passed to the template. Either of the types mentioned in the function description. |
class attribute of an html node. | spunQ_HtmlException | If the parameter has an unexpected type or an invalid css declaration. |
Definition at line 20 of file Field.class.php.
| spunQ_FieldGroup::removeField | ( | spunQ_IField $ | field | ) | [inherited] |
Removes a field from this container.
$field The field to remove.
this Implements spunQ_IFieldContainer.
Definition at line 113 of file FieldGroup.class.php.
| spunQ_FieldGroup::show | ( | $ | value = NULL, |
|
| $ | template = NULL, |
|||
| $ | templateParameters = array(), |
|||
| $ | htmlIdPostfix = '' | |||
| ) | [inherited] |
Will generate and display html for this form field.
| $value | The default value this field shall display. This is expected to be the actual value required in the application. It will be run through all converters before it is passed to the template. This value might be replaced by the value the user submitted if getUseSubmittedValue() yields true. | |
| $template | The template to use for converting this field into html. The template will receive the following parameters:
| |
| $templateParameters | Additional parameters to be passed to the template. | |
| $htmlIdPostfix | A postfix to be added to id attributes of the html form elements that are generated. A unique parameter must be provided each time the form is displayed. |
$this Implements spunQ_IField.
Definition at line 22 of file FieldGroup.class.php.
| spunQ_FieldGroup::showValidatorsJs | ( | ) | [inherited] |
Prints javascript for validating this field.
$this Implements spunQ_IField.
Definition at line 154 of file FieldGroup.class.php.
| spunQ_FieldGroup::submittedValueValid | ( | ) | [inherited] |
Returns whether the value submitted by the browser is valid This will only check whether the values received are acceptable to this field type.
It will not check the results of validators.
| spunQ_HtmlException | If the form was not submitted. |
Implements spunQ_IField.
Definition at line 142 of file FieldGroup.class.php.
| spunQ_FieldGroup::wasSubmitted | ( | ) | [inherited] |
Whether the form the field is in was submitted.
Implements spunQ_IFieldContainer.
Definition at line 97 of file FieldGroup.class.php.
spunQ_Field::$container [protected, inherited] |
spunQ_Field::$converters = array() [protected, inherited] |
The converters that have been registered with this field.
Definition at line 63 of file Field.class.php.
spunQ_FieldGroup::$fields = array() [protected, inherited] |
All fields in this field group.
Definition at line 17 of file FieldGroup.class.php.
spunQ_Field::$name [protected, inherited] |
spunQ_Field::$submittedRawValue = NULL [protected, inherited] |
Raw value that was submitted for this field.
Definition at line 89 of file Field.class.php.
spunQ_Field::$submittedValue = NULL [protected, inherited] |
Value that was submitted for this field.
Initialized in _processSubmission().
Definition at line 83 of file Field.class.php.
spunQ_Field::$useSubmittedValue = true [protected, inherited] |
Whether the submitted value should override the default value.
In other words: If this is set to true, the field will display the value that was submitted previously instead of the default value.
Definition at line 57 of file Field.class.php.
spunQ_Field::$validationMessages = NULL [protected, inherited] |
Messages generated by validators and converters.
Initialized in _processSubmission().
Definition at line 76 of file Field.class.php.
spunQ_Field::$validators = array() [protected, inherited] |
Registered field validators.
Definition at line 69 of file Field.class.php.
1.5.9