You are here

function filefieldmp3player_field_formatter_settings_form in MP3 Player 7.2

Implements hook_field_formatter_settings_form().

File

filefieldmp3player/filefieldmp3player.module, line 25

Code

function filefieldmp3player_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

  // get the players
  $options = array();
  $players = mp3player_players();
  foreach ($players as $pid => $player) {
    $options[$pid] = $player['name'];
  }
  $element = array();

  //Add your select box
  $element['player_instance'] = array(
    '#type' => 'select',
    '#title' => t('Player Settings'),
    '#description' => 'Update player settings at ' . l('MP3 Player', 'admin/config/media/mp3player'),
    '#default_value' => $settings['player_instance'],
    '#options' => $options,
  );
  return $element;
}