You are here

function uc_addresses_list_one_address in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 uc_addresses.pages.inc \uc_addresses_list_one_address()

Displays a single address.

If the current user can edit the address, then provide an edit link.

Parameters

object $address_user: The user who "owns" the address.

UcAddressesAddress $address: The address to display.

array $options: Options for display, see template_preprocess_uc_addresses_list_address().

Return value

string The themed address.

1 call to uc_addresses_list_one_address()
uc_addresses_address_book in ./uc_addresses.pages.inc
Generates a list of all addresses owned by a single user.
1 string reference to 'uc_addresses_list_one_address'
uc_addresses_menu in ./uc_addresses.module
Implements hook_menu().

File

./uc_addresses.pages.inc, line 126
Page callbacks for viewing, adding, editing, and deleting addresses.

Code

function uc_addresses_list_one_address($address_user, UcAddressesAddress $address, $options = array()) {
  if (UcAddressesPermissions::canViewAddress($address_user, $address)) {
    $options['edit_link'] = TRUE;
    $options['delete_link'] = TRUE;
    return theme('uc_addresses_list_address', array(
      'address' => $address,
      'options' => $options,
    ));
  }
}