You are here

function video_filter_get_classes in Video Filter 6.3

Same name and namespace in other branches
  1. 7.3 video_filter.module \video_filter_get_classes()

Helper function that extracts some classes from $video.

2 calls to video_filter_get_classes()
theme_video_filter_flash in ./video_filter.module
Function that outputs the <object> element.
theme_video_filter_iframe in ./video_filter.module
Function that outputs HTML5 compatible iFrame for codecs that support it.

File

./video_filter.module, line 598

Code

function video_filter_get_classes($video) {
  $classes = array(
    'video-filter',
    // Adds codec name.
    'video-' . $video['codec']['codec_name'],
  );

  // Adds alignment.
  if (isset($video['align'])) {
    $classes[] = 'video-' . $video['align'];
  }

  // First match is the URL, we don't want that as a class.
  unset($video['codec']['matches'][0]);
  foreach ($video['codec']['matches'] as $match) {
    $classes[] = 'vf-' . strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $match));
  }
  return $classes;
}