Projet

Général

Profil

Révision 599a39cd

Ajouté par Assos Assos il y a environ 3 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/date/date_views/includes/date_views_fields.inc
1 1
<?php
2

  
2 3
/**
3 4
 * @file
4 5
 * Helper for identifying Date API fields for views.
......
9 10
 *
10 11
 * @return array
11 12
 *   An array with fieldname, type, and table.
13
 *
12 14
 * @see date_views_date_views_fields()
13 15
 */
14 16
function _date_views_fields($base = 'node') {
15

  
16 17
  // Make sure $base is never empty.
17 18
  if (empty($base)) {
18 19
    $base = 'node';
......
83 84

  
84 85
        default:
85 86
          // If this is not a date field, nothing more to do.
86
          continue;
87
          continue 2;
87 88
      }
88 89

  
89 90
      $revision = in_array($base, array('node_revision')) ? FIELD_LOAD_REVISION : FIELD_LOAD_CURRENT;
90 91
      $db_info = date_api_database_info($field, $revision);
91 92
      $name = $table_name . "." . $field_name;
92 93
      $grans = array('year', 'month', 'day', 'hour', 'minute', 'second');
93
      $granularity = !empty($field['granularity']) ? $field['granularity'] : $grans;
94
      $granularity = !empty($field['settings']['granularity']) ? $field['settings']['granularity'] : $grans;
94 95

  
95 96
      $fromto = array(
96 97
        $table_name . '.' . $db_info['columns'][$table_name]['value'],
......
104 105
          $offset_field = $table_name . '.' . $db_info['columns'][$table_name]['offset'];
105 106
        }
106 107
        $related_fields = array(
107
          $table_name . '.' . $db_info['columns'][$table_name]['value']
108
          $table_name . '.' . $db_info['columns'][$table_name]['value'],
108 109
        );
109 110
        if (isset($db_info['columns'][$table_name]['value2'])) {
110 111
          $related_fields = array_merge($related_fields, array($table_name . '.' . $db_info['columns'][$table_name]['value2']));

Formats disponibles : Unified diff