You are here

function theme_uc_addresses_get_address_form in Ubercart Addresses 5

Same name and namespace in other branches
  1. 5.2 uc_addresses.module \theme_uc_addresses_get_address_form()
  2. 6.2 uc_addresses.pages.inc \theme_uc_addresses_get_address_form()
  3. 6 uc_addresses.module \theme_uc_addresses_get_address_form()
  4. 7 uc_addresses.pages.inc \theme_uc_addresses_get_address_form()

Theme the add or edit address form.

Parameters

$form The form array to theme.:

Return value

The themed form (as a string).

File

./uc_addresses.module, line 920

Code

function theme_uc_addresses_get_address_form($form) {
  drupal_add_css(drupal_get_path('module', 'uc_addresses') . '/uc_addresses.css');
  $output = '<p>';
  foreach (element_children($form['panes']) as $pane_id) {

    // TODO: (Tony) Not sure what's going on here.
    if (function_exists($func = _address_pane_data($pane_id, 'callback'))) {
      $result = $func('theme', $form['panes'][$pane_id], NULL);
      if (!empty($result)) {
        $output .= $result;
        $form['panes'][$pane_id] = array();
      }
      else {
        $output .= drupal_render($form['panes'][$pane_id]);
      }
    }
    else {
      $output .= drupal_render($form['panes'][$pane_id]);
    }
  }
  $output .= '<div id="checkout-form-bottom">' . drupal_render($form) . '</div>';
  return $output;
}