Projet

Général

Profil

Révision 5d12d676

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/modules/profile.views.inc
12 12
 */
13 13
function profile_views_data() {
14 14
  $data['profile_values']['moved to'] = 'profile_value';
15
  // Define the base group of this table. Fields that don't
16
  // have a group defined will go into this field by default.
15
  // Define the base group of this table. Fields that don't have a group
16
  // defined will go into this field by default.
17 17
  $data['profile_value']['table']['group']  = t('Profile');
18 18

  
19 19
  $data['profile_value']['table']['join'] = array(
......
60 60
}
61 61

  
62 62
/**
63
 * Get all profile fields
63
 * Get all profile fields.
64 64
 */
65 65
function profile_views_get_fields() {
66 66
  static $fields = NULL;
......
71 71

  
72 72
    foreach ($results as $row) {
73 73
      if (!empty($row->options)) {
74
        if (!in_array(substr($row->options, 0, 2), array('a:', 'b:', 'i:', 'f:', 'o:', 's:', ))) {
75
          // unserialized fields default version
74
        if (!in_array(substr($row->options, 0, 2), array('a:', 'b:', 'i:', 'f:', 'o:', 's:'))) {
75
          // unserialized fields default version.
76 76
          $options = $row->options;
77 77
          unset($row->options);
78 78
          $row->options = $options;
79 79
        }
80 80
        else {
81
          // serialized fields or modified version
81
          // serialized fields or modified version.
82 82
          $row->options = unserialize($row->options);
83 83
        }
84 84
      }
......
90 90

  
91 91

  
92 92
/**
93
 * Add profile fields to view table
93
 * Add profile fields to view table.
94 94
 */
95 95
function profile_views_fetch_field($field) {
96 96
  $data = array(
......
116 116
          'handler' => 'views_handler_argument_string',
117 117
        ),
118 118
      );
119

  
120 119
      break;
120

  
121 121
    case 'textarea':
122 122
      $data += array(
123 123
        'help' => t('Profile textarea'),
......
132 132
          'handler' => 'views_handler_filter_string',
133 133
        ),
134 134
      );
135

  
136 135
      break;
136

  
137 137
    case 'checkbox':
138 138
      $data += array(
139 139
        'help' => t('Profile checkbox'),
......
148 148
          'handler' => 'views_handler_filter_boolean_operator',
149 149
          'accept null' => TRUE,
150 150
        ),
151
        // @todo there ought to be a boolean argument handler
151
        // @todo There ought to be a boolean argument handler.
152 152
      );
153

  
154 153
      break;
154

  
155 155
    case 'url':
156 156
      $data += array(
157 157
        'help' => t('Profile URL'),
......
166 166
          'handler' => 'views_handler_filter_string',
167 167
        ),
168 168
      );
169

  
170 169
      break;
170

  
171 171
    case 'selection':
172 172
      $data += array(
173 173
        'help' => t('Profile selection'),
......
186 186
          'handler' => 'views_handler_argument_string',
187 187
        ),
188 188
      );
189

  
190 189
      break;
190

  
191 191
    case 'list':
192 192
      $data += array(
193 193
        'help' => t('Profile freeform list %field-name.', array('%field-name' => $field->title)),
......
199 199
          'handler' => 'views_handler_filter_string',
200 200
        ),
201 201
      );
202

  
203 202
      break;
203

  
204 204
    case 'date':
205 205
      $data += array(
206 206
        'help' => t('Profile date %field-name.', array('%field-name' => $field->title)),
......
208 208
          'handler' => 'views_handler_field_profile_date',
209 209
        ),
210 210
      );
211

  
212 211
      break;
213 212
  }
214 213

  
215
  // @todo: add access control to hidden fields.
214
  // @todo Add access control to hidden fields.
216 215
  return $data;
217 216
}

Formats disponibles : Unified diff