? .DS_Store
? activity_comments
? activity_comments.zip
Index: activity-message.tpl.php
===================================================================
RCS file: activity-message.tpl.php
diff -N activity-message.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ activity-message.tpl.php	24 Oct 2009 23:38:19 -0000
@@ -0,0 +1,16 @@
+<?php
+// $Id: $
+
+/**
+ * @file
+ * provides the basic template file for activity message
+ *
+ * Available variables:
+ *
+ * - $message: the token replaced message
+ * - $objects: an array of objects that were used to generate that message
+ * - $op: The trigger op that fired the action
+ * - $hook: the hook that fired the action
+ */
+?>
+<?php print $message; ?>
\ No newline at end of file
Index: activity.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/activity/activity.module,v
retrieving revision 1.1.2.2.2.30.2.31.2.62
diff -u -p -r1.1.2.2.2.30.2.31.2.62 activity.module
--- activity.module	21 Oct 2009 06:08:12 -0000	1.1.2.2.2.30.2.31.2.62
+++ activity.module	24 Oct 2009 23:38:19 -0000
@@ -494,6 +494,10 @@ function activity_record($object, $conte
       $patterns[$id][$object_name] = $context["$object_name-pattern-{$id}"];
     }
   }
+  
+  // Determine the possible theme functions for the given hook, op combo
+  $theme_options = activity_theme_suggestions($context['hook'], $context['op'], $context['activity_types']);
+  
   // $messages is keyed by language -> uid
   $messages = array();
 
@@ -503,14 +507,14 @@ function activity_record($object, $conte
       if (!empty($types[$target_key])) {
         $message = token_replace_multiple($message, $types, '[', ']', array(), TRUE);
         if (!empty($message)) {
-          $messages[$language_id][intval($types[$target_key]->uid)] = $message;
+          $messages[$language_id][intval($types[$target_key]->uid)] = theme($theme_options, $message, $types, $context['op'], $context['hook']);
         }
       }
     }
     // and now do the everyone else pattern
     $everyone_message = token_replace_multiple($context['everyone-pattern-' . $language_id], $types, '[', ']', array(), TRUE);
     if (!empty($everyone_message)) {
-      $messages[$language_id][0] = $everyone_message;
+      $messages[$language_id][0] = theme($theme_options, $everyone_message, $types, $context['op'], $context['hook']);
     }
   }
   // create a record
@@ -726,6 +730,29 @@ function activity_enabled_languages() {
 }
 
 /**
+ * Determine the theme sugguestions for the given hook/op/types
+ *
+ * @param $hook
+ *  the trigger hook that created the action
+ *
+ * @param $op
+ *  the trigger op that created the action
+ *
+ * @return array()
+ *  an array of strings representing possible theme() function names
+ */
+function activity_theme_suggestions($hook, $op, $types = NULL) {
+  $options = array();
+  if (isset($types)) {
+    $options[] = 'activity_message__' . $hook . '__' . $op . '__' . implode('_', $types);
+  }
+  $options[] = 'activity_message__' . $hook . '__' . $op;
+  $options[] = 'activity_message__' . $hook;
+  $options[] = 'activity_message';
+  return $options;
+}
+
+/**
  * Implementation of hook_theme().
  */
 function activity_theme($existing, $type, $theme, $path) {
@@ -739,6 +766,11 @@ function activity_theme($existing, $type
     'activity_username' => array(
       'arguments' => array('account' => NULL),
     ),
+    'activity_message' => array(
+      'arguments' => array('message' => '', 'objects' => NULL, 'op' => NULL, 'hook' => NULL),
+      'template' => 'activity-message',
+      'pattern' => 'activity_message__',
+    ),
   );
 }
 
