[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/audio/views/handlers/ -> audio_handler_field_play_link.inc (source)

   1  <?php
   2  
   3  /**
   4   * Show a embedded player for an audio file
   5   */
   6  class audio_handler_field_play_link extends views_handler_field {
   7    function allow_advanced_render() {
   8      return FALSE;
   9    }
  10  
  11    function option_definition() {
  12      $options = parent::option_definition();
  13      $options['text'] = array('default' => 'Play', 'translatable' => TRUE);
  14      return $options;
  15    }
  16  
  17    function options_form(&$form, &$form_state) {
  18      parent::options_form($form, $form_state);
  19      $form['text'] = array(
  20        '#type' => 'textfield',
  21        '#title' => t('Text to display'),
  22        '#default_value' => $this->options['text'],
  23      );
  24    }
  25  
  26    function render($values) {
  27      if (!empty($this->aliases['nid']) && !empty($this->aliases['fid'])) {
  28        if (!empty($values->{$this->aliases['fid']})) {
  29          return l($this->options['text'], 'audio/play/'. $values->{$this->aliases['nid']}, array('absolute' => TRUE));
  30        }
  31      }
  32      return '';
  33    }
  34  }


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