You are here

public function FitvidsAdminSettingsForm::buildForm in FitVids 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/FitvidsAdminSettingsForm.php, line 33

Class

FitvidsAdminSettingsForm
Configure Fitvids settings for this site.

Namespace

Drupal\fitvids\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('fitvids.settings');
  $form['fitvids_intro'] = [
    '#markup' => '<p>FitVids is a jQuery plugin for fluid width video embeds. By default, it supports YouTube, Vimeo and Kickstarter.</p>',
  ];
  $form['fitvids_selectors'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Video containers'),
    '#default_value' => $config
      ->get('selectors'),
    '#rows' => 3,
    '#description' => $this
      ->t('Enter some jQuery selectors for your video containers. Use a new line for each selector.'),
    '#required' => TRUE,
  ];
  $form['fitvids_custom_vendors'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Additional video providers'),
    '#default_value' => $config
      ->get('custom_vendors'),
    '#rows' => 3,
    '#description' => $this
      ->t('YouTube, Vimeo, Blip.tv, Viddler and Kickstarter are supported by default. Tell FitVids about videos from other sites by adding the domain of the player. Use a new line for each URL. Don\'t add trailing slashes.<br />E.g., "http://www.dailymotion.com".'),
  ];
  $form['fitvids_ignore_selectors'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Ignore these videos'),
    '#default_value' => $config
      ->get('ignore_selectors'),
    '#rows' => 3,
    '#description' => $this
      ->t('Enter some jQuery selectors for any videos or containers that you want to ignore. Use a new line for each selector.'),
  ];
  return parent::buildForm($form, $form_state);
}