You are here

function date_ical_get_location_fields in Date iCal 7.2

Same name and namespace in other branches
  1. 7.3 date_ical.module \date_ical_get_location_fields()

Identify all potential fields that could populate the optional LOCATION component of iCal output.

2 calls to date_ical_get_location_fields()
date_ical_plugin_row_ical_entity::options_form in includes/date_ical_plugin_row_ical_entity.inc
Provide a form for setting options.
date_ical_plugin_row_ical_entity::render in includes/date_ical_plugin_row_ical_entity.inc
Render a row object. This usually passes through to a theme template of some form, but not always.

File

./date_ical.module, line 346
Adds ical functionality to Views, and an iCal parser to Feeds.

Code

function date_ical_get_location_fields($base = 'node', $reset = FALSE) {
  static $fields = array();
  $empty = array(
    'name' => array(),
    'alias' => array(),
  );
  if (empty($fields[$base]) || $reset) {
    $cid = 'date_ical_location_fields_' . $base;
    if (!$reset && ($cached = cache_get($cid, 'cache_views'))) {
      $fields[$base] = $cached->data;
    }
    else {
      $fields[$base] = _date_ical_get_location_fields($base);
    }
  }

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