You are here

function _calendar_systems_profiles in Calendar Systems 7.3

Same name and namespace in other branches
  1. 8 calendar_systems.helpers.inc \_calendar_systems_profiles()
  2. 7 calendar_systems.helpers.inc \_calendar_systems_profiles()
  3. 7.2 calendar_systems.helpers.inc \_calendar_systems_profiles()

Internal static cache helper to get all available profiles.

Return value

An array of available profiles.

2 calls to _calendar_systems_profiles()
calendar_systems_get_calendar_instance in ./calendar_systems.module
Gets an instance of the calendar object for the selected calendar system acording to the settings or the passed arguments
calendar_systems_profile_overview in ./calendar_systems.admin.inc
Form callback for calendar systems profiles.

File

./calendar_systems.module, line 347
Contains Calendar Systems hook implementations and helpers.

Code

function _calendar_systems_profiles() {
  $cache =& drupal_static(__FUNCTION__);
  if (!isset($cache)) {
    $cache = array();
    $profiles = db_query('SELECT language, calendar_system, settings FROM {calendar_systems}');

    // Build an array of profiles keyed by the identifiers:
    foreach ($profiles as $profile) {
      $profile->settings = unserialize($profile->settings);
      $cache[$profile->language] = $profile;
    }
  }
  return $cache;
}