You are here

function _media_23video_settings_form in Media 23video 7

Grouped settings for available file formatters.

Parameters

string $type: Formatter type. Can be the "video", "image" or "titles".

Return value

array Form elements for file formatters.

2 calls to _media_23video_settings_form()
_media_23video_get_settings in ./media_23video.module
Get default values for formatter form elements.
_media_23video_set_settings in ./media_23video.module
Update default values on form elements.

File

./media_23video.module, line 177
23Video service for Media.

Code

function _media_23video_settings_form($type) {
  $elements = array();
  foreach (array(
    'video' => array(
      'maxwidth' => array(
        '#type' => 'textfield',
        '#title' => t('Width'),
        '#default_value' => 480,
      ),
      'maxheight' => array(
        '#type' => 'textfield',
        '#title' => t('Height'),
        '#default_value' => 270,
      ),
      'autoplay' => array(
        '#type' => 'checkbox',
        '#title' => t('Autoplay'),
        '#default_value' => 0,
      ),
    ),
    'image' => array(
      'image_style' => array(
        '#type' => 'select',
        '#title' => t('Image style'),
        '#options' => image_style_options(FALSE),
        '#empty_option' => t('None (original image)'),
        '#default_value' => '',
      ),
    ),
  ) as $formatter => $fields) {
    $elements[$formatter] = $fields;
    $elements['titles'][$formatter] = array(
      '#default_value' => sprintf('%s %s', MEDIA_23VIDEO_MODULE_TITLE, ucfirst($formatter)),
    );
  }
  return empty($elements[$type]) ? $elements : $elements[$type];
}