Commit 1b7dc348 authored by nrambeck's avatar nrambeck Committed by Nedjo Rogers

Issue #1271324 by eric.napier, nedjo, nrambeck: Taxonomy term pages managed by...

Issue #1271324 by eric.napier, nedjo, nrambeck: Taxonomy term pages managed by Panels don't trigger Context's "Taxonomy term" condition
parent cedb5eb5
......@@ -94,11 +94,27 @@ function context_theme_registry_alter(&$theme_registry) {
*/
function context_ctools_render_alter($info, $page, $data) {
extract($data);
if ($page && in_array($task['name'], array('node_view', 'node_edit'), TRUE)) {
foreach ($contexts as $ctools_context) {
if (in_array('node', $ctools_context->type) && !empty($ctools_context->data)) {
context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form');
break;
// Check for page handlers.
if ($page) {
// Check for node page handler.
if (in_array($task['name'], array('node_view', 'node_edit'), TRUE)) {
foreach ($contexts as $ctools_context) {
if (in_array('node', $ctools_context->type) && !empty($ctools_context->data)) {
context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form');
break;
}
}
}
// Check for taxonomy term page handler.
elseif (in_array($task['name'], array('term_view', 'term_edit'), TRUE)) {
foreach ($contexts as $ctools_context) {
if (in_array('taxonomy_term', $ctools_context->type) && !empty($ctools_context->data)) {
if ($plugin = context_get_plugin('condition', 'taxonomy_term')) {
$plugin->execute($ctools_context->data, $task['name'] === 'term_view' ? 'view' : 'form');
}
break;
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment