• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/user/views_handler_field_user_link_cancel.inc

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     // Build a pseudo account object to be able to check the access.
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 }

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1