You are here

function brightcove_cck_filter_form_submit in Brightcove Video Connect 6.2

Same name and namespace in other branches
  1. 6 brightcove_cck/brightcove_cck.module \brightcove_cck_filter_form_submit()

Submit callback for brightcove_cck_filter_form().

Set session variables based on selection.

See also

brightcove_cck_browse().

File

brightcove_cck/brightcove_cck.module, line 790
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_filter_form_submit($form, &$form_state) {
  $keywords = $form_state['values']['keywords'];
  $search = $form_state['values']['search'];

  // Reset the form if keywords are empty or reset button was clicked.
  if (empty($keywords) || $form_state['clicked_button']['#name'] == 'reset') {
    unset($_SESSION['brightcove_cck_filter']);
    return;
  }

  // The only thing we do is set session variables based on the selection.
  // Browse callback will take care of the rest.
  $_SESSION['brightcove_cck_filter']['keywords'] = $keywords;
  $_SESSION['brightcove_cck_filter']['search'] = $search;
}