You are here

function brightcove_cck_upload_form in Brightcove Video Connect 6

Same name and namespace in other branches
  1. 6.2 brightcove_cck/brightcove_cck.module \brightcove_cck_upload_form()

Browse form. Will return a form for one video item.

1 string reference to 'brightcove_cck_upload_form'
brightcove_cck_upload in brightcove_cck/brightcove_cck.browse.inc

File

brightcove_cck/brightcove_cck.module, line 762
Brightcove CCK module provides a Content Construction Kit module to developers, allowing them to browse videos in their Brightcove Studio and upload them.

Code

function brightcove_cck_upload_form(&$form_state) {
  drupal_add_js(drupal_get_path('module', 'brightcove_cck') . '/js/upload.js');
  drupal_add_css(drupal_get_path('module', 'brightcove_cck') . '/styles/upload.css');
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#description' => t('Video name or title.'),
    '#required' => TRUE,
    '#default_value' => $form_state['values']['title'],
  );
  $form['file_upload'] = array(
    '#type' => 'file',
    '#title' => t('Video file'),
    '#size' => 40,
  );
  $form['short'] = array(
    '#type' => 'textarea',
    '#rows' => 3,
    '#required' => TRUE,
    '#title' => t('Short description'),
    '#description' => t('Video short description.'),
    '#default_value' => $form_state['values']['short'],
  );
  $form['advanced'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Advanced attributes'),
  );
  $form['advanced']['tags'] = array(
    '#type' => 'textfield',
    '#title' => t('Tags'),
    '#description' => t('Associated tags, separated by comma.'),
    '#default_value' => $form_state['values']['tags'],
  );
  $form['advanced']['long'] = array(
    '#type' => 'textarea',
    '#rows' => 4,
    '#title' => t('Long description'),
    '#description' => t('Video long description.'),
    '#default_value' => $form_state['values']['long'],
  );
  $form['advanced']['linktext'] = array(
    '#type' => 'textfield',
    '#title' => t('Related link text'),
    '#description' => t('Related link description or text.'),
    '#default_value' => $form_state['values']['linktext'],
  );
  $form['advanced']['linkurl'] = array(
    '#type' => 'textfield',
    '#title' => t('Related link url'),
    '#description' => t('Related link URL.'),
    '#default_value' => $form_state['values']['linkurl'],
  );

  /*  $form['attach'] = array(
      '#type' => 'submit',
      '#value' => t('Upload'),
      '#name' => 'upload',
      '#ahah' => array(
      'path' => 'upload/js',
      'wrapper' => 'attach-wrapper',
      'progress' => array('type' => 'bar', 'message' => t('Please wait...')),
      ),*/
  $form['submit'] = array(
    '#type' => 'submit',
    '#name' => 'submit-' . $item['video_id'],
    '#value' => t('Attach'),
  );
  $form['#attributes'] = array(
    'enctype' => "multipart/form-data",
  );
  $form['#submit'] = array(
    "brightcove_cck_upload_form_submit",
  );
  return $form;
}