You are here

function video_embed_field_field_instance_settings_form in Video Embed Field 7

Same name and namespace in other branches
  1. 7.2 video_embed_field.field.inc \video_embed_field_field_instance_settings_form()

Implements hook_field_instance_settings_form().

File

./video_embed_field.module, line 37

Code

function video_embed_field_field_instance_settings_form($field, $instance) {
  $settings = $instance['settings'];
  $form['description_field'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable <em>Description</em> field'),
    '#default_value' => isset($settings['description_field']) ? $settings['description_field'] : '',
    '#description' => t('The description field allows users to enter a description about the video.'),
    '#parents' => array(
      'instance',
      'settings',
      'description_field',
    ),
    '#weight' => 11,
  );

  //Grab the settings off the parser form
  $parser_form = isset($instance['settings']['playback_settings']) ? video_embed_field_get_form($instance['settings']['playback_settings']) : video_embed_field_get_form(array());

  //General settings for playback - formerly in the configuration section
  $form['playback_settings'] = array(
    '#type' => 'vertical_tabs',
    '#title' => t('Playback settings'),
    '#weight' => 15,
  ) + $parser_form;

  //add in our extra settings
  return $form;
}