You are here

maillog_handler_field_maillog_link_delete.inc in Maillog / Mail Developer 6

Handler for providing an 'Delete link' in views

File

includes/maillog_handler_field_maillog_link_delete.inc
View source
<?php

/**
 * @file
 * Handler for providing an 'Delete link' in views
 */
class maillog_handler_field_maillog_link_delete extends views_handler_field {
  function construct() {
    parent::construct();
    $this->additional_fields['idmaillog'] = 'idmaillog';
  }

  /**
   * Called to add the field to a query.
   */
  function query() {
    $this
      ->ensure_my_table();
    $this
      ->add_additional_fields();
  }
  function render($values) {

    // ensure user has access to edit this node.
    if (!user_access('delete maillog')) {
      return;
    }
    $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
    return l($text, "maillog/delete/{$values->idmaillog}", array(
      'query' => drupal_get_destination(),
    ));
  }

}

Classes

Namesort descending Description
maillog_handler_field_maillog_link_delete @file Handler for providing an 'Delete link' in views