Example #1
0
 /**
  * Register styled select assets.
  *
  * @param Config|ContextualConfig $config The bootstrap config.
  *
  * @return void
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 private function registerStyledSelectAssets($config)
 {
     $javascripts = (array) $config->get('form.styled-select.javascript');
     $stylesheets = $config->get('form.styled-select.stylesheet');
     $language = substr($GLOBALS['TL_LANGUAGE'], 0, 2);
     if (isset(static::$selectLocalizations[$language])) {
         $javascripts[] = sprintf($config->get('form.styled-select.i18n'), static::$selectLocalizations[$language]);
     }
     AssetsManager::addJavascripts($javascripts, 'bootstrap-styled-select');
     AssetsManager::addStylesheets($stylesheets, 'bootstrap-styled-select');
 }