You are here

function brightcove_field_filter_form in Brightcove Video Connect 7.2

Same name and namespace in other branches
  1. 7.7 brightcove.module \brightcove_field_filter_form()
  2. 7.3 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
  3. 7.4 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
  4. 7.5 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
  5. 7.6 brightcove.module \brightcove_field_filter_form()

Filter form for video browser.

1 string reference to 'brightcove_field_filter_form'
brightcove_field_browse in brightcove_field/brightcove_field.browse.inc
This function is a callback for modalframe window, providing an access to browse videos.

File

brightcove_field/brightcove_field.module, line 971
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 brightcove_field_filter_form($form, &$form_state) {
  $form['search'] = array(
    '#type' => 'fieldset',
    '#title' => t('Filter videos'),
    '#collapsible' => TRUE,
    '#collapsed' => empty($_SESSION['brightcove_field_filter']) ? TRUE : FALSE,
  );
  $keywords = '';
  if (!empty($_SESSION['brightcove_field_filter']['keywords'])) {
    $keywords = $_SESSION['brightcove_field_filter']['keywords'];
  }
  $form['search']['keywords'] = array(
    '#type' => 'textfield',
    '#title' => t('Keywords'),
    '#size' => 25,
    '#default_value' => $keywords,
    '#description' => t('Comma separated keywords to search for.'),
  );
  $form['search']['search'] = array(
    '#type' => 'radios',
    '#title' => t('Search in'),
    '#options' => array(
      'name' => t('Names and descriptions'),
      'tags' => t('Tags: at least one of these'),
      'and_tags' => t('Tags: all of these'),
    ),
    '#default_value' => isset($_SESSION['brightcove_field_filter']['search']) ? $_SESSION['brightcove_field_filter']['search'] : 'name',
    '#attributes' => array(
      'class' => array(
        'search-radio',
      ),
    ),
    '#description' => t('"Names and descriptions" searches in Video name, short and long descriptions. Tags searches in Video associated tags.'),
  );
  $form['search']['submit'] = array(
    '#type' => 'submit',
    '#name' => 'submit',
    '#default_value' => t('Filter'),
  );
  $form['search']['reset'] = array(
    '#type' => 'submit',
    '#name' => 'reset',
    '#default_value' => t('Reset'),
  );
  return $form;
}