You are here

function fitvids_form in FitVids 7

Same name and namespace in other branches
  1. 6 fitvids.module \fitvids_form()

Configuraton form, called by drupal_get_form() in current_posts_menu().

1 string reference to 'fitvids_form'
fitvids_menu in ./fitvids.module
Implements hook_menu().

File

./fitvids.module, line 75
Includes the FitVids.js jQuery plugin for fluid width video embeds.

Code

function fitvids_form($form, &$form_state) {

  // Is the library installed?
  $path = libraries_get_path('fitvids') . '/jquery.fitvids.js';
  $installed = file_exists($path);
  if (!$installed) {
    $message = t('You need to download the FitVids.js jQuery plugin to use this module. Download it from !fitvids-site and copy it to !fitvids-library/!fitvids-filename.', array(
      '!fitvids-site' => l(t('here'), FITVIDS_PLUGIN_URL),
      '!fitvids-library' => libraries_get_path('fitvids'),
      '!fitvids-filename' => FITVIDS_PLUGIN_FILENAME,
    ));
    drupal_set_message(filter_xss_admin($message), $type = 'warning');
  }
  $form['fitvids_intro'] = array(
    '#markup' => '<p>FitVids is a jQuery plugin for fluid width video embeds. By default, it supports YouTube, Vimeo and Kickstarter.</p>',
  );
  $form['fitvids_selectors'] = array(
    '#type' => 'textarea',
    '#title' => t('Video containers'),
    '#default_value' => variable_get('fitvids_selectors', FITVIDS_DEFAULT_REGIONS),
    '#rows' => 3,
    '#description' => t('Enter some jQuery selectors for your video containers. Use a new line for each selector.'),
    '#required' => TRUE,
  );
  $form['fitvids_customselectors'] = array(
    '#type' => 'textarea',
    '#title' => t('Custom iframe URLs'),
    '#default_value' => variable_get('fitvids_customselectors', ''),
    '#rows' => 3,
    '#description' => t('Only YouTube, Vimeo and Kickstarter are supported by default, but you can tell FitVids about videos from other sites by adding the domain of the player. <br />E.g., "http://www.dailymotion.com". Use a new line for each URL. You don\'t need to add trailing slashes.'),
  );
  $form['fitvids_simplifymarkup'] = array(
    '#type' => 'checkbox',
    '#title' => t('Simplify media_youtube and media_vimeo markup'),
    '#default_value' => variable_get('fitvids_simplifymarkup', TRUE),
    '#description' => t('Older versions of the media_youtube and media_vimeo modules wrap videos in HTML which may stop FitVids working properly. Enable this to remove the unneccesary markup.'),
  );
  return system_settings_form($form);
}