### Eclipse Workspace Patch 1.0 #P scheduler6_date_popup Index: scheduler.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/scheduler/Attic/scheduler.module,v retrieving revision 1.50.2.23 diff -u -r1.50.2.23 scheduler.module --- scheduler.module 12 Jul 2009 17:00:14 -0000 1.50.2.23 +++ scheduler.module 16 Aug 2009 12:05:20 -0000 @@ -102,12 +102,6 @@ // if scheduling has been enabled for this node type if (variable_get('scheduler_'. $form['type']['#value'], 0) == 1) { - //use JScalendar picker for dates if the module exists and is enabled - $jscalendar = FALSE; - if (module_exists('jscalendar')) { - $jscalendar = TRUE; - } - $node = $form['#node']; $date_format = variable_get('scheduler_date_format', SCHEDULER_DATE_FORMAT); @@ -161,6 +155,20 @@ '#description' => t('Format: %time. Leave blank to disable scheduled unpublishing.', array('%time' => format_date(time(), 'custom', $date_format))), '#attributes' => $jscalendar ? array('class' => 'jscalendar') : array() ); + + if (module_exists('date_popup')) { + // Make this a popup calendar widget if Date Popup module is enabled. + $form['scheduler_settings']['publish_on']['#type'] = 'date_popup'; + $form['scheduler_settings']['publish_on']['#date_format'] = $date_format; + $form['scheduler_settings']['publish_on']['#date_year_range'] = '0:+10'; + $form['scheduler_settings']['publish_on']['#description'] = t('Leave blank to disable scheduled publishing.'); + unset($form['scheduler_settings']['publish_on']['#maxlength']); + $form['scheduler_settings']['unpublish_on']['#type'] = 'date_popup'; + $form['scheduler_settings']['unpublish_on']['#date_format'] = $date_format; + $form['scheduler_settings']['unpublish_on']['#date_year_range'] = '0:+10'; + $form['scheduler_settings']['unpublish_on']['#description'] = t('Leave blank to disable scheduled unpublishing.'); + unset($form['scheduler_settings']['unpublish_on']['#maxlength']); + } } } }