You are here

function _spaces_views_get_field in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces_views.inc \_spaces_views_get_field()

retrieves the field id of the $op type provided

1 call to _spaces_views_get_field()
theme_spaces_datetitle_view_style in ./spaces_views.inc

File

./spaces_views.inc, line 89

Code

function _spaces_views_get_field($op, $view) {
  switch ($op) {
    case 'cck_date':
      $view = (object) $view;
      $fields = _views_get_fields();

      // iterate through provided fields and check for date field
      foreach ($view->field as $field_id => $field) {
        $field_key = $field['tablename'] . '.' . $field['field'];
        if ($fields[$field_key]['content_field_module'] == 'date' && $view->field[$field_id]) {
          return $field_id;
        }
      }
      return false;
  }
}