1 views_handler_field_user_link_edit.inc views_handler_field_user_link_edit::render_link($data, $values)

Overrides views_handler_field_user_link::render_link

File

core/modules/user/views/views_handler_field_user_link_edit.inc, line 13
Definition of views_handler_field_user_link_edit.

Class

views_handler_field_user_link_edit
Field handler to present a link to user edit.

Code

function render_link($data, $values) {
  // Build a pseudo account object to be able to check the access.
  $account = new User();
  $account->uid = $data;

  if ($data && user_edit_access($account)) {
    $this->options['alter']['make_link'] = TRUE;

    $text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');

    $this->options['alter']['path'] = "user/$data/edit";
    $this->options['alter']['query'] = backdrop_get_destination();

    return $text;
  }
}