You are here

public function SlickAdmin::mediaSwitchForm in Slick Carousel 7.3

Same name and namespace in other branches
  1. 8.2 src/Form/SlickAdmin.php \Drupal\slick\Form\SlickAdmin::mediaSwitchForm()
  2. 8 src/Form/SlickAdmin.php \Drupal\slick\Form\SlickAdmin::mediaSwitchForm()

Returns the image formatter form elements.

Overrides BlazyAdminBase::mediaSwitchForm

1 call to SlickAdmin::mediaSwitchForm()
SlickAdmin::buildSettingsForm in src/Form/SlickAdmin.php
Returns the main form elements.

File

src/Form/SlickAdmin.php, line 189

Class

SlickAdmin
Provides resusable admin functions, or form elements.

Namespace

Drupal\slick\Form

Code

public function mediaSwitchForm(array &$form, $definition = []) {
  parent::mediaSwitchForm($form, $definition);
  if (isset($form['media_switch'])) {
    $form['media_switch']['#description'] = t('Depends on the enabled supported modules, or has known integration with Slick.<ol><li>Link to content: for aggregated small slicks.</li><li>Image to iframe: audio/video is hidden below image until toggled, otherwise iframe is always displayed, and draggable fails. Aspect ratio applies.</li><li>Colorbox.</li><li>Photobox. Be sure to select "Thumbnail style" for the overlay thumbnails.</li><li>Intense: image to fullscreen intense image.</li>');
    if (!empty($definition['multimedia']) && isset($definition['fieldable_form'])) {
      $form['media_switch']['#description'] .= ' ' . t('<li>Image rendered by its formatter: image-related settings here will be ignored: breakpoints, image style, CSS background, aspect ratio, lazyload, etc. Only choose if needing a special image formatter such as Image Link Formatter.</li>');
    }
    $form['media_switch']['#description'] .= ' ' . t('</ol> Try selecting "<strong>- None -</strong>" first before changing if trouble with this complex form states.');
  }
  if (isset($form['ratio']['#description'])) {
    $form['ratio']['#description'] .= ' ' . t('Required if using media to switch between iframe and overlay image, otherwise DIY.');
  }
}