function video_view in Video 6.2
Same name and namespace in other branches
- 5 video.module \video_view()
- 6 video.module \video_view()
Implementation of hook_view().
File
- ./
video.module, line 955 - video.module
Code
function video_view(&$node, $teaser = FALSE, $page = FALSE) {
// include the video css file
drupal_add_css(drupal_get_path('module', 'video') . '/video.css');
//Run the body through the standard filters.
$node = node_prepare($node, $teaser);
//print_r($node);
//exit;
// theme the teaser
$node->teaser = theme('video_teaser', $node, $teaser, $page);
// if we are viewing the page, run the body through the theme
if ($page || variable_get('video_in_teaser', FALSE)) {
$output = '';
if (user_access('play video')) {
$node->content['video_player'] = array(
'#value' => theme('video_player', $node),
'#weight' => -1,
);
}
else {
$output .= l(t('login'), "user/login", array(
'class' => 'outgoing',
'title' => t('login to your account'),
));
$output .= ' ' . t('or') . ' ';
$output .= l(t('register'), "user/register", array(
'class' => 'outgoing',
'title' => t('create a new account'),
));
$output .= ' ' . t('to play video');
$node->content['video_player'] = array(
'#value' => $output,
'#weight' => -1,
);
}
}
// print_r($node);
// exit;
return $node;
}