[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/station/schedule/views/ -> station_schedule_handler_field_iid_link.inc (source)

   1  <?php
   2  // $Id: station_schedule_handler_field_iid_link.inc,v 1.2 2009/04/19 21:34:12 drewish Exp $
   3  /**
   4   * Field handler to present a link to the user.
   5   */
   6  class station_schedule_handler_field_iid_link extends views_handler_field {
   7    function construct() {
   8      parent::construct();
   9      $this->additional_fields['iid'] = 'iid';
  10      $this->additional_fields['schedule_nid'] = 'schedule_nid';
  11    }
  12  
  13    function option_definition() {
  14      $options = parent::option_definition();
  15      $options['text'] = array('default' => '', 'translatable' => TRUE);
  16      return $options;
  17    }
  18  
  19    function options_form(&$form, &$form_state) {
  20      parent::options_form($form, $form_state);
  21      $form['text'] = array(
  22        '#type' => 'textfield',
  23        '#title' => t('Text to display'),
  24        '#default_value' => $this->options['text'],
  25      );
  26    }
  27  
  28    function access() {
  29  // @TODO figure out a more granular way to handle permissions here.
  30      return user_access('administer station schedule');
  31    }
  32  
  33    function query() {
  34      $this->ensure_my_table();
  35      $this->add_additional_fields();
  36    }
  37  
  38    function render($values) {
  39      return '';
  40  
  41      $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
  42      $uid = $values->{$this->aliases['uid']};
  43      return l($text, "user/$uid");
  44    }
  45  }
  46  


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7