Index: multivariate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/multivariate/multivariate.module,v
retrieving revision 1.11
diff -u -r1.11 multivariate.module
--- multivariate.module	21 Aug 2009 18:15:23 -0000	1.11
+++ multivariate.module	21 Aug 2009 18:26:36 -0000
@@ -275,6 +275,38 @@
 }
 
 /**
+ * Generates an array of CSS classes that can be applied in a theme.
+ *
+ * The CSS classes can be applied to the body tag of the page and used to
+ * perform mutations through CSS instead of purely code. This should be called
+ * from the theme and the classes should be placed on the body tag. This can be
+ * done inside phptemplate_body_class(). The classes can be turned into a
+ * string with the following sniplet.
+ * <code>
+ *   implode(' ', $classes);
+ * </code>
+ *
+ * @return array List of CSS classes representing the current mutation state.
+ *   The classes follow the format: "multivariate-[GROUP]-[STATE]".
+ *   <code>
+ *     array(
+ *       'multivaraite-0-2',
+ *       'multivaraite-1-1',
+ *     );
+ *   </code>
+ */
+function multivariate_mutation_classes_get() {
+  $classes = array();
+  $mutation = multivariate_mutation_get(24);
+  foreach ($mutation as $group => $state) {
+    if (is_numeric($group)) {
+      $classes[] = 'multivariate-' . $group . '-' . $state;
+    }
+  }
+  return $classes;
+}
+
+/**
  * Get the mutation definition based on the study type.
  *
  * @param object $study Study node object.
