You are here

function improved_multi_select_load_selectors in Improved Multi Select 8

Same name and namespace in other branches
  1. 7.2 improved_multi_select.module \improved_multi_select_load_selectors()
  2. 7 improved_multi_select.module \improved_multi_select_load_selectors()

Return array of jQuery selectors depending on module configuration.

Parameters

bool $replace_all: Boolean indicating if all multi value selects should be replaced.

array $selectors: Array with jQuery selectors.

Return value

array Array with jQuery selectors.

2 calls to improved_multi_select_load_selectors()
ImprovedMultiSelectTests::testImsLoadSelectors in src/Tests/Functional/ImprovedMultiSelectTests.php
Test improved_multi_select_load_selectors() function.
improved_multi_select_page_attachments in ./improved_multi_select.module
Implements hook_page_attachments().

File

./improved_multi_select.module, line 72
Replace the default multi-select boxes with two panels list and filter.

Code

function improved_multi_select_load_selectors(bool $replace_all, array $selectors) {
  $output = [];
  if (!empty($selectors) and !$replace_all) {
    foreach ($selectors as $selector) {
      $output[] = $selector;
    }
  }
  else {
    $output = [
      'select[multiple]',
    ];
  }
  return $output;
}