function soundcloudfield_field_formatter_settings_form in SoundCloud field 7
Implements hook_field_formatter_settings_form().
File
- ./
soundcloudfield.module, line 255 - @author Attila Fekete - http://drupal.org/user/762986
Code
function soundcloudfield_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
// This gets the view_mode where our settings are stored.
$display = $instance['display'][$view_mode];
// This gets the actual settings.
$settings = $display['settings'];
// Initialize the element variable.
$element = array();
// Add select box, for HTML5 only.
if (strpos($display['type'], '_html5') !== FALSE) {
$element['player_type'] = array(
'#type' => 'select',
'#title' => t('HTML5 player type'),
'#description' => t('Select which HTML5 player to use.'),
'#default_value' => $settings['player_type'],
'#options' => array(
'classic' => 'Classic (old)',
'visual' => 'Visual Player (new)',
),
);
}
return $element;
}