class uc_addresses_handler_field_uc_addresses_link_edit in Ubercart Addresses 6.2
Same name and namespace in other branches
- 7 views/uc_addresses_handler_field_uc_addresses_link_edit.inc \uc_addresses_handler_field_uc_addresses_link_edit
Field handler to present a link edit an address.
Hierarchy
- class \uc_addresses_handler_field_uc_addresses_link extends \views_handler_field
Expanded class hierarchy of uc_addresses_handler_field_uc_addresses_link_edit
1 string reference to 'uc_addresses_handler_field_uc_addresses_link_edit'
- uc_addresses_views_data in views/
uc_addresses.views.inc - Implementation of hook_views_data().
File
- views/
uc_addresses_handler_field_uc_addresses_link_edit.inc, line 13 - Definition of uc_addresses_handler_field_uc_addresses_link_edit.
View source
class uc_addresses_handler_field_uc_addresses_link_edit extends uc_addresses_handler_field_uc_addresses_link {
/**
* Renders the link if the user may edit the address.
*
* @param UcAddressesAddress $address
* An address object.
*
* @return string
* The rendered link, if the current user has access.
*/
function uc_addresses_render_link(UcAddressesAddress $address) {
$address_user = user_load($address
->getUserId());
if (UcAddressesPermissions::canEditAddress($address_user, $address)) {
$uri = $address
->uri();
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = $uri['path'] . '/edit';
$this->options['alter']['query'] = drupal_get_destination();
$text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
return $text;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
uc_addresses_handler_field_uc_addresses_link:: |
function | Overrides views_handler_field#construct(). | ||
uc_addresses_handler_field_uc_addresses_link:: |
function | Implements views_handler_field#options_form(). | ||
uc_addresses_handler_field_uc_addresses_link:: |
function | Implements views_handler_field#option_definition(). | ||
uc_addresses_handler_field_uc_addresses_link:: |
function | Overrides views_handler_field#query(). | ||
uc_addresses_handler_field_uc_addresses_link:: |
function | Implements views_handler_field#render(). | ||
uc_addresses_handler_field_uc_addresses_link_edit:: |
function |
Renders the link if the user may edit the address. Overrides uc_addresses_handler_field_uc_addresses_link:: |