You are here

function emvideo_vimeo_settings in Embedded Media Field 6.3

Same name and namespace in other branches
  1. 6 contrib/emvideo/providers/vimeo.inc \emvideo_vimeo_settings()

hook emvideo_PROVIDER_settings this should return a subform to be added to the emvideo_settings() admin settings page. note that a form field will already be provided, at $form['PROVIDER'] (such as $form['vimeo']) so if you want specific provider settings within that field, you can add the elements to that form field.

File

contrib/emvideo/providers/vimeo.inc, line 44
Provide support for the Vimeo provider to the emfield.module.

Code

function emvideo_vimeo_settings() {
  $form['vimeo']['color'] = array(
    '#type' => 'fieldset',
    '#title' => t('Embedded video player color'),
    '#description' => t('If allowed, this color, in hexidecimal form (#RRGGBB), will be used to change the skin of the Vimeo player.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['vimeo']['color']['emvideo_vimeo_color_override'] = array(
    '#type' => 'checkbox',
    '#title' => t('Override player color'),
    '#default_value' => variable_get('emvideo_vimeo_color_override', FALSE),
  );
  $form['vimeo']['color']['emvideo_vimeo_color'] = array(
    '#type' => 'textfield',
    '#title' => t('Color'),
    '#default_value' => variable_get('emvideo_vimeo_color', EMVIDEO_VIMEO_COLOR_DEFAULT),
  );
  $form['vimeo']['player_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Embedded video player options'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['vimeo']['player_options']['emvideo_vimeo_on_screen_info'] = array(
    '#type' => 'checkboxes',
    '#title' => t('On-screen info'),
    '#default_value' => variable_get('emvideo_vimeo_on_screen_info', array(
      'portrait',
      'title',
      'byline',
    )),
    '#options' => array(
      'portrait' => t("Show video author's portrait"),
      'title' => t('Show video title'),
      'byline' => t('Show byline'),
    ),
    '#description' => t('Provide additional video information on the Vimeo player.'),
  );
  $form['vimeo']['player_options']['emvideo_vimeo_full_screen'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow fullscreen'),
    '#default_value' => variable_get('emvideo_vimeo_full_screen', 1),
    '#description' => t('Allow users to view video using the entire computer screen.'),
  );
  $form['vimeo']['emvideo_vimeo_api_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Vimeo API Key'),
    '#default_value' => variable_get('emvideo_vimeo_api_key', ''),
  );
  $form['vimeo']['emvideo_vimeo_api_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('Vimeo API Shared Secret'),
    '#default_value' => variable_get('emvideo_vimeo_api_secret', ''),
  );
  $form['vimeo']['emvideo_vimeo_thumb_size'] = array(
    '#type' => 'select',
    '#title' => t('Vimeo Thumbnail Size'),
    '#options' => array(
      '96' => '96',
      '100' => '100',
      '160' => '160',
      '200' => '200',
      '460' => '460',
    ),
    '#default_value' => variable_get('emvideo_vimeo_thumb_size', '160'),
  );
  return $form;
}