You are here

function global_filter_field_widget_properties_alter in Views Global Filter 8

Same name and namespace in other branches
  1. 7 widgets/global_filter.datewidget.inc \global_filter_field_widget_properties_alter()

Implements hook_field_widget_properties_alter().

Called from field_default_form() this alters the widget properties of a field instance before it gets displayed. Used here to make sure that the Date module doesn't impose its defaults on the widget, as we already do that based on the session when 'set_date_from_session' is set on the form_state.

See also

global_filter_field_widget_form_alter()

File

widgets/global_filter.datewidget.inc, line 18
global_filter.datewidget.inc

Code

function global_filter_field_widget_properties_alter(&$widget, $context) {

  // Do nothing if this isn't a widget ear-marked by Global Filter.
  if (empty($widget['is_global_filter'])) {
    return;
  }
  switch ($widget['module']) {
    case 'date':
      $widget['is_new'] = FALSE;
      break;
  }
}