Same name in other branches
  1. 7.x-1.x fitvids.module \fitvids_form()

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

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

Fichier

./fitvids.module, line 71

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, copy it to the !fitvids-library directory, and rename it to !fitvids-filename.', array(
            '!fitvids-site' => l(t('here'), PLUGIN_URL),
            '!fitvids-library' => libraries_get_path('fitvids'),
            '!fitvids-filename' => 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. It currently supports Vimeo,YouTube, Blip.tv, Viddler, Kickstarter.</p>',
    );
    $form['fitvids_selectors'] = array(
        '#type' => 'textarea',
        '#title' => t('Video containers'),
        '#default_value' => variable_get('fitvids_selectors', 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('You can tell FitVids about your own videos by adding the domain of the player. E.g., "http://www.dailymotion.com". Use a new line for each selector. You don\'t need to add add trailing slashes.'),
    );
    return system_settings_form($form);
}