You are here

protected function ParagraphsSliderPlugin::getOptionsetDescription in Paragraphs Collection 8

Returns description about slick optionsets module.

Parameters

array $slick_optionset_options: Available slick optionsets.

Return value

string Description for slick_slider field.

1 call to ParagraphsSliderPlugin::getOptionsetDescription()
ParagraphsSliderPlugin::buildConfigurationForm in modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php
Form constructor.

File

modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php, line 342

Class

ParagraphsSliderPlugin
Provides Slider plugin.

Namespace

Drupal\paragraphs_collection_demo\Plugin\paragraphs\Behavior

Code

protected function getOptionsetDescription($slick_optionset_options) {
  if (empty($slick_optionset_options)) {
    return [
      $this
        ->t('There are no Slick optionsets available.'),
    ];
  }
  $description = $this
    ->t('Select none, to show all.');
  $enable_link = Url::fromRoute('system.modules_list');
  $slick_link = Url::fromRoute('entity.slick.collection');
  if ($this->moduleHandler
    ->moduleExists('slick_ui')) {
    if ($slick_link
      ->access($this->currentUser)) {
      $description = $this
        ->t('Select none, to show all. To have more options, go to the <a href=":link">Slick UI config page</a> and add items there.', [
        ':link' => $slick_link
          ->toString(),
      ]);
    }
  }
  else {
    if ($enable_link
      ->access($this->currentUser)) {
      $description = $this
        ->t('Select none, to show all. Enable the <a href=":link">Slick UI</a> from the module list to create more options.', [
        ':link' => $enable_link
          ->toString(),
      ]);
    }
  }
  return $description;
}