00001 <?php
00007 class views_handler_field_user_link_cancel extends views_handler_field_user_link {
00008
00009 function render_link($data, $values) {
00010 $uid = $values->{$this->aliases['uid']};
00011
00012
00013 $account = new stdClass();
00014 $account->uid = $uid;
00015
00016 if ($uid && user_cancel_access($account)) {
00017 $this->options['alter']['make_link'] = TRUE;
00018
00019 $text = !empty($this->options['text']) ? $this->options['text'] : t('cancel');
00020
00021 $this->options['alter']['path'] = "user/$uid/cancel";
00022 $this->options['alter']['query'] = drupal_get_destination();
00023
00024 return $text;
00025 }
00026 }
00027 }