function media_youtube_settings_form in Media: YouTube 7.2
Settings form.
Added to configure YouTube API KEY
1 string reference to 'media_youtube_settings_form'
- media_youtube_menu in ./
media_youtube.module - Implements hook_menu().
File
- ./
media_youtube.module, line 464 - Provides a stream wrapper and formatters appropriate for accessing and displaying YouTube videos.
Code
function media_youtube_settings_form($form, &$form_state) {
$form['media_youtube_api_url'] = array(
'#type' => 'textfield',
'#title' => t('YouTube API Url'),
'#description' => t('YouTube API Url'),
'#default_value' => variable_get('media_youtube_api_url', ''),
);
$form['media_youtube_api_key'] = array(
'#type' => 'textfield',
'#title' => t('API key'),
'#description' => t('The Google API key has to be requested from the Google website. A Google account is needed too. See https://developers.google.com/youtube/v3/getting-started'),
'#default_value' => variable_get('media_youtube_api_key', ''),
);
$form['media_youtube_max_results'] = array(
'#type' => 'textfield',
'#title' => t('Maximum search results to display in media browser'),
'#description' => t('The <em>maxResults</em> parameter specifies the maximum number of items that should be returned in the result set. Acceptable values are 1 to 50, inclusive.'),
'#default_value' => variable_get('media_youtube_max_results', 5),
);
$form = system_settings_form($form);
return $form;
}