You are here

function date_popup_add in Date 7.3

Same name and namespace in other branches
  1. 7 date_popup/date_popup.module \date_popup_add()
  2. 7.2 date_popup/date_popup.module \date_popup_add()

Load needed files.

Play nice with jQuery UI.

3 calls to date_popup_add()
date_popup_element_process in date_popup/date_popup.module
Javascript popup element processing.
date_popup_input_date in date_popup/date_popup.module
Helper function for extracting a date value out of user input.
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 26
A module to enable jQuery calendar and time entry popups.

Code

function date_popup_add() {
  static $loaded = FALSE;
  if ($loaded) {
    return;
  }
  drupal_add_library('system', 'ui.datepicker');
  drupal_add_library('date_popup', 'timeentry');

  // Add the wvega-timepicker library if it's available.
  $wvega_path = date_popup_get_wvega_path();
  if ($wvega_path) {
    drupal_add_js($wvega_path . '/jquery.timepicker.js');
    drupal_add_css($wvega_path . '/jquery.timepicker.css');
  }
  $loaded = TRUE;
}