You are here

function brightcove_field_browse in Brightcove Video Connect 7.4

Same name and namespace in other branches
  1. 7.7 brightcove_field.browse.inc \brightcove_field_browse()
  2. 7.2 brightcove_field/brightcove_field.browse.inc \brightcove_field_browse()
  3. 7.3 brightcove_field/brightcove_field.browse.inc \brightcove_field_browse()
  4. 7.5 brightcove_field/brightcove_field.browse.inc \brightcove_field_browse()
  5. 7.6 brightcove_field.browse.inc \brightcove_field_browse()

This function is a callback for modalframe window, providing an access to browse videos.

Parameters

none:

Return value

A list of available videos that can be attached to a field.

TODO: Allow limiting videos by user (own videos only). TODO: Interesting feature would be to detect multiple values allowed in the parent field and allow attaching all videos at once.

See also

brightcove_field_menu()

1 string reference to 'brightcove_field_browse'
brightcove_field_menu in brightcove_field/brightcove_field.module
Implementation of hook_menu().

File

brightcove_field/brightcove_field.browse.inc, line 21
Holds a method to list all BC videos that are attachable to a field.

Code

function brightcove_field_browse($type) {
  $content = array();
  drupal_add_css(drupal_get_path('module', 'brightcove_field') . '/styles/browse.css');
  drupal_add_js(drupal_get_path('module', 'brightcove_field') . '/js/brightcove.js');
  switch ($type) {
    case 'video':
      module_load_include('inc', 'brightcove_field', 'brightcove_field.video');
      $content = _brightcove_field_video_browse();
      break;
    case 'playlist':
      module_load_include('inc', 'brightcove_field', 'brightcove_field.playlist');
      $content = _brightcove_field_playlist_browse();
      break;
  }
  return '<div class="brightcove-browse-table">' . drupal_render($content['filter_form']) . $content['pager'] . theme('brightcove_field_browse_items', array(
    'items' => $content['items'],
  )) . $content['pager'] . '</div>';
}