You are here

function date_views_fields in Date 7.3

Same name and namespace in other branches
  1. 8 date_views/date_views.module \date_views_fields()
  2. 7 date_views/includes/date_views.views.inc \date_views_fields()
  3. 7.2 date_views/date_views.module \date_views_fields()

Identify all potential date/timestamp fields and cache the data.

8 calls to date_views_fields()
date_views_argument_handler::admin_summary in date_views/includes/date_views_argument_handler.inc
Provide text for the administrative summary.
date_views_argument_handler::get_query_fields in date_views/includes/date_views_argument_handler.inc
date_views_argument_handler::options_form in date_views/includes/date_views_argument_handler.inc
Build the options form.
date_views_argument_handler_simple::query in date_views/includes/date_views_argument_handler_simple.inc
Build the query based upon the formula
date_views_filter_handler::admin_summary in date_views/includes/date_views_filter_handler.inc
Display the filter on the administrative summary.

... See full list

File

date_views/date_views.module, line 145
Date Views module.

Code

function date_views_fields($base = 'node', $reset = FALSE) {
  static $fields = array();
  $empty = array(
    'name' => array(),
    'alias' => array(),
  );
  module_load_include('inc', 'date_views', 'includes/date_views_fields');
  if (empty($fields[$base]) || $reset) {
    $cid = 'date_views_fields_' . $base;
    if (!$reset && ($cached = cache_get($cid, 'cache_views'))) {
      $fields[$base] = $cached->data;
    }
    else {
      $fields[$base] = _date_views_fields($base);
    }
  }

  // Make sure that empty values will be arrays in the expected format.
  return !empty($fields) && !empty($fields[$base]) ? $fields[$base] : $empty;
}