You are here

function _calendar_systems_plugins in Calendar Systems 7.2

Same name and namespace in other branches
  1. 8 calendar_systems.helpers.inc \_calendar_systems_plugins()
  2. 7.3 calendar_systems.module \_calendar_systems_plugins()
  3. 7 calendar_systems.helpers.inc \_calendar_systems_plugins()

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.

2 calls to _calendar_systems_plugins()
calendar_systems_profile_overview in ./calendar_systems.admin.inc
Form callback for calendar systems profiles.
_calendar_systems_profiles_simple in ./calendar_systems.helpers.inc
Internal static cache helper to get all available profiles for using as form select element options.

File

./calendar_systems.helpers.inc, line 381

Code

function _calendar_systems_plugins() {
  static $result;
  if (!$result) {
    $result = array(
      'default' => array(
        'title' => t('Default'),
        'installed' => TRUE,
        'installed version' => 2,
      ),
    );
    $calendar_systems = 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;
}