You are here

function date_popup_load in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_popup/date_popup.module \date_popup_load()
  2. 6 date_popup/date_popup.module \date_popup_load()

Load needed files.

3 calls to date_popup_load()
date_popup_input_value in date_popup/date_popup.module
Helper function for extracting a date value out of user input.
date_popup_process in date_popup/date_popup.module
Javascript popup element processing. Add popup attributes to $element.
date_popup_validate in date_popup/date_popup.module
Massage the input values back into a single date.

File

date_popup/date_popup.module, line 25
A module to enable jquery calendar and time entry popups. Requires the Date API.

Code

function date_popup_load() {
  static $loaded = FALSE;
  if ($loaded) {
    return;
  }
  $path = drupal_get_path('module', 'date_popup');
  if (module_exists('jquery_ui')) {
    jquery_ui_add('ui.datepicker');
    global $language;
    if ($language->language != 'en') {
      jquery_ui_add("i18n/ui.datepicker-{$language->language}");
    }
  }
  if (variable_get('date_popup_timepicker', 'default') == 'default') {
    drupal_add_js($path . '/lib/jquery.timeentry.pack.js');
  }
  $loaded = TRUE;
}