You are here

function mediafront_form_views_ui_config_item_form_alter in MediaFront 7.2

Allow them to say which field they would like to use for certain MediaFront player fields.

_state

Parameters

type $form:

File

views/mediafront.views.inc, line 42
mediafront.views.inc Built in plugins for Views output handling.

Code

function mediafront_form_views_ui_config_item_form_alter(&$form, &$form_state) {

  // Get the options for this field from the field handler.
  $options = mediafront_views_get_options($form_state['handler']);

  // Setup the mediafront settings for this field.
  $form['options']['mediafront'] = array(
    '#type' => 'fieldset',
    '#title' => 'MediaFront Settings',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  // Add a link to player check.
  $form['options']['mediafront']['link_to_player'] = array(
    '#type' => 'checkbox',
    '#title' => t('Link to Player'),
    '#description' => t('Check if you would like for this field to dynamically link to the MediaFront player attached to this view.'),
    '#default_value' => !empty($options['link_to_player']),
  );

  // Add the field select form.
  $form['options']['mediafront'] = array_merge($form['options']['mediafront'], mediafront_field_form($options, 'edit-options-mediafront-'));

  // Prepend our own submit handler.
  array_unshift($form['buttons']['submit']['#submit'], 'mediafront_form_views_ui_config_item_form_submit');
}