function ctools_context_create_term in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 plugins/contexts/term.inc \ctools_context_create_term()
It's important to remember that $conf is optional here, because contexts are not always created from the UI.
1 string reference to 'ctools_context_create_term'
File
- plugins/
contexts/ term.inc, line 37 - Plugin to provide a term context
Code
function ctools_context_create_term($empty, $data = NULL, $conf = FALSE) {
$context = new ctools_context('term');
$context->plugin = 'term';
if ($empty) {
return $context;
}
if ($conf && isset($data['tid'])) {
$data = taxonomy_get_term($data['tid']);
}
if (!empty($data)) {
$context->data = $data;
$context->title = $data->name;
$context->argument = $data->tid;
$context->description = $data->description;
return $context;
}
}