You are here

static function Helpers::calendar_systems_profiles_simple in Calendar Systems 8.2

Internal static cache helper to get all available profiles for using as form select element options.

Return value

An array of available profiles.

1 call to Helpers::calendar_systems_profiles_simple()
AdminSettings::buildForm in src/Form/AdminSettings.php
Form constructor.

File

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

Class

Helpers

Namespace

Drupal\calendar_systems

Code

static function calendar_systems_profiles_simple($default_options = FALSE) {
  static $cache;
  if (!$cache) {
    $calendar_systems = self::calendar_systems_plugins();
    $cache = array();
    if ($default_options !== FALSE) {
      $cache = $default_options;
    }

    // Build available calendar systems array:
    foreach ($calendar_systems as $id => $calendar_system) {
      $cache[$id] = $calendar_system['title'];
    }
  }
  return $cache;
}