You are here

function jquery_countdown_date_widget_settings_alter in jQuery Countdown 6

@file provides a jquery.countdown formatter for "date" field and settings in the date widget

File

jquery_countdown_date/jquery_countdown_date.module, line 8
provides a jquery.countdown formatter for "date" field and settings in the date widget

Code

function jquery_countdown_date_widget_settings_alter(&$settings, $op, $widget) {
  $widget_types = array(
    'date_popup',
    'date_select',
  );
  if (!empty($widget['type']) && in_array($widget['type'], $widget_types) || !empty($widget['widget_type']) && in_array($widget['widget_type'], $widget_types)) {
    switch ($op) {
      case 'form':
        $settings = array_merge($settings, _jquery_countdown_settings_form());

        // @TODO: remove date element and use from date field...
        // @TODO: remove administrative title
        // @TODO: add support for multiple value with same settings...
        unset($settings['jquery_countdown']['admin_title']);
        unset($settings['jquery_countdown']['date']);
        break;
      case 'save':

        // tell cck to store the complete jquery_countdown form elements because we use #tree in first fieldgroup
        $settings[] = 'jquery_countdown';
        break;
    }
  }
}