You are here

function party_handler_field_delete_link::render in Party 8.2

Same name and namespace in other branches
  1. 7 includes/views/party_handler_field_delete_link.inc \party_handler_field_delete_link::render()

File

includes/views/party_handler_field_delete_link.inc, line 39
Contains a Views field handler to take care of displaying deletes links as fields

Class

party_handler_field_delete_link
@file Contains a Views field handler to take care of displaying deletes links as fields

Code

function render($values) {
  $type = $values->{$this->aliases['type']};

  //Creating a dummy party to check access against
  $dummy_party = (object) array(
    'type' => $type,
  );
  if (!party_access('delete', $dummy_party)) {
    return;
  }
  $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
  $party_id = $values->{$this->aliases['pid']};
  return l($text, 'party/' . $party_id . '/party/delete', array(
    'query' => array(
      'destination' => $_GET['q'],
    ),
  ));
}