You are here

public function SuperfishBlock::blockForm in Superfish 8

Overrides \Drupal\block\BlockBase::blockForm().

Overrides SystemMenuBlock::blockForm

File

src/Plugin/Block/SuperfishBlock.php, line 68

Class

SuperfishBlock
Provides a "Superfish" block.

Namespace

Drupal\superfish\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $defaults = $this
    ->defaultConfiguration();
  $form['sf'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Block settings'),
    '#open' => TRUE,
  ];
  $description = sprintf('<em>(%s: %s)</em>', $this
    ->t('Default'), $this
    ->t('Horizontal (single row)'));
  $form['sf']['superfish_type'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Menu type'),
    '#description' => $description,
    '#default_value' => $this->configuration['menu_type'],
    '#options' => [
      'horizontal' => $this
        ->t('Horizontal (single row)'),
      'navbar' => $this
        ->t('Horizontal (double row)'),
      'vertical' => $this
        ->t('Vertical (stack)'),
    ],
  ];
  $description = sprintf('<em>(%s: %s)</em>', $this
    ->t('Default'), $this
    ->t('None'));
  $form['sf']['superfish_style'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Style'),
    '#description' => $description,
    '#default_value' => $this->configuration['style'],
    '#options' => [
      'none' => $this
        ->t('None'),
      'default' => $this
        ->t('Default'),
      'black' => $this
        ->t('Black'),
      'blue' => $this
        ->t('Blue'),
      'coffee' => $this
        ->t('Coffee'),
      'white' => $this
        ->t('White'),
    ],
  ];
  $form['sf']['superfish_arrow'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Add arrows to parent menus'),
    '#default_value' => $this->configuration['arrow'],
  ];
  $form['sf']['superfish_shadow'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Drop shadows'),
    '#default_value' => $this->configuration['shadow'],
  ];
  if (count(superfish_effects()) == 4) {
    $easing_instructions = $this
      ->t('jQuery Easing plugin is not installed.');
  }
  else {
    $easing_instructions = $this
      ->t("The plugin provides a handful number of animation effects, they can be used by uploading the 'jquery.easing.js' file to the libraries directory within the 'easing' directory (for example: libraries/easing/jquery.easing.js). Refresh this page after the plugin is uploaded, this will make more effects available in the above list.");
  }
  $description = sprintf('<em>(%s: %s)</em><br>%s<br>', $this
    ->t('Default'), $this
    ->t('Vertical'), $easing_instructions);
  $form['sf']['superfish_slide'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Slide-in effect'),
    '#description' => $description,
    '#default_value' => $this->configuration['slide'],
    '#options' => superfish_effects(),
  ];
  $form['sf-plugins'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Superfish plugins'),
    '#open' => TRUE,
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Relocates sub-menus when they would otherwise appear outside the browser window area.'), $this
    ->t('Default'), $this
    ->t('enabled'));
  $form['sf-plugins']['superfish_supposition'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('jQuery Supposition'),
    '#description' => $description,
    '#default_value' => $this->configuration['supposition'],
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t("Prevents accidental firing of animations by waiting until the user's mouse slows down enough, hence determinig user's <em>intent</em>."), $this
    ->t('Default'), $this
    ->t('enabled'));
  $form['sf-plugins']['superfish_hoverintent'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('jQuery hoverIntent'),
    '#description' => $description,
    '#default_value' => $this->configuration['hoverintent'],
  ];
  $description = sprintf('%s <em>(%s)</em>', $this
    ->t('<strong>sf-Touchscreen</strong> provides touchscreen compatibility.'), $this
    ->t('The first click on a parent hyperlink shows its children and the second click opens the hyperlink.'));
  $form['sf-plugins']['sf-touchscreen'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('sf-Touchscreen'),
    '#description' => $description,
    '#open' => FALSE,
  ];
  $default = sprintf('%s <em>(%s)</em>', $this
    ->t('Disable'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-touchscreen']['superfish_touch'] = [
    '#type' => 'radios',
    '#default_value' => $this->configuration['touch'],
    '#options' => [
      0 => $default,
      1 => $this
        ->t('Enable jQuery sf-Touchscreen plugin for this menu.'),
      2 => $this
        ->t("Enable jQuery sf-Touchscreen plugin for this menu depending on the user's Web browser <strong>window width</strong>."),
      3 => $this
        ->t("Enable jQuery sf-Touchscreen plugin for this menu depending on the user's Web browser <strong>user agent</strong>."),
    ],
  ];
  $default = sprintf('%s <em>(%s)</em>', $this
    ->t('Hiding the sub-menu on the second tap, adding cloned parent links to the top of sub-menus as well.'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-touchscreen']['superfish_touchbh'] = [
    '#type' => 'radios',
    '#title' => 'Select a behaviour',
    '#description' => $this
      ->t('Using this plugin, the first click or tap will expand the sub-menu, here you can choose what a second click or tap should do.'),
    '#default_value' => $this->configuration['touchbh'],
    '#options' => [
      0 => $this
        ->t('Opening the parent menu item link on the second tap.'),
      1 => $this
        ->t('Hiding the sub-menu on the second tap.'),
      2 => $default,
    ],
  ];
  $description = sprintf('%s<br><br>%s<br><code>&lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;</code>', $this
    ->t("sf-Touchscreen will be enabled only if the width of user's Web browser window is smaller than the below value."), $this
    ->t('Please note that in most cases such a meta tag is necessary for this feature to work properly:'));
  $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Window width settings'),
    '#description' => $description,
    '#open' => TRUE,
  ];
  $description = sprintf('%s <em>(%s: 768)</em>', $this
    ->t('Also known as "Breakpoint".'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth']['superfish_touchbp'] = [
    '#type' => 'number',
    '#description' => $description,
    '#default_value' => $this->configuration['touchbp'],
    '#field_suffix' => $this
      ->t('pixels'),
    '#size' => 10,
  ];
  $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('User agent settings'),
    '#open' => TRUE,
  ];
  $default = sprintf('%s <em>(%s) (%s)</em>', $this
    ->t('Use the pre-defined list of the <strong>user agents</strong>.'), $this
    ->t('Default'), $this
    ->t('Recommended'));
  $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchua'] = [
    '#type' => 'radios',
    '#default_value' => $this->configuration['touchua'],
    '#options' => [
      0 => $default,
      1 => $this
        ->t('Use the custom list of the <strong>user agents</strong>.'),
    ],
  ];
  if (isset($_SERVER['HTTP_USER_AGENT'])) {
    $user_agent = sprintf('<br><strong>%s</strong> %s', $this
      ->t('UA string of the current Web browser:'), $_SERVER['HTTP_USER_AGENT']);
  }
  else {
    $user_agent = '';
  }
  $description = sprintf('%s <em>(%s: %s)</em><br>%s:<ul>
    <li>iPhone*Android*iPad <em><sup>(%s)</sup></em></li>
    <li>Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2
    (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.0 * Mozilla/5.0
    (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10
    (KHTML, like Gecko) Mobile/7B405</li>
    </ul>%s', $this
    ->t('Could be partial or complete. (Asterisk separated)'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Examples'), $this
    ->t('Recommended'), $user_agent);
  $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchual'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Custom list of the user agents'),
    '#description' => $description,
    '#default_value' => $this->configuration['touchual'],
    '#size' => 100,
    '#maxlength' => 2000,
  ];
  $description = sprintf('<em>(%s: %s)</em>', $this
    ->t('Default'), $this
    ->t('Client-side (JavaScript)'));
  $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchuam'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('<strong>User agent</strong> detection method'),
    '#description' => $description,
    '#default_value' => $this->configuration['touchuam'],
    '#options' => [
      0 => $this
        ->t('Client-side (JavaScript)'),
      1 => $this
        ->t('Server-side (PHP)'),
    ],
  ];
  $form['sf-plugins']['sf-smallscreen'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('sf-Smallscreen'),
    '#description' => $this
      ->t('<strong>sf-Smallscreen</strong> provides small-screen compatibility for your menus.'),
    '#open' => FALSE,
  ];
  $default = sprintf('%s <em>(%s)</em>', $this
    ->t("Enable jQuery sf-Smallscreen plugin for this menu depending on the user's Web browser <strong>window width</strong>."), $this
    ->t('Default'));
  $form['sf-plugins']['sf-smallscreen']['superfish_small'] = [
    '#type' => 'radios',
    '#default_value' => $this->configuration['small'],
    '#options' => [
      0 => sprintf('%s.', $this
        ->t('Disable')),
      1 => $this
        ->t('Enable jQuery sf-Smallscreen plugin for this menu.'),
      2 => $default,
      3 => $this
        ->t("Enable jQuery sf-Smallscreen plugin for this menu depending on the user's Web browser <strong>user agent</strong>."),
    ],
  ];
  $description = sprintf('%s<br><br>%s<br><code>&lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;</code>', $this
    ->t("sf-Smallscreen will be enabled only if the width of user's Web browser window is smaller than the below value."), $this
    ->t('Please note that in most cases such a meta tag is necessary for this feature to work properly:'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Window width settings'),
    '#description' => $description,
    '#open' => TRUE,
  ];
  $description = sprintf('%s <em>(%s: 768)</em>', $this
    ->t('Also known as "Breakpoint".'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth']['superfish_smallbp'] = [
    '#type' => 'number',
    '#description' => $description,
    '#default_value' => $this->configuration['smallbp'],
    '#field_suffix' => $this
      ->t('pixels'),
    '#size' => 10,
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('User agent settings'),
    '#open' => TRUE,
  ];
  $default = sprintf('%s <em>(%s) (%s)</em>', $this
    ->t('Use the pre-defined list of the <strong>user agents</strong>.'), $this
    ->t('Default'), $this
    ->t('Recommended'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smallua'] = [
    '#type' => 'radios',
    '#default_value' => $this->configuration['smallua'],
    '#options' => [
      0 => $default,
      1 => $this
        ->t('Use the custom list of the <strong>user agents</strong>.'),
    ],
  ];
  if (isset($_SERVER['HTTP_USER_AGENT'])) {
    $user_agent = sprintf('<br><strong>%s</strong> %s', $this
      ->t('UA string of the current Web browser:'), $_SERVER['HTTP_USER_AGENT']);
  }
  else {
    $user_agent = '';
  }
  $description = sprintf('%s <em>(%s: %s)</em><br>%s:<ul>
    <li>iPhone*Android*iPad <em><sup>(%s)</sup></em></li>
    <li>Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2
    (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.0 * Mozilla/5.0
    (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10
    (KHTML, like Gecko) Mobile/7B405</li>
    </ul>%s', $this
    ->t('Could be partial or complete. (Asterisk separated)'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Examples'), $this
    ->t('Recommended'), $user_agent);
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smallual'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Custom list of the user agents'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallual'],
    '#size' => 100,
    '#maxlength' => 2000,
  ];
  $description = sprintf('<em>(%s: %s)</em>', $this
    ->t('Default'), $this
    ->t('Client-side (JavaScript)'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smalluam'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('<strong>User agent</strong> detection method'),
    '#description' => $description,
    '#default_value' => $this->configuration['smalluam'],
    '#options' => [
      0 => $this
        ->t('Client-side (JavaScript)'),
      1 => $this
        ->t('Server-side (PHP)'),
    ],
  ];
  $default = sprintf('%s <em>(%s)</em>', $this
    ->t('Convert the menu to an accordion menu.'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-smallscreen']['superfish_smallact'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Select a type'),
    '#default_value' => $this->configuration['smallact'],
    '#options' => [
      1 => $default,
      0 => $this
        ->t('Convert the menu to a &lt;select&gt; element.'),
    ],
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('&lt;select&gt; settings'),
    '#open' => FALSE,
  ];
  $description = sprintf('%s <em>(%s: %s)</em><br>%s: <em> - %s - </em>', $this
    ->t('By default the first item in the &lt;select&gt; element will be the name of the parent menu or the title of this block, you can change this by setting a custom title.'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Example'), $this
    ->t('Main Menu'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['superfish_smallset'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('&lt;select&gt; title'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallset'],
    '#size' => 50,
    '#maxlength' => 500,
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['superfish_smallasa'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Add <em>selected</em> attribute to the &lt;option&gt; element with the class <strong>active</strong> .'),
    '#description' => $this
      ->t('Makes pre-selected the item linked to the active page when the page loads.'),
    '#default_value' => $this->configuration['smallasa'],
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('More'),
    '#open' => FALSE,
  ];
  $title = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Copy the main &lt;ul&gt; classes to the &lt;select&gt;.'), $this
    ->t('Default'), $this
    ->t('disabled'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallcmc'] = [
    '#type' => 'checkbox',
    '#title' => $title,
    '#default_value' => $this->configuration['smallcmc'],
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Comma separated'), $this
    ->t('Default'), $this
    ->t('empty'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallecm'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Exclude these classes from the &lt;select&gt; element'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallecm'],
    '#size' => 100,
    '#maxlength' => 1000,
    '#states' => [
      'enabled' => [
        ':input[name="superfish_smallcmc"]' => [
          'checked' => TRUE,
        ],
      ],
    ],
  ];
  $title = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Copy the hyperlink classes to the &lt;option&gt; elements of the &lt;select&gt;.'), $this
    ->t('Default'), $this
    ->t('disabled'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallchc'] = [
    '#type' => 'checkbox',
    '#title' => $title,
    '#default_value' => $this->configuration['smallchc'],
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Comma separated'), $this
    ->t('Default'), $this
    ->t('empty'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallech'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Exclude these classes from the &lt;option&gt; elements of the &lt;select&gt;'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallech'],
    '#size' => 100,
    '#maxlength' => 1000,
    '#states' => [
      'enabled' => [
        ':input[name="superfish_smallchc"]' => [
          'checked' => TRUE,
        ],
      ],
    ],
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallicm'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Include these classes in the &lt;select&gt; element'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallicm'],
    '#size' => 100,
    '#maxlength' => 1000,
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallich'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Include these classes in the &lt;option&gt; elements of the &lt;select&gt;'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallich'],
    '#size' => 100,
    '#maxlength' => 1000,
  ];
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-accordion'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Accordion settings'),
    '#open' => FALSE,
  ];
  $description = sprintf('%s <em>(%s: %s)</em><br>%s: <em>%s</em>.', $this
    ->t('By default the caption of the accordion toggle switch will be the name of the parent menu or the title of this block, you can change this by setting a custom title.'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Example'), $this
    ->t('Menu'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-accordion']['superfish_smallamt'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Accordion menu title'),
    '#description' => $description,
    '#default_value' => $this->configuration['smallamt'],
    '#size' => 50,
    '#maxlength' => 500,
  ];
  $default = sprintf('%s <em>(%s)</em>', $this
    ->t('Use parent menu items as buttons, add cloned parent links to sub-menus as well.'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-accordion']['superfish_smallabt'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Accordion button type'),
    '#default_value' => $this->configuration['smallabt'],
    '#options' => [
      0 => $this
        ->t('Use parent menu items as buttons.'),
      1 => $default,
      2 => $this
        ->t('Create new links next to parent menu item links and use them as buttons.'),
    ],
  ];
  $form['sf-plugins']['sf-supersubs'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Supersubs'),
    '#description' => $this
      ->t('<strong>Supersubs</strong> makes it possible to define custom widths for your menus.'),
    '#open' => FALSE,
  ];
  $form['sf-plugins']['sf-supersubs']['superfish_supersubs'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable Supersubs for this menu.'),
    '#default_value' => $this->configuration['supersubs'],
  ];
  $description = sprintf('%s <em>(%s: 12)</em>', $this
    ->t('Minimum width for sub-menus, in <strong>em</strong> units.'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-supersubs']['superfish_minwidth'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Minimum width'),
    '#description' => $description,
    '#default_value' => $this->configuration['minwidth'],
    '#size' => 10,
  ];
  $description = sprintf('%s <em>(%s: 27)</em>', $this
    ->t('Maximum width for sub-menus, in <strong>em</strong> units.'), $this
    ->t('Default'));
  $form['sf-plugins']['sf-supersubs']['superfish_maxwidth'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Maximum width'),
    '#description' => $description,
    '#default_value' => $this->configuration['maxwidth'],
    '#size' => 10,
  ];
  $form['sf-multicolumn'] = [
    '#type' => 'details',
    '#description' => $this
      ->t('Please refer to the Superfish module documentation for how you should setup multi-column sub-menus.'),
    '#title' => $this
      ->t('Multi-column sub-menus'),
    '#open' => FALSE,
  ];
  $form['sf-multicolumn']['superfish_multicolumn'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable multi-column sub-menus.'),
    '#default_value' => $this->configuration['multicolumn'],
  ];
  $description = sprintf('%s <em>(%s: 1)</em>', $this
    ->t('The depth of the first instance of multi-column sub-menus.'), $this
    ->t('Default'));
  $form['sf-multicolumn']['superfish_multicolumn_depth'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Start from depth'),
    '#description' => $description,
    '#default_value' => $this->configuration['multicolumn_depth'],
    '#options' => array_combine(range(1, 10), range(1, 10)),
  ];
  $description = sprintf('%s <em>(%s: 1)</em>', $this
    ->t('The amount of sub-menu levels that will be included in the multi-column sub-menu.'), $this
    ->t('Default'));
  $form['sf-multicolumn']['superfish_multicolumn_levels'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Levels'),
    '#description' => $description,
    '#default_value' => $this->configuration['multicolumn_levels'],
    '#options' => array_combine(range(1, 10), range(1, 10)),
  ];
  $form['sf-advanced'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Advanced settings'),
    '#open' => FALSE,
  ];
  $form['sf-advanced']['sf-settings'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Superfish'),
    '#open' => FALSE,
  ];
  $description = sprintf('%s <em>(%s: fast)</em>', $this
    ->t('The speed of the animation either in <strong>milliseconds</strong> or pre-defined values (<strong>slow, normal, fast</strong>).'), $this
    ->t('Default'));
  $form['sf-advanced']['sf-settings']['superfish_speed'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Animation speed'),
    '#description' => $description,
    '#default_value' => $this->configuration['speed'],
    '#size' => 15,
  ];
  $description = sprintf('%s <em>(%s: 800)</em>', $this
    ->t('The delay in <strong>milliseconds</strong> that the mouse can remain outside a sub-menu without it closing.'), $this
    ->t('Default'));
  $form['sf-advanced']['sf-settings']['superfish_delay'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Mouse delay'),
    '#description' => $description,
    '#default_value' => $this->configuration['delay'],
    '#size' => 15,
  ];
  $description = sprintf('%s <em>(%s: 1)</em><br>%s', $this
    ->t('The amount of sub-menu levels that remain open or are restored using the ".active-trail" class.'), $this
    ->t('Default'), $this
    ->t('Change this setting <strong>only and only</strong> if you are <strong>totally sure</strong> of what you are doing.'));
  $form['sf-advanced']['sf-settings']['superfish_pathlevels'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Path levels'),
    '#description' => $description,
    '#default_value' => $this->configuration['pathlevels'],
    '#options' => array_combine(range(0, 10), range(0, 10)),
  ];
  $form['sf-advanced']['sf-hyperlinks'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Hyperlinks'),
    '#open' => TRUE,
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('By enabling this option, only parent menu items with <em>Expanded</em> option enabled will have their submenus appear.'), $this
    ->t('Default'), $this
    ->t('disabled'));
  $form['sf-advanced']['sf-hyperlinks']['superfish_expanded'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Take "Expanded" option into effect.'),
    '#description' => $description,
    '#default_value' => $this->configuration['expanded'],
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Add cloned parent links to the top of sub-menus.'), $this
    ->t('Default'), $this
    ->t('disabled'));
  $form['sf-advanced']['sf-hyperlinks']['superfish_clone_parent'] = [
    '#type' => 'checkbox',
    '#title' => $description,
    '#default_value' => $this->configuration['clone_parent'],
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Disable hyperlink descriptions ("title" attribute)'), $this
    ->t('Default'), $this
    ->t('disabled'));
  $form['sf-advanced']['sf-hyperlinks']['superfish_hide_linkdescription'] = [
    '#type' => 'checkbox',
    '#title' => $description,
    '#default_value' => $this->configuration['hide_linkdescription'],
  ];
  $description = sprintf('%s <em>(%s: %s)</em>', $this
    ->t('Insert hyperlink descriptions ("title" attribute) into hyperlink texts.'), $this
    ->t('Default'), $this
    ->t('disabled'));
  $form['sf-advanced']['sf-hyperlinks']['superfish_add_linkdescription'] = [
    '#type' => 'checkbox',
    '#title' => $description,
    '#default_value' => $this->configuration['add_linkdescription'],
  ];
  $title = sprintf('%s <em>(sf-depth-1, sf-depth-2, sf-depth-3, ...)</em> <em>(%s: %s)</em>', $this
    ->t('Add item depth classes to menu items and their hyperlinks.'), $this
    ->t('Default'), $this
    ->t('enabled'));
  $form['sf-advanced']['sf-hyperlinks']['superfish_itemdepth'] = [
    '#type' => 'checkbox',
    '#title' => $title,
    '#default_value' => $this->configuration['link_depth_class'],
  ];
  $form['sf-advanced']['sf-custom-classes'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Custom classes'),
    '#open' => TRUE,
  ];
  $description = sprintf('%s <em>(%s: %s)</em><br>%s: top-menu category-science', $this
    ->t('(Space separated, without dots)'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Example'));
  $form['sf-advanced']['sf-custom-classes']['superfish_ulclass'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('For the main UL'),
    '#description' => $description,
    '#default_value' => $this->configuration['custom_list_class'],
    '#size' => 50,
    '#maxlength' => 1000,
  ];
  $description = sprintf('%s <em>(%s: %s)</em><br>%s: science-sub', $this
    ->t('(Space separated, without dots)'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Example'));
  $form['sf-advanced']['sf-custom-classes']['superfish_liclass'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('For the list items'),
    '#description' => $description,
    '#default_value' => $this->configuration['custom_item_class'],
    '#size' => 50,
    '#maxlength' => 1000,
  ];
  $description = sprintf('%s <em>(%s: %s)</em><br>%s: science-link', $this
    ->t('(Space separated, without dots)'), $this
    ->t('Default'), $this
    ->t('empty'), $this
    ->t('Example'));
  $form['sf-advanced']['sf-custom-classes']['superfish_hlclass'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('For the hyperlinks'),
    '#description' => $description,
    '#default_value' => $this->configuration['custom_link_class'],
    '#size' => 50,
    '#maxlength' => 1000,
  ];
  return $form;
}