You are here

function _datex_api_add_l10n in Datex 7.2

Helper to add date widgets.

$l10n, $c_translation, $l_translation can all be TRUE, so current site language will be used.

1 call to _datex_api_add_l10n()
datex_popup_date_popup_process_alter in datex_popup/datex_popup.module
Implements hook_date_popup_process_alter().

File

datex_api/datex_api.module, line 157

Code

function _datex_api_add_l10n($l10n, $translation = NULL, $zip = 'pack') {
  static $loaded = array();
  if (!module_exists('libraries')) {
    return;
  }
  if ($zip === 'min' || $zip === 'pack') {
    $zip = '.' . $zip . '.js';
  }
  else {
    $zip = '.js';
  }
  $base_path = libraries_get_path('jquery.calendars') . '/';
  $name = 'jquery.calendars.' . $l10n;
  if (!isset($loaded['l10n'][$l10n])) {

    // Base file name for jquery.$component.
    drupal_add_js($base_path . $name . $zip);
    $loaded['l10n'][$l10n] = TRUE;
  }
  if ($translation && !isset($loaded['translation'][$translation])) {
    $name = "{$name}-{$translation}.js";
    drupal_add_js($base_path . $name);
    $loaded['translation'][$translation] = TRUE;
  }
}