Révision e4c061ad
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc | ||
---|---|---|
13 | 13 |
'title' => t('Term from view'), |
14 | 14 |
'keyword' => 'term', |
15 | 15 |
'description' => t('Extract a term context from a view context of the base type term.'), |
16 |
'required context' => new ctools_context_required(t('View'), 'view', array('base' => 'term_data')), |
|
16 |
'required context' => new ctools_context_required(t('View'), 'view', array('base' => 'taxonomy_term_data')),
|
|
17 | 17 |
'context' => 'views_content_term_from_view_context', |
18 | 18 |
'edit form' => 'views_content_term_from_view_settings_form', |
19 | 19 |
'edit form validate' => 'views_content_term_from_view_settings_form_validate', |
... | ... | |
26 | 26 |
function views_content_term_from_view_context($context, $conf, $placeholder = FALSE) { |
27 | 27 |
// If unset it wants a generic, unfilled context, which is just NULL. |
28 | 28 |
if (empty($context->data) || $placeholder) { |
29 |
return ctools_context_create_empty('term', NULL); |
|
29 |
return ctools_context_create_empty('entity:taxonomy_term', NULL);
|
|
30 | 30 |
} |
31 | 31 |
$view = views_content_context_get_view($context); |
32 | 32 |
// Ensure the view executes, but we don't need its output. |
... | ... | |
36 | 36 |
if (isset($view->result[$row])) { |
37 | 37 |
$tid = $view->result[$row]->{$view->base_field}; |
38 | 38 |
if ($tid) { |
39 |
$term = taxonomy_get_term($tid);
|
|
40 |
return ctools_context_create('term', $term); |
|
39 |
$term = taxonomy_term_load($tid);
|
|
40 |
return ctools_context_create('entity:taxonomy_term', $term);
|
|
41 | 41 |
} |
42 | 42 |
} |
43 |
return ctools_context_create_empty('term', NULL); |
|
43 |
return ctools_context_create_empty('entity:taxonomy_term', NULL);
|
|
44 | 44 |
} |
45 | 45 |
|
46 | 46 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules