You are here

function date_views_plugin_pager::date_forbid in Date 8

Same name and namespace in other branches
  1. 7.3 date_views/includes/date_views_plugin_pager.inc \date_views_plugin_pager::date_forbid()
  2. 7.2 date_views/includes/date_views_plugin_pager.inc \date_views_plugin_pager::date_forbid()

Add a callback to determine if we have moved outside the valid date range for this argument.

1 call to date_views_plugin_pager::date_forbid()
date_views_plugin_pager::query in date_views/includes/date_views_plugin_pager.inc
Transfer date information from the argument to the view so the pager theme can use it and update the date argument value to whatever is set by the pager.

File

date_views/includes/date_views_plugin_pager.inc, line 220
Date pager. Works with a Date argument, the argument filters the view and the pager provides back/next navigation.

Class

date_views_plugin_pager
Example plugin to handle paging by month.

Code

function date_forbid($argument) {

  // See if we're outside the allowed date range for our argument.
  $limit = date_range_years($argument->options['year_range']);
  if (date_format($argument->min_date, 'Y') < $limit[0] || date_format($argument->max_date, 'Y') > $limit[1]) {
    return TRUE;
  }
  return FALSE;
}