aboutsummaryrefslogtreecommitdiff
path: root/includes/video_views_handler_field_play.inc
blob: 1eac89e4c2f69ece91a70016e9f0975d7a2a3d50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
//$Id$
/**
* Implementation of hook_views_tables
*
* @return
*   array - Enables support in the video module for views integration
 * @author Glen Marianko Twitter@demoforum <glenm at demoforum dot com>
 * @todo
**/

/**
 * Field handler to display the play length of the video.
 *
 * @ingroup views_field_handlers
 */
class video_views_handler_field_play extends views_handler_field {
  /**
   * Render field output to the browser.
   */
  function render($values) {
    return _video_views_handler_field_play($values);
  }
}
/**
* Handler to to render the "Play" link field
**/
function _video_views_handler_field_play($values) {
  if($values->node_type &&  $values->node_type != 'video') return NULL;
  return l(t('Play'), "node/$values->nid/play", array());
}