You are here

public function CodropsResponsiveMulti::settingsForm in Responsive Menus 8

Form constructor.

Parameters

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

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

Return value

array The form structure.

Overrides ResponsiveMenusPluginBase::settingsForm

File

src/Plugin/ResponsiveMenus/CodropsResponsiveMulti.php, line 46

Class

CodropsResponsiveMulti
Defines the "codrops_responsive_multi" plugin.

Namespace

Drupal\responsive_menus\Plugin\ResponsiveMenus

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['responsive_menus_codrops_responsive_multi_css_selectors'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('CSS selectors for which menu to responsify'),
    '#default_value' => $this
      ->getSetting('responsive_menus_codrops_responsive_multi_css_selectors'),
    '#description' => $this
      ->t('Enter CSS/jQuery selector of menus to responsify.'),
  ];
  $form['responsive_menus_codrops_responsive_multi_media_size'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Screen width to respond to'),
    '#size' => 5,
    '#default_value' => $this
      ->getSetting('responsive_menus_codrops_responsive_multi_media_size'),
    '#description' => $this
      ->t('Width in pixels when we swap out responsive menu e.g. 768'),
  ];
  $form['responsive_menus_codrops_responsive_multi_ani_in'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('In-animation'),
    '#options' => [
      'dl-animate-in-1' => $this
        ->t('One'),
      'dl-animate-in-2' => $this
        ->t('Two'),
      'dl-animate-in-3' => $this
        ->t('Three'),
      'dl-animate-in-4' => $this
        ->t('Four'),
      'dl-animate-in-5' => $this
        ->t('Five'),
    ],
    '#default_value' => $this
      ->getSetting('responsive_menus_codrops_responsive_multi_ani_in'),
  ];
  $form['responsive_menus_codrops_responsive_multi_ani_out'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Out-animation'),
    '#options' => [
      'dl-animate-out-1' => $this
        ->t('One'),
      'dl-animate-out-2' => $this
        ->t('Two'),
      'dl-animate-out-3' => $this
        ->t('Three'),
      'dl-animate-out-4' => $this
        ->t('Four'),
      'dl-animate-out-5' => $this
        ->t('Five'),
    ],
    '#default_value' => $this
      ->getSetting('responsive_menus_codrops_responsive_multi_ani_out'),
  ];
  return $form;
}