? plus1-d7.patch
Index: plus1.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/plus1/plus1.info,v
retrieving revision 1.1.4.1
diff -u -p -r1.1.4.1 plus1.info
--- plus1.info	7 Sep 2008 22:14:32 -0000	1.1.4.1
+++ plus1.info	1 Jul 2009 07:44:41 -0000
@@ -3,4 +3,7 @@ name = Plus 1
 description = "A +1 voting widget for nodes."
 package = Voting
 dependencies[] = votingapi
-core = 6.x
\ No newline at end of file
+core = 7.x
+
+files[] = plus1.module
+files[] = plus1.install
\ No newline at end of file
Index: plus1.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/plus1/plus1.module,v
retrieving revision 1.1.4.8
diff -u -p -r1.1.4.8 plus1.module
--- plus1.module	18 Mar 2009 05:04:42 -0000	1.1.4.8
+++ plus1.module	1 Jul 2009 07:44:41 -0000
@@ -9,7 +9,16 @@
 * Implementation of hook_perm().
 */
 function plus1_perm() {
-  return array('vote on content', 'administer the voting widget');
+  return array(
+    'vote on content' =>  array(
+      'title' => t('Vote on content'),
+      'description' => t('Cast votes on site content using the Plus1 voting widget.'),
+    ),
+    'administer the voting widget' =>  array(
+      'title' => t('Administer the voting widget'),
+      'description' => t('Make configuration changes to the Plus1 voting widget.'),
+    ),
+  );
 }
 
 /**
@@ -18,7 +27,7 @@ function plus1_perm() {
 function plus1_menu() {
 
   $items['plus1/vote/%'] = array(
-    'title' => t('Vote'),
+    'title' => 'Vote',
     'page callback' => 'plus1_vote',
     'page arguments' => array(2),
     'access arguments' => array('vote on content'),
@@ -26,8 +35,8 @@ function plus1_menu() {
   );
 
   $items['admin/settings/plus1'] = array(
-    'title' => t('Plus 1'),
-    'description' => t('Allows readers to vote on content.'),
+    'title' => 'Plus 1',
+    'description' => 'Allows readers to vote on content.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('plus1_settings'),
     'access arguments' => array('administer the voting widget'),
@@ -56,7 +65,7 @@ function plus1_settings() {
 
   $form['plus1_nodetypes_fieldset']['plus1_nodetypes'] = array(
     '#type' => 'checkboxes',
-    '#options' => node_get_types('names'),
+    '#options' => node_type_get_names(),
     '#default_value' => variable_get('plus1_nodetypes', array('story')),
   );
 
@@ -215,31 +224,32 @@ function plus1_jquery_widget($node, $tea
 }
 
 /**
-* Implementation of hook_nodeapi().
+* Implementation of hook_nodeapi_view().
 */
-function plus1_nodeapi(&$node, $op, $teaser, $page) {
-  switch ($op) {
-    case 'view':
-      // Only show the voting widget in allowed content types.
-      if (in_array($node->type, variable_get('plus1_nodetypes', array('story')))) {
-        // Show the widget.
-        if (($teaser && variable_get('plus1_in_teaser', 0)) || (!$teaser && variable_get('plus1_in_full_view', 1))) {
-          $node->content['plus1_widget'] = array(
-            '#value' => plus1_jquery_widget($node, $teaser, $page),
-            '#weight' => (int) variable_get('plus1_weight', '100'),
-          );
-        }
-      }
-      break;
-    case 'delete':
-      $criteria['content_id'] = $node->nid;
-      $votes = votingapi_select_votes($criteria);
-      votingapi_delete_votes($votes);
-      break;
+function plus1_node_view(&$node, $build_mode) {
+  // Only show the voting widget in allowed content types.
+  if (in_array($node->type, variable_get('plus1_nodetypes', array('story')))) {
+    // Show the widget.
+    if (($build_mode == 'teaser' && variable_get('plus1_in_teaser', 0)) || ($build_mode == 'full' && variable_get('plus1_in_full_view', 1))) {
+      $node->content['plus1_widget'] = array(
+        '#markup' => plus1_jquery_widget($node, ($build_mode == 'teaser'), FALSE),
+        '#weight' => (int) variable_get('plus1_weight', '100'),
+      );
+    }
   }
 }
 
 /**
+* Implementation of hook_nodeapi_delete().
+*/
+function plus1_node_delete(&$node) {
+  $criteria['content_id'] = $node->nid;
+  $votes = votingapi_select_votes($criteria);
+  votingapi_delete_votes($votes);
+  break;
+}
+
+/**
 * Implementation of hook_theme().
 */
 function plus1_theme() {
