Index: addanother.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/addanother/addanother.install,v
retrieving revision 1.1
diff -u -r1.1 addanother.install
--- addanother.install	15 Jan 2009 23:22:22 -0000	1.1
+++ addanother.install	15 Jan 2009 23:12:54 -0000
@@ -1,18 +1,13 @@
 <?php
-// $Id: addanother.install,v 1.1 2009/01/15 23:22:22 robinmonks Exp $
-/**
- * @file
- * Uninstall and update routines for AddAnother module.
- */
 /**
  * Implementation of hook_uninstall().
- */
+ */ 
 function addanother_uninstall() {
   variable_del('addanother_nodetypes');
 }
 /**
  * Port over to the new variable storage system.
- */
+ */ 
 function addanother_update_1() {
   $types = node_get_types();
   $addanother_nodetypes = array();
Index: addanother.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/addanother/addanother.module,v
retrieving revision 1.3
diff -u -r1.3 addanother.module
--- addanother.module	15 Jan 2009 23:22:22 -0000	1.3
+++ addanother.module	16 Jan 2009 16:53:04 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: addanother.module,v 1.3 2009/01/15 23:22:22 robinmonks Exp $
+// $Id: addanother.module,v 1.2 2009/01/12 21:47:48 robinmonks Exp $
 /**
  * @file
  * Presents users with an option to create another node of the same type after a
@@ -63,11 +63,30 @@
     case 'insert':
       $allowed_nodetypes = variable_get('addanother_nodetypes', array());
       if (user_access('enable add another') && $allowed_nodetypes[$node->type]) {
-        drupal_set_message(t('Add another <a href="@typeurl">%type</a>.', array(
+        global $addanother_message;
+        $addanother_message = t('Add another <a href="@typeurl">%type</a>.', array(
           '@typeurl' => url('node/add/'. str_replace('_', '-', $node->type)),
           '%type' => node_get_types('name', $node)
-          )));
+          ));
       }
       break;
   }
 }
+
+/**
+ * Implementation of hook_form_alter().
+ */ 
+function addanother_form_alter(&$form, &$form_state, $form_id) {
+  if (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id) {
+    $form['buttons']['submit']['#submit'][] = '_addanother_message';
+  }
+}
+/**
+ * Display the Add Another message if set by addanother_nodeapi().
+ */ 
+function _addanother_message($form, &$form_state) {
+  global $addanother_message;
+  if (isset($addanother_message)) {
+    drupal_set_message($addanother_message, 'status', FALSE);
+  }
+}
