The "force loading base jquery-ui.css" will break other modules while using custom UI.


/**
 * Implementation of hook_init().
 */
function date_popup_init() {
  global $user;
  if (!module_exists('jquery_ui')) {
    if ($user->uid == 1) {
      drupal_set_message(t('The Date Popup module now requires the <a href="@link">jQuery UI module</a> as a source for the datepicker. Please install it immediately.', array('@link' => 'http://drupal.org/project/jquery_ui')), 'error');
    }
    return;
  }

  $date_popup_css_file = variable_get('date_popup_css_file', date_popup_css_default());

  // Force loading base jquery-ui.css when using date_popup default theme,
  // otherwise the popup calendar will be displayed with no theme at all.
  if ($date_popup_css_file == date_popup_css_default()) {
    //drupal_add_css(jquery_ui_get_path() .'/themes/base/jquery-ui.css');
  }
  // Otherwise, load the CSS file in the corresponding theme directory.
  else {
    drupal_add_css(dirname($date_popup_css_file) .'/jquery-ui.css');
  }
  drupal_add_css($date_popup_css_file);

  if (variable_get('date_popup_timepicker', 'default') == 'default') {
    drupal_add_css(drupal_get_path('module', 'date_popup')  .'/themes/jquery.timeentry.css');
  }
}

Comments

hefox’s picture

May be related to #898324: Datepicker CSS, but quick browsing the issues.

Please use php tags to format php code (see PHP button in the editor), makes it much easier to read.

pandaski’s picture

I have found the reason - there is a configure in date field so that the nature css can be chosen.

Cheers,

pandaski’s picture

Status: Active » Closed (fixed)
pandaski’s picture

Issue summary: View changes

update the codes in php tag