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/taxonomy.views.inc
14 14
  $data = array();
15 15

  
16 16
  // ----------------------------------------------------------------------
17
  // taxonomy_vocabulary table
18

  
17
  // 'taxonomy_vocabulary' table.
19 18
  $data['vocabulary']['moved to'] = 'taxonomy_vocabulary';
20 19
  $data['taxonomy_vocabulary']['table']['group']  = t('Taxonomy vocabulary');
21 20

  
22 21
  $data['taxonomy_vocabulary']['table']['join'] = array(
23
    // vocabulary links to taxonomy_term_data directly via vid.
22
    // Vocabulary links to taxonomy_term_data directly via vid.
24 23
    'taxonomy_term_data' => array(
25 24
      'left_field' => 'vid',
26 25
      'field' => 'vid',
......
35 34
    ),
36 35
  );
37 36

  
38
  // vocabulary name
37
  // Vocabulary name.
39 38
  $data['taxonomy_vocabulary']['name'] = array(
40
    'title' => t('Name'), // The item it appears as on the UI,
39
    // The item it appears as on the UI,
40
    'title' => t('Name'),
41 41
    'field' => array(
42 42
      'help' => t('Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
43 43
      'handler' => 'views_handler_field',
......
49 49
    ),
50 50
  );
51 51
  $data['taxonomy_vocabulary']['machine_name'] = array(
52
    'title' => t('Machine name'), // The item it appears as on the UI,
52
    // The item it appears as on the UI,
53
    'title' => t('Machine name'),
53 54
    'field' => array(
54 55
      'help' => t('Machine-Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
55 56
      'handler' => 'views_handler_field',
......
65 66
    ),
66 67
  );
67 68
  $data['taxonomy_vocabulary']['vid'] = array(
68
    'title' => t('Vocabulary ID'), // The item it appears as on the UI,
69
    // The item it appears as on the UI,
70
    'title' => t('Vocabulary ID'),
69 71
    'help' => t('The taxonomy vocabulary ID'),
70 72
    'field' => array(
71 73
      'handler' => 'views_handler_field_numeric',
......
80 82
    ),
81 83
  );
82 84
  $data['taxonomy_vocabulary']['description'] = array(
83
    'title' => t('Description'), // The item it appears as on the UI,
85
    // The item it appears as on the UI,
86
    'title' => t('Description'),
84 87
    'help' => t('The taxonomy vocabulary description'),
85 88
    'field' => array(
86 89
      'handler' => 'views_handler_field',
......
106 109
  );
107 110

  
108 111
  // ----------------------------------------------------------------------
109
 // taxonomy_term_data table
110

  
112
  // 'taxonomy_term_data' table.
111 113
  $data['term_data']['moved to'] = 'taxonomy_term_data';
112 114
  $data['taxonomy_term_data']['table']['group']  = t('Taxonomy term');
113 115
  $data['taxonomy_term_data']['table']['base'] = array(
......
118 120
  );
119 121
  $data['taxonomy_term_data']['table']['entity type'] = 'taxonomy_term';
120 122

  
121

  
122

  
123
  // The term data table
123
  // The term data table.
124 124
  $data['taxonomy_term_data']['table']['join'] = array(
125 125
    'taxonomy_vocabulary' => array(
126 126
      'field' => 'vid',
127 127
      'left_field' => 'vid',
128 128
    ),
129
    // This is provided for many_to_one argument
129
    // This is provided for many_to_one argument.
130 130
    'taxonomy_index' => array(
131 131
      'field' => 'tid',
132 132
      'left_field' => 'tid',
......
141 141
    ),
142 142
  );
143 143

  
144
  // tid field
144
  // Term ID / 'tid' field.
145 145
  $data['taxonomy_term_data']['tid'] = array(
146 146
    'title' => t('Term ID'),
147 147
    'help' => t('The tid of a taxonomy term.'),
......
166 166
    ),
167 167
  );
168 168

  
169
  // raw tid field
169
  // The raw term 'tid' field.
170 170
  $data['taxonomy_term_data']['tid_raw'] = array(
171 171
    'title' => t('Term ID'),
172 172
    'help' => t('The tid of a taxonomy term.'),
......
186 186
      'relationship field' => 'tid',
187 187
      'outer field' => 'taxonomy_term_data.tid',
188 188
      'argument table' => 'taxonomy_term_data',
189
      'argument field' =>  'tid',
189
      'argument field' => 'tid',
190 190
      'base'   => 'node',
191 191
      'field'  => 'nid',
192 192
    ),
193 193
  );
194 194

  
195
  // Term name field
195
  // Term name field.
196 196
  $data['taxonomy_term_data']['name'] = array(
197 197
    'title' => t('Name'),
198 198
    'help' => t('The taxonomy term name.'),
......
215 215
    ),
216 216
  );
