You are here

function views_handler_field_comment_link_edit::render in Views (for Drupal 7) 6.2

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field_comment_link::render

File

modules/comment/views_handler_field_comment_link_edit.inc, line 29

Class

views_handler_field_comment_link_edit
Field handler to present a link node edit.

Code

function render($values) {

  // ensure user has access to edit this comment.
  $comment = new stdClass();
  $comment->cid = $values->{$this->aliases['cid']};
  $comment->uid = $values->{$this->aliases['uid']};
  if (!comment_access('edit', $comment)) {
    return;
  }
  $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
  if (!$this->options['destination']) {
    return l($text, "comment/edit/" . $values->{$this->aliases['cid']});
  }
  else {
    return l($text, "comment/edit/" . $values->{$this->aliases['cid']}, array(
      'query' => drupal_get_destination(),
    ));
  }
}