You are here

function theme_video_fields in Video 6

Same name and namespace in other branches
  1. 6.2 video.module \theme_video_fields()

Takes an associative array of $fields with 'title' and 'body' keys and outputs the HTML. This theme function allows the same HTML code to generate all the custom and metadata fields.

Parameters

$fields: array with 'title' and 'body' keys

Return value

string of content to display

2 theme calls to theme_video_fields()
theme_video_customfields in plugins/video_customfields/video_customfields.module
Display custom fields on the view page.
theme_video_metadata in plugins/video_optmetadata/video_optmetadata.module
Display optional metadata (Video and Audio bitrate,..) on the view page.

File

./video.module, line 1112
video.module

Code

function theme_video_fields($fields) {
  $output = '';
  $odd_even = 'odd';
  foreach ($fields as $field) {
    $output .= "<div class=\"{$odd_even}\"><b>" . check_plain($field['title']) . '</b> ' . check_plain($field['body']) . "</div>\n";
    $odd_even = $odd_even == 'odd' ? 'even' : 'odd';

    //Always switch its value.
  }
  return $output;
}