function theme_flowplayer in Flowplayer API 7
Same name and namespace in other branches
- 5 flowplayer.module \theme_flowplayer()
 - 6 flowplayer.module \theme_flowplayer()
 - 7.2 flowplayer.module \theme_flowplayer()
 
Creates the markup and adds the JavaScript to display a media file in
Parameters
$config: (optional) Can either be a string representing the media to load, or an array of arguments containing the options provided on this page: http://flowplayer.org/documentation/configuration.html
$id: (optional) The ID of the DIV element to use.
$attributes: (optional) Any additional attributes to associate with the DIV.
2 theme calls to theme_flowplayer()
- flowplayer_admin_settings in ./
flowplayer.admin.inc  - Administration settings for the Flowplayer Drupal module.
 - flowplayer_help in ./
flowplayer.module  - Implementation of hook_help().
 
File
- ./
flowplayer.module, line 222  - Provides integration with FlowPlayer.
 
Code
function theme_flowplayer($variables) {
  $config = $variables['config'];
  $id = $variables['id'];
  $attributes = $variables['attributes'];
  // Prepare the ID.
  $id = drupal_clean_css_identifier($id);
  // Prepare the attributes, passing in the flowplayer class.
  if (isset($attributes['class'])) {
    $attributes['class'] .= ' flowplayer';
  }
  else {
    $attributes['class'] = 'flowplayer';
  }
  $attributes = drupal_attributes($attributes);
  // Add the JavaScript to handle the element.
  flowplayer_add('#' . $id, $config);
  // Return the markup.
  return "<div id='{$id}' {$attributes}></div>";
}