? node_invite_dynamic_arguments.patch
Index: node_invite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_invite/node_invite.module,v
retrieving revision 1.10
diff -u -p -r1.10 node_invite.module
--- node_invite.module	17 Jul 2009 13:24:35 -0000	1.10
+++ node_invite.module	24 Aug 2009 17:20:55 -0000
@@ -85,35 +85,35 @@ function node_invite_menu() {
 		'weight' => 2,
 		'file' => 'node_invite.admin.inc',
 	);
-	$items['node_invite/invite'] = array(
+	$items['node_invite/invite/%'] = array(
 		'title' => t('Invite'),
 		'type' => MENU_CALLBACK,
 		'access arguments' => array('invite users to invite-enabled nodes'),
 		'page callback' => 'drupal_get_form',
-		'page arguments' => array('node_invite_send'),
+		'page arguments' => array('node_invite_send', 2),
 		'file' => 'node_invite.send.inc',
 	);
-	$items['node_invite/rsvp'] = array(
+	$items['node_invite/rsvp/%node/%'] = array(
 		'title' => t('Invite'),
 		'type' => MENU_CALLBACK,
 		'access arguments' => array('respond to invites'),
 		'page callback' => 'drupal_get_form',
-		'page arguments' => array('node_invite_rsvp'),
+		'page arguments' => array('node_invite_rsvp', 2, 3),
 		'file' => 'node_invite.rsvp.inc',
 	);
-	$items['node_invite/revoke'] = array(
+	$items['node_invite/revoke/%'] = array(
 		'title' => t('Revoke'),
 		'type' => MENU_CALLBACK,
 		'access callback' => 'node_invite_access_revoke',
 		'page callback' => 'drupal_get_form',
-		'page arguments' => array('node_invite_revoke'),
+		'page arguments' => array('node_invite_revoke', 2),
 	);
-	$items['node_invite/resend'] = array(
+	$items['node_invite/resend/%'] = array(
 		'title' => t('Resend'),
 		'type' => MENU_CALLBACK,
 		'access callback' => 'node_invite_access_resend',
 		'page callback' => 'drupal_get_form',
-		'page arguments' => array('node_invite_resend'),
+		'page arguments' => array('node_invite_resend', 2),
 	);
 	$items['user/%user/invites'] = array(
 		'title' => 'My Invites',
@@ -340,9 +340,8 @@ function node_invite_access_resend() {
 	return TRUE;
 }
 
-function node_invite_revoke() {
+function node_invite_revoke($form_state, $iid) {
 	// ask for confirmation that they really want to revoke the invite.
-	$iid = arg(2);
 	if ( !intval($iid) ) {
 		drupal_set_message("$iid is not a number.  This form should only be called with a invite-id as the 3rd argument in the URL.",'error');
 		return;
@@ -371,9 +370,8 @@ function node_invite_revoke_submit( $for
 	drupal_goto( $form_state['values']['referer'] );
 }
 
-function node_invite_resend() {
+function node_invite_resend($form_state, $iid) {
 	// ask for confirmation that they really want to revoke the invite.
-	$iid = arg(2);
 	if ( !intval($iid) ) {
 		drupal_set_message("$iid is not a number.  This form should only be called with a invite-id as the 3rd argument in the URL.",'error');
 		return;
Index: node_invite.rsvp.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_invite/node_invite.rsvp.inc,v
retrieving revision 1.1
diff -u -p -r1.1 node_invite.rsvp.inc
--- node_invite.rsvp.inc	21 Jan 2009 02:47:48 -0000	1.1
+++ node_invite.rsvp.inc	24 Aug 2009 17:20:55 -0000
@@ -1,28 +1,21 @@
 <?php
 
-function node_invite_rsvp() {
+function node_invite_rsvp($form_state, $node, $iid) {
 	// this form is probably being accessed by anonymous users.
 
-	// make sure that args 2 & 3 exist and that is's a number.
-	$nid = arg(2);
-	if ( !intval($nid) ) {
-		drupal_set_message("$nid is not a number.  This form should only be called with a node-id as the 2nd argument in the URL.",'error');
-		return;
-	}
-	$iid = arg(3);
+	// make sure that iid is a number.
 	if ( !intval($iid) ) {
 		drupal_set_message("$iid is not a number.  This form should only be called with a invite-id as the 3rd argument in the URL.",'error');
 		return;
 	}
 
-	$q = db_query("SELECT * FROM {node_invites} WHERE nid = %d AND iid = %d", $nid, $iid);
+	$q = db_query("SELECT * FROM {node_invites} WHERE nid = %d AND iid = %d", $node->nid, $iid);
 	$invite = db_fetch_array( $q );
 	if ( !$invite ) {
 		drupal_set_message(t("This URL is invalid (iid/nid mismatch)"),'error');
 		return;
 	}
 
-	$node = node_load( $nid );
 	$page_title = token_replace( 
 		variable_get('node_invite_rsvp_page_title',NODE_INVITE_RSVP_PAGE_TITLE),
 		'node',
@@ -85,7 +78,7 @@ function node_invite_rsvp() {
 	// hidden vars for tracking
 	$form['nid'] = array(
 		'#type' => 'value',
-		'#value' => $nid
+		'#value' => $node->nid
 	);
 	$form['iid'] = array(
 		'#type' => 'value',
Index: node_invite.send.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_invite/node_invite.send.inc,v
retrieving revision 1.3
diff -u -p -r1.3 node_invite.send.inc
--- node_invite.send.inc	16 Feb 2009 02:37:41 -0000	1.3
+++ node_invite.send.inc	24 Aug 2009 17:20:55 -0000
@@ -1,10 +1,9 @@
 <?php
 
-function node_invite_send() {
+function node_invite_send($form_state, $nid) {
 	global $user;
 
 	// make sure that arg(2) exists and that is's a number.
-	$nid = arg(2);
 	if ( !intval($nid) ) {
 		drupal_set_message("$nid is not a number.  This form should only be called with a node-id as the 2nd argument in the URL.",'error');
 		return;
