? plugins
Index: smackdown.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/smackdown/smackdown.module,v
retrieving revision 1.1.2.5.2.19
diff -u -p -r1.1.2.5.2.19 smackdown.module
--- smackdown.module	23 Oct 2009 17:30:55 -0000	1.1.2.5.2.19
+++ smackdown.module	30 Jun 2010 17:11:21 -0000
@@ -10,11 +10,18 @@
  */
  
 /**
- * Implementation of hook_init().
+ * Implementation of hook_context_page_condition().
  */
-function smackdown_init() {
+function smackdown_context_page_condition() {
   if ($_GET['smackdown_vote'] && module_exists('context')) {
-    context_set_by_condition('smackdown', TRUE);
+    if (function_exists('context_ctools_plugin_api')) {
+      if ($plugin = context_get_plugin('condition', 'smackdown_vote')) {
+        $plugin->execute(1);
+      }
+    }
+    else {
+      context_set_by_condition('smackdown', TRUE);
+    }
   }
 }
 
@@ -36,6 +43,50 @@ function smackdown_context_conditions() 
 }
 
 /**
+ * Conext 3 Integration
+ */
+
+/**
+ * Implementation of hook_ctools_plugin_api().
+ */
+function smackdown_ctools_plugin_api($module, $api) {
+  if ($module == 'context' && $api == 'plugins') {
+    return array('version' => 3);
+  }
+}
+
+/**
+ * Implementation of hook_context_plugins()
+ */
+function smackdown_context_plugins() {
+  $plugins = array();
+  $plugins['smackdown_context_condition_vote'] = array(
+    'handler' => array(
+      'path' => drupal_get_path('module', 'smackdown') . '/plugins',
+      'file' => 'smackdown_context_condition_vote.inc',
+      'class' => 'smackdown_context_condition_vote',
+      'parent' => 'context_condition',
+    ),
+  );
+  return $plugins;
+}
+
+/**
+ * Implemenation of hook_context_registry()
+ */
+function smackdown_context_registry() {
+  return array(
+    'conditions' => array(
+      'smackdown_vote' => array(
+        'title' => t('Smackdown Vote'),
+        'description' => t('Smackdown Vote Just Placed'),
+        'plugin' => 'smackdown_context_condition_vote',
+      ),
+    ),
+  );
+}
+
+/**
  * Implementation of hook_perm().
  */
 function smackdown_perm() {
Index: plugins/smackdown_context_condition_vote.inc
===================================================================
RCS file: smackdown_context_condition_vote.inc
diff -N smackdown_context_condition_vote.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plugins/smackdown_context_condition_vote.inc	30 Jun 2010 17:11:21 -0000
@@ -0,0 +1,19 @@
+<?php
+// $Id:$
+
+/**
+ * @file Context Condition
+ */
+
+class smackdown_context_condition_vote extends context_condition {
+  function condition_values() {
+    return array(1 => t('Just Voted'));
+  }
+
+  function editor_form($context = NULL) {
+    $form = parent::editor_form($context);
+    $form[1]['#title'] = t('Just Voted');
+    $form['#weight'] = -10;
+    return $form;
+  }
+}
\ No newline at end of file
