class UcAddressesTextFieldHandler in Ubercart Addresses 7
Same name and namespace in other branches
- 6.2 handlers/uc_addresses.handlers.inc \UcAddressesTextFieldHandler
Handler for a simple text field.
Hierarchy
- class \UcAddressesFieldHandler
- class \UcAddressesTextFieldHandler
Expanded class hierarchy of UcAddressesTextFieldHandler
2 string references to 'UcAddressesTextFieldHandler'
File
- handlers/
uc_addresses.handlers.inc, line 18 - Field handlers for Ubercart Addresses address fields:
View source
class UcAddressesTextFieldHandler extends UcAddressesFieldHandler {
/**
* Implements UcAddressesFieldHandler::getFormField().
*/
public function getFormField($form, $form_values) {
$fieldName = $this
->getFieldName();
$fieldValue = $this
->getAddress()
->getField($fieldName);
$default = isset($form_values[$fieldName]) ? $form_values[$fieldName] : $fieldValue;
return array(
$fieldName => array(
'#type' => 'textfield',
'#title' => $this
->getFieldTitle(),
'#default_value' => $default,
'#required' => $this
->isFieldRequired(),
'#maxlength' => 20,
'#size' => 32,
),
);
}
/**
* Implements UcAddressesFieldHandler::isFieldEnabled().
*/
public function isFieldEnabled() {
return TRUE;
}
/**
* Implements UcAddressesFieldHandler::isFieldRequired().
*/
public function isFieldRequired() {
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UcAddressesFieldHandler:: |
private | property | Address object. | |
UcAddressesFieldHandler:: |
private | property | The context in which this field is used. | |
UcAddressesFieldHandler:: |
private | property | The declared field definition. | |
UcAddressesFieldHandler:: |
private | property | Name of this field. | |
UcAddressesFieldHandler:: |
public | function | Checks if the field passes the context. | 1 |
UcAddressesFieldHandler:: |
final public | function | Returns the address attached to this field. | |
UcAddressesFieldHandler:: |
final public | function | Returns the context in which this field is used. | |
UcAddressesFieldHandler:: |
public | function | Returns a default value for this field. | 3 |
UcAddressesFieldHandler:: |
final public | function | Returns the field name. | |
UcAddressesFieldHandler:: |
public | function | Returns the title to use when displaying a field. | 1 |
UcAddressesFieldHandler:: |
public | function | Returns supported mapping targets for Feeds. | 2 |
UcAddressesFieldHandler:: |
public | function | Returns an array of possible output formats the handler supports. | 2 |
UcAddressesFieldHandler:: |
final public | function | Returns a property from the field definition. | |
UcAddressesFieldHandler:: |
public | function | Returns supported tokens. | 1 |
UcAddressesFieldHandler:: |
protected | function | Can be used by subclasses to do some initialization upon construction of the object. | 2 |
UcAddressesFieldHandler:: |
public | function | Set a fields value based on the output format. | 2 |
UcAddressesFieldHandler:: |
public | function | Output a field's value. | 3 |
UcAddressesFieldHandler:: |
public | function | Sets value in the address object. | |
UcAddressesFieldHandler:: |
public | function | Check a fields' value. | 2 |
UcAddressesFieldHandler:: |
final public | function | UcAddressesFormField object constructor. | |
UcAddressesTextFieldHandler:: |
public | function |
Implements UcAddressesFieldHandler::getFormField(). Overrides UcAddressesFieldHandler:: |
|
UcAddressesTextFieldHandler:: |
public | function |
Implements UcAddressesFieldHandler::isFieldEnabled(). Overrides UcAddressesFieldHandler:: |
|
UcAddressesTextFieldHandler:: |
public | function |
Implements UcAddressesFieldHandler::isFieldRequired(). Overrides UcAddressesFieldHandler:: |