? 935652.patch
Index: API.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/API.txt,v
retrieving revision 1.1.2.11
diff -u -p -r1.1.2.11 API.txt
--- API.txt	30 Sep 2010 14:44:52 -0000	1.1.2.11
+++ API.txt	8 Oct 2010 08:58:15 -0000
@@ -16,6 +16,7 @@ Table of contents
 11. General CSS styles.
 12. Skins
 13. Theme extensions.
+14. hook_sweaver_action().
 
 ------------------------------------------------------
 1. Hook for cTools
@@ -364,3 +365,13 @@ are to be used instead of those in the d
 
 Note: if you add new selectors but they don't show up,
 then you need to clear the theme registry.
+
+------------------------------------------------------
+14. hook_sweaver_action($action, $arguments).
+------------------------------------------------------
+
+If you want other modules to act on certain actions happening in sweaver use
+module_invoke_all('sweaver', 'action_name', $arguments);
+
+Currently the Theme switch plugin is the first plugin calling this
+so other modules can perform actions when switching theme.
Index: plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc,v
retrieving revision 1.1.2.13
diff -u -p -r1.1.2.13 sweaver_plugin_themeswitch.inc
--- plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc	2 Oct 2010 02:03:33 -0000	1.1.2.13
+++ plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc	8 Oct 2010 08:58:15 -0000
@@ -117,6 +117,13 @@ class sweaver_plugin_themeswitch extends
         sweaver_session(NULL, 'sweaver_theme', TRUE);
       }
 
+      // Let other modules act on the themeswitch.
+      $arguments = array(
+        'switched_theme' => $theme,
+        'default_theme' => $theme_default,
+      );
+      module_invoke_all('sweaver_action', 'theme_switch', $arguments);
+
       sweaver_session(t('You have switched to @switched_theme.', array('@switched_theme' => $all_themes[$theme]->info['name'])));
     }
 
