You are here

public static function BaseSettings::getLibraries in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x src/Element/BaseSettings.php \Drupal\charts\Element\BaseSettings::getLibraries()

Get the libraries.

Return value

array The library options.

1 call to BaseSettings::getLibraries()
BaseSettings::processSettings in src/Element/BaseSettings.php
Processes the settings element.

File

src/Element/BaseSettings.php, line 552

Class

BaseSettings
Provides a form element for setting a chart.

Namespace

Drupal\charts\Element

Code

public static function getLibraries() {

  // Using plugins to get the available installed libraries.
  $plugin_manager = \Drupal::service('plugin.manager.charts');
  $plugin_definitions = $plugin_manager
    ->getDefinitions();
  $library_options = [];
  foreach ($plugin_definitions as $plugin_definition) {
    $library_options[$plugin_definition['id']] = $plugin_definition['name'];
  }
  return $library_options;
}