217 217

  
218
  // taxonomy weight
218
  // Term weight.
219 219
  $data['taxonomy_term_data']['weight'] = array(
220 220
    'title' => t('Weight'),
221 221
    'help' => t('The term weight field'),
......
234 234
    ),
235 235
  );
236 236

  
237
  // Term description
237
  // Term description.
238 238
  $data['taxonomy_term_data']['description'] = array(
239 239
    'title' => t('Term description'),
240 240
    'help' => t('The description associated with a taxonomy term.'),
......
247 247
    ),
248 248
  );
249 249

  
250
  // Term vocabulary
250
  // Term vocabulary.
251 251
  $data['taxonomy_term_data']['vid'] = array(
252 252
    'title' => t('Vocabulary'),
253 253
    'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'),
......
256 256
    ),
257 257
  );
258 258

  
259
  // Link to edit the term
259
  // Link to edit the term.
260 260
  $data['taxonomy_term_data']['edit_term'] = array(
261 261
    'field' => array(
262 262
      'title' => t('Term edit link'),
......
266 266
  );
267 267

  
268 268
  // ----------------------------------------------------------------------
269
  // taxonomy_index table
270

  
269
  // 'taxonomy_index' table.
271 270
  $data['term_node']['moved to'] = 'taxonomy_index';
272 271
  $data['taxonomy_index']['table']['group']  = t('Taxonomy term');
273 272

  
274 273
  $data['taxonomy_index']['table']['join'] = array(
275 274
    'taxonomy_term_data' => array(
276
      // links directly to taxonomy_term_data via tid
275
      // Links directly to taxonomy_term_data via tid.
277 276
      'left_field' => 'tid',
278 277
      'field' => 'tid',
279 278
    ),
280 279
    'node' => array(
281
      // links directly to node via nid
280
      // Links directly to node via nid.
282 281
      'left_field' => 'nid',
283 282
      'field' => 'nid',
284 283
    ),
......
300 299
    ),
301 300
  );
302 301

  
303
  // @todo This stuff needs to move to a node field since
304
  // really it's all about nodes.
305
  // tid field
302
  // @todo Should be moved to a node field since really it's all about nodes.
303
  // Term ID / 'tid' field.
306 304
  $data['taxonomy_index']['tid'] = array(
307 305
    'group' => t('Content'),
308 306
    'title' => t('Has taxonomy term ID'),
......
326 324
  );
327 325

  
328 326
  // ----------------------------------------------------------------------
329
  // term_hierarchy table
330

  
327
  // 'term_hierarchy' table.
331 328
  $data['taxonomy_term_hierarchy']['table']['group']  = t('Taxonomy term');
332 329

  
333 330
  $data['term_hierarchy']['moved to'] = 'taxonomy_term_hierarchy';
334 331
  $data['taxonomy_term_hierarchy']['table']['join'] = array(
335 332
    'taxonomy_term_hierarchy' => array(
336
      // links to self through left.parent = right.tid (going down in depth)
333
      // Links to self through left.parent = right.tid (going down in depth).
337 334
      'left_field' => 'tid',
338 335
      'field' => 'parent',
339 336
    ),
340 337
    'taxonomy_term_data' => array(
341
      // links directly to taxonomy_term_data via tid
338
      // Links directly to taxonomy_term_data via tid.
342 339
      'left_field' => 'tid',
343 340
      'field' => 'tid',
344 341
    ),
......
433 430
/**
434 431
 * Implements hook_field_views_data().
435 432
 *
436
 * Views integration for taxonomy_term_reference fields. Adds a term relationship to the default
437
 * field data.
433
 * Views integration for taxonomy_term_reference fields. Adds a term
434
 * relationship to the default field data.
438 435
 *
439 436
 * @see field_views_field_default_views_data()
440 437
 */
......
455 452
      'base field' => 'tid',
456 453
      'label' => t('term from !field_name', array('!field_name' => $field['field_name'])),
457 454
    );
458

  
459 455
  }
460 456

  
461 457
  return $data;
......
507 503
 */
508 504
function taxonomy_views_plugins() {
509 505
  return array(
510
    'module' => 'views', // This just tells our themes are elsewhere.
506
    // This just tells our themes are elsewhere.
507
    'module' => 'views',
511 508
    'argument validator' => array(
512 509
      'taxonomy_term' => array(
513 510
        'title' => t('Taxonomy term'),
514 511
        'handler' => 'views_plugin_argument_validate_taxonomy_term',
515
        'path' => drupal_get_path('module', 'views') . '/modules/taxonomy', // not necessary for most modules
512
        'path' => drupal_get_path('module', 'views') . '/modules/taxonomy',
516 513
      ),
517 514
    ),
518 515
    'argument default' => array(

Formats disponibles : Unified diff