summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--context_contrib/context_contrib.module26
1 files changed, 26 insertions, 0 deletions
diff --git a/context_contrib/context_contrib.module b/context_contrib/context_contrib.module
index 95dc4c9..1de5681 100644
--- a/context_contrib/context_contrib.module
+++ b/context_contrib/context_contrib.module
@@ -32,6 +32,21 @@ function context_contrib_context_conditions() {
);
}
+
+ // CCK
+ if (module_exists('content')) {
+ foreach (content_fields() as $field) {
+ if ($options = content_allowed_values($field)) {
+ $items[$field['field_name']] = array(
+ '#title' => $field['widget']['label'],
+ '#type' => 'checkboxes',
+ '#options' => $options,
+ '#description' => filter_xss_admin($field['widget']['description']),
+ );
+ }
+ }
+ }
+
return $items;
}
@@ -64,6 +79,17 @@ function context_contrib_nodeapi(&$node, $op, $teaser, $page) {
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']);
+ }
+ }
+ }
+ }
}
}