July 2010
Integrating Some Other Feature with Spaces
grayside — Fri, 07/23/2010 - 08:10
I have found more than once a situation in which I had a basic feature that could be used on any site which I would like to see integrated with Spaces (for OpenAtrium magic). It usually runs like this:
- I have the FeatureServer feature.
- I want it in OpenAtrium.
- Here’s a new Feature that provides some Contexts and some Groups variables.
- Here’s a patch that you must apply to FeatureServer to make Spaces aware of it. (And other stuff).
Spaces Integrating a CCK Field
grayside — Mon, 07/26/2010 - 12:25
I wanted to make a CCK Field available only when a given feature was enabled. It turns out it’s really easy.
CCK comes with a hook_field_access() hook (see content_access()). Any implementation of this function that returns FALSE for a given field results in that field being denied to the user.
By implementing this function with a Spaces API call instead of the content_permissions module approach of a new, field-specific permission, all kinds of magic becomes possible.
Read on for demonstration code.