You are here

function calendar_systems_get_calendar_system_name in Calendar Systems 7

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

Helper to determine the active calendar system

11 calls to calendar_systems_get_calendar_system_name()
calendar_systems_add_js_date_picker in ./calendar_systems.module
Add javascript date picker for a field or set of fields
calendar_systems_attach_js_date_picker in ./calendar_systems.module
calendar_systems_date_popup_process_alter in ./calendar_systems.module
Supporing date module's date_popup element hook_date_popup_process_alter
calendar_systems_date_select_process_alter in ./calendar_systems.module
Supporing date module's date_select element
calendar_systems_date_text_process_alter in ./calendar_systems.module
Supporing date module's date_text element hook_date_text_process_alter

... See full list

File

./calendar_systems.helpers.inc, line 494

Code

function calendar_systems_get_calendar_system_name($language = NULL) {

  // Load all available profiles:
  $profiles = _calendar_systems_profiles();

  // Get site's current language:
  if (is_null($language)) {
    $language = _calendar_systems_languages_active();
  }
  if (isset($profiles[$language])) {
    $calendar_system = $profiles[$language]->calendar_system;
  }
  elseif (isset($profiles['default'])) {
    $calendar_system = $profiles['default']->calendar_system;
  }
  if (empty($calendar_system)) {
    $calendar_system = 'default';
  }
  return $calendar_system;
}