You are here

function brightcove_field_browse in Brightcove Video Connect 7.6

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.4 brightcove_field/brightcove_field.browse.inc \brightcove_field_browse()
  5. 7.5 brightcove_field/brightcove_field.browse.inc \brightcove_field_browse()

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

Parameters

string $entity_type:

string $field_name:

string $entity_id_or_bundle:

Entity $client:

Return value

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

See also

brightcove_field_menu()

1 string reference to 'brightcove_field_browse'
brightcove_menu in ./brightcove.module
Implements hook_menu().

File

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

Code

function brightcove_field_browse($entity_type, $field_name, $entity_id_or_bundle, $client) {
  module_load_include('inc', 'brightcove', 'brightcove_field.video');
  $content = _brightcove_field_video_browse($client);
  $content['filter_form']['css_and_js'] = [
    '#type' => 'container',
    '#attached' => [
      'js' => [
        drupal_get_path('module', 'brightcove') . '/js/brightcove.js',
        ctools_attach_js('ajax-responder'),
      ],
      'css' => [
        drupal_get_path('module', 'brightcove') . '/styles/browse.css',
      ],
    ],
  ];
  return '<div class="brightcove-browse-table">' . drupal_render($content['filter_form']) . $content['pager'] . theme('brightcove_field_browse_items', [
    'items' => $content['items'],
    'entity_type' => $entity_type,
    'field_name' => $field_name,
    'entity_id_or_bundle' => $entity_id_or_bundle,
    'bcid' => $client->bcid,
  ]) . $content['pager'] . '</div>';
}