You are here

function mediafront_preset_create_form in MediaFront 7

Same name and namespace in other branches
  1. 6.2 includes/mediafront.preset.inc \mediafront_preset_create_form()
  2. 6 includes/mediafront.preset.inc \mediafront_preset_create_form()
  3. 7.2 includes/mediafront.preset.inc \mediafront_preset_create_form()

Form builder; the create preset form.

1 string reference to 'mediafront_preset_create_form'
mediafront_preset_menu in includes/mediafront.preset.inc
Implement the menu system for the preset.

File

includes/mediafront.preset.inc, line 335

Code

function mediafront_preset_create_form($form, &$form_state) {
  $form['preset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Preset Information'),
    '#weight' => -10,
  );
  $form['preset']['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Preset Name'),
    '#maxlength' => MEDIAFRONT_PRESET_MAX_LENGTH,
    '#description' => t('Spaces are NOT allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.'),
    '#required' => TRUE,
    '#weight' => -10,
  );
  $form['preset']['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#description' => t('Add a brief description to your preset name.'),
    '#weight' => -9,
  );

  // Get all of the available players.
  $players = mediafront_get_players();
  $options = array();
  foreach ($players as $name => $player) {
    $options[$name] = $player['title'];
  }
  $form['preset']['player'] = array(
    '#type' => 'select',
    '#title' => t('Media Player'),
    '#description' => t('Select which player you would like to use for this preset.'),
    '#options' => $options,
    '#default_value' => 'osmplayer',
    '#weight' => -8,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
    '#weight' => 30,
  );

  // Add the form submit handler.
  $form['#submit'][] = 'mediafront_create_preset_submit';
  $form['#validate'][] = 'mediafront_create_preset_validate';
  return $form;
}