function context_contrib_node_condition in Context 6.2
Centralized node condition call function for the ever increasing number of ways to get at a node view / node form.
2 calls to context_contrib_node_condition()
- context_contrib_ctools_render_alter in context_contrib/
context_contrib.module - Implementation of hook_ctools_render_alter().
- context_contrib_nodeapi in context_contrib/
context_contrib.module - Implementation of hook_nodeapi().
File
- context_contrib/
context_contrib.module, line 109
Code
function context_contrib_node_condition(&$node, $op) {
// Implementation of context for nodequeue.
if (module_exists('nodequeue')) {
$result = db_query("SELECT qid FROM {nodequeue_nodes} WHERE nid = %d", $node->nid);
while ($qid = db_fetch_object($result)) {
context_set_by_condition('nodequeue', $qid->qid);
}
}
// Implementation of context for CCK.
if (module_exists('content')) {
foreach (content_fields() as $field) {
if (isset($node->{$field}['field_name']) && ($options = content_allowed_values($field))) {
foreach ($node->{$field}['field_name'] as $item) {
context_set_by_condition($field['field_name'], $item['value']);
}
}
}
}
}