You are here

function ajax_upload_video_dialog_callback in Brightcove Video Connect 7.4

Same name and namespace in other branches
  1. 7.7 brightcove.module \ajax_upload_video_dialog_callback()
  2. 7.3 brightcove_field/brightcove_field.module \ajax_upload_video_dialog_callback()
  3. 7.5 brightcove_field/brightcove_field.module \ajax_upload_video_dialog_callback()
  4. 7.6 brightcove.module \ajax_upload_video_dialog_callback()
1 string reference to 'ajax_upload_video_dialog_callback'
_brightcove_field_video_widget_form in brightcove_field/brightcove_field.video.inc

File

brightcove_field/brightcove_field.module, line 146
Brightcove field module provides a Content Construction Kit module to developers, allowing them to browse videos in their Brightcove Studio and upload them.

Code

function ajax_upload_video_dialog_callback($form, $form_state) {
  $et = $form_state['triggering_element']['#attributes']['data-entity-type'];
  $bundle = $form_state['triggering_element']['#attributes']['data-bundle'];
  $fn = $form_state['triggering_element']['#attributes']['data-field-name'];
  $eid = $form_state['triggering_element']['#attributes']['data-entity-id'];
  $field_rel = $form_state['triggering_element']['#attributes']['rel'];
  $title = 'Upload Video to Brightcove';
  $id = 'upload-dialog';
  $selector = '<div id="' . $id . '">';
  $path = url("brightcove_field/upload");
  $commands = array();
  $commands[] = ajax_command_dialog($title, $id, $selector, $path, $field_rel, NULL, TRUE);
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}