You are here

static function Helpers::calendar_systems_plugins in Calendar Systems 8.2

Internal helper which defines all available calendars manually.

@todo Define a pluggable API, so other modules can hook the hell in.

Return value

An array defined calendars.

1 call to Helpers::calendar_systems_plugins()
Helpers::calendar_systems_profiles_simple in src/Helpers.php
Internal static cache helper to get all available profiles for using as form select element options.

File

src/Helpers.php, line 207
Contains \Drupal\calendar_systems.

Class

Helpers

Namespace

Drupal\calendar_systems

Code

static function calendar_systems_plugins() {
  static $result;
  if (!$result) {
    $result = array(
      'default' => array(
        'title' => t('Default'),
        'installed' => TRUE,
        'installed version' => 2,
      ),
    );
    $calendar_systems = self::calendar_systems_get_calendar_instance();
    $plugins = $calendar_systems
      ->getPlugins();
    foreach ($plugins as $plugin_name => $plugin_info) {
      $result[$plugin_name] = $plugin_info;
      $result[$plugin_name]['title'] = t(ucfirst($plugin_name));
      $result[$plugin_name]['installed'] = TRUE;
      $result[$plugin_name]['installed version'] = 2;
    }
  }
  return $result;
}