You are here

function date_popup_settings in Date 6.2

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

General configuration form for controlling the Date Popup behaviour.

1 string reference to 'date_popup_settings'
date_popup_menu in date_popup/date_popup.module
Implementation of hook_menu().

File

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

Code

function date_popup_settings() {
  $form['date_popup_css_file'] = array(
    '#type' => 'select',
    '#title' => t('Datepicker css'),
    '#description' => t('Choose the css to use for the jQuery UI datepicker.'),
    '#options' => date_popup_css_options(),
    '#default_value' => variable_get('date_popup_css_file', date_popup_css_default()),
  );
  $form['date_popup_css_file']['#prefix'] = t('<p>The Date Popup calendar datepicker uses the jQuery UI datepicker. You must install the jQuery UI module for this to work. It has its own css file, or there is a Drupal adaptation included in Date Popup that you can use.</p>');
  $form['date_popup_timepicker'] = array(
    '#type' => 'select',
    '#options' => array(
      'default' => t('Use default jQuery timepicker'),
      'none' => t('Manual time entry, no jQuery timepicker'),
    ),
    '#title' => t('Timepicker'),
    '#default_value' => variable_get('date_popup_timepicker', 'default'),
    '#description' => t("Choose the jQuery timepicker to user."),
  );
  $form['date_popup_timepicker']['#prefix'] .= t('<p>The Date Popup module uses a jQuery timepicker module. There is no "official" jQuery UI timepicker, and not everyone likes the one that is included here. If you do not want to use the timepicker, you can turn it off below and users will get a regular textfield instead.</p>');
  $css = <<<EOM
/* ___________ IE6 IFRAME FIX ________ */
.ui-datepicker-cover {
  display: none; /*sorry for IE5*/
  display/**/: block; /*sorry for IE5*/
  position: absolute; /*must have*/
  z-index: -1; /*must have*/
  filter: mask(); /*must have*/
  top: -4px; /*must have*/
  left: -4px; /*must have*/ /* LTR */
  width: 200px; /*must have*/
  height: 200px; /*must have*/
}
EOM;
  $form['#suffix'] = t('<p>The Date Popup calendar includes some css for IE6 that breaks css validation. Since IE 6 is now superceded by IE 7 and IE 8, the special css for IE 6 has been removed from the regular css used by the Date Popup. If you find you need that css after all, you can add it back in your theme. Look at the way the Garland theme adds special IE-only css in in its page.tpl.php file. The css you need is:</p>') . '<blockquote><PRE>' . $css . '</PRE></blockquote>';
  return system_settings_form($form);
}