You are here

public static function Openlayers::getPluginTypes in Openlayers 7.3

Return the list of Openlayers plugins type this module provides.

Parameters

array $filter: The values to filter out of the result array.

Return value

string[] Return an array of strings. Those strings are the plugin type name in lowercase.

7 calls to Openlayers::getPluginTypes()
Base::getJS in src/Types/Base.php
!Attention! This function will remove any option that is named after a plugin type e.g.: layers, controls, styles, interactions, components .
Base::removeObject in src/Types/Base.php
Remove an object from the collection.
Map::optionsToObjects in src/Types/Map.php
Return a flat array containing Openlayers Objects from the options array.
openlayers_contextual_links_openlayers_object_postprocess_alter in modules/openlayers_contextual_links/openlayers_contextual_links.module
Implements hook_openlayers_object_postprocess_alter().
openlayers_i18n_string_refresh in ./openlayers.module
Implements hook_i18n_string_refresh().

... See full list

File

src/Openlayers.php, line 213
Contains Openlayers.

Class

Openlayers
Class Openlayers.

Namespace

Drupal\openlayers

Code

public static function getPluginTypes(array $filter = array()) {
  $plugins = array();
  foreach (\Drupal::getContainer()
    ->getDefinitions() as $id => $definition) {
    $id = explode(".", drupal_strtolower($id));
    if (count($id) == 2) {
      if ($id[0] == 'openlayers') {
        if (isset($definition['tags']) && 0 === strpos($definition['tags'][0]['plugin_manager_definition']['directory'], 'Plugin/')) {
          $plugins[$id[1]] = $id[1];
        }
      }
    }
  }
  asort($plugins);
  return array_udiff(array_values($plugins), $filter, 'strcasecmp');
}