function brightcove_field_filter_form in Brightcove Video Connect 7.6
Same name and namespace in other branches
- 7.7 brightcove.module \brightcove_field_filter_form()
- 7.2 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
- 7.3 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
- 7.4 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
- 7.5 brightcove_field/brightcove_field.module \brightcove_field_filter_form()
Filter form for video browser.
1 string reference to 'brightcove_field_filter_form'
- _brightcove_field_video_browse in ./
brightcove_field.video.inc - Video browser form.
File
- ./
brightcove.module, line 1301 - Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.
Code
function brightcove_field_filter_form($form, &$form_state, $client) {
$form['search'] = [
'#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'] = [
'#type' => 'textfield',
'#title' => t('Keywords'),
'#size' => 25,
'#default_value' => $keywords,
'#description' => t('Comma separated keywords to search for.'),
];
$form['search']['search'] = [
'#type' => 'radios',
'#title' => t('Search in'),
'#options' => [
'everything' => t('Search in everything'),
'tags' => t('Tags: at least one of these'),
],
'#default_value' => isset($_SESSION['brightcove_field_filter']['search']) ? $_SESSION['brightcove_field_filter']['search'] : 'everything',
'#attributes' => [
'class' => [
'search-radio',
],
],
'#description' => t('"Names and descriptions" searches in Video name, short and long descriptions. Tags searches in Video associated tags.'),
];
$form['search']['submit'] = [
'#type' => 'submit',
'#name' => 'submit',
'#attributes' => [
'id' => 'filter-submit',
],
'#default_value' => t('Filter'),
];
$form['search']['reset'] = [
'#type' => 'submit',
'#name' => 'reset',
'#default_value' => t('Reset'),
];
$form['#submit'] = [
'brightcove_field_filter_form_submit',
];
return $form;
}