You are here

public function UcAddressesHiddenFieldHandler::getFormField in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 handlers/uc_addresses.handlers.inc \UcAddressesHiddenFieldHandler::getFormField()

Implements UcAddressesFieldHandler::getFormField().

Overrides UcAddressesFieldHandler::getFormField

File

handlers/uc_addresses.handlers.inc, line 329
Field handlers for Ubercart Addresses address fields:

Class

UcAddressesHiddenFieldHandler
Class for aid/uid field (which can not be set directly).

Code

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' => 'value',
      '#title' => $this
        ->getFieldTitle(),
      '#value' => $default,
    ),
  );
}