You are here

function mp3player_settings in MP3 Player 6

Same name and namespace in other branches
  1. 6.2 mp3player.module \mp3player_settings()

Form to add a new player.

1 string reference to 'mp3player_settings'
mp3player_menu in ./mp3player.module
Implementation of hook_menu().

File

./mp3player.module, line 147
mp3player main module file.

Code

function mp3player_settings() {
  if (user_access('administer mp3player')) {
    $form['mp3player_library_path'] = array(
      '#type' => 'textfield',
      '#title' => t('Path to mp3 library'),
      '#default_value' => variable_get('mp3player_library_path', drupal_get_path('module', 'mp3player') . '/mp3player'),
      '#description' => t("This Player requires the <a href='!mp3_url'>standalone WordPress Audio Player</a>, enter the directory where the two required files can be found, by default this is set to sites/all/modules/mp3player/mp3player", array(
        '!mp3_url' => 'http://wpaudioplayer.com/download',
      )),
    );
    $form['mp3player_encode'] = array(
      '#type' => 'select',
      '#title' => t('Encode Audio File URLs'),
      '#default_value' => variable_get('mp3player_encode', 'no'),
      '#options' => array(
        'no' => t('No'),
        'yes' => t('Yes'),
      ),
      '#description' => t('Indicates that the mp3 file urls are encoded.'),
    );
    $form['mp3player_suppress'] = array(
      '#type' => 'select',
      '#title' => t('Suppress cache messages'),
      '#default_value' => variable_get('mp3player_suppress', 'no'),
      '#options' => array(
        'no' => t('No'),
        'yes' => t('Yes'),
      ),
      '#description' => t('Suppress all messages about the MP3 Player cache being rebuilt.'),
    );
    if (module_exists('filefieldmp3player')) {
      $form['mp3player_description'] = array(
        '#type' => 'select',
        '#title' => t('FileField Description Value'),
        '#default_value' => variable_get('mp3player_description', 'description'),
        '#options' => array(
          'description' => t('Description'),
          'id3' => t('ID3 Template'),
        ),
        '#description' => t('Either use default description field or ID3 template file.'),
      );
    }
    $form['#submit'][] = 'mp3player_settings_submit';
    return system_settings_form($form);
  }
}