views_handler_field_user_link_delete.inc

File

modules/user/views_handler_field_user_link_delete.inc
View source
  1. <?php
  2. /**
  3. * Field handler to present a link to user delete.
  4. */
  5. class views_handler_field_user_link_delete extends views_handler_field_user_link {
  6. // An example of field level access control.
  7. function access() {
  8. return user_access('administer users');
  9. }
  10. function render($values) {
  11. $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
  12. $uid = $values->{$this->aliases['uid']};
  13. return l($text, "user/$uid/delete", array('query' => drupal_get_destination()));
  14. }
  15. }