-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvideo_embed_field.admin.inc
52 lines (46 loc) · 1.33 KB
/
video_embed_field.admin.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* @file
* Form builder; Form for editing a video style.
*
*/
/**
* Video embed style form handler.
*/
function video_embed_field_video_style_form(&$form, &$form_state) {
if (isset($form_state['item'])) {
$style = (array) $form_state['item'];
}
else {
$style = array();
}
$form_state['video_style'] = $style;
// Grab the settings off the parser form.
$values = isset($style['data']) ? $style['data'] : array();
$parser_form = video_embed_field_get_form($values);
// General settings for playback - formerly in the configuration section.
$form['data'] = array(
'#type' => 'vertical_tabs',
'#title' => t('Playback settings'),
'#tree' => TRUE,
) + $parser_form;
return $form;
}
/**
* VEF settings page form callback.
*/
function video_embed_field_settings_form($form, &$form_state) {
$config = config('video_embed_field.settings');
$form['#config'] = 'video_embed_field.settings';
$form['youtube_v3_api_key'] = array(
'#type' => 'textfield',
'#title' => t('Youtube v3 API key'),
'#default_value' => $config->get('youtube_v3_api_key'),
);
$form['video_embed_field_vimeo_access_token'] = array(
'#type' => 'textfield',
'#title' => t('Vimeo app access token'),
'#default_value' => $config->get('vimeo_access_token'),
);
return system_settings_form($form);
}