--- lm_paypal_donations.module.orig 2007-08-23 21:31:40.000000000 -0400 +++ lm_paypal_donations.module 2007-08-23 22:37:21.000000000 -0400 @@ -292,7 +292,7 @@ function lm_paypal_process_in_donate($ip * @param $ccc * A PayPal 3 letter currency code for the donation (e.g: USD). * @param $name - * The name of the donation, displayed on PayPal donate form + * The name of the donation, displayed on PayPal donate form. If it is an array, it must be a sinle-element array and will be the default value of the item name. * @param $button_url * The url of button to click on to make the donation * @param $amount_label @@ -313,7 +313,7 @@ function lm_paypal_donate($amount = '', global $_lm_paypal_js_hide_email; if (!user_access('access lm_paypal_donate')) { - return t('Access to PayPal donatation buttons denied'); + return t('Access to PayPal donation buttons denied'); } if ($button_url == '') { @@ -360,6 +360,12 @@ function lm_paypal_donate($amount = '', $name = t('Donate %amount', array('%amount', $d)); } + if (is_array($name)) { + $name_type = "text"; + $name = $name[0]; + } else { + $name_type = "hidden"; + } $name = check_plain($name); $biz = check_plain($_lm_paypal_business); @@ -404,9 +410,15 @@ function lm_paypal_donate($amount = '', // tr valign=\"baseline\" $form .= "
$ta $sa |
"; } + if ($name_type == 'text') { + $form .= t('Reason: '); + } + $form .= "\n"; + if ($name_type == 'text') { + $form .= ' |
'; + } $form .= "\n"; $form .= "\n"; - $form .= "\n"; $form .= "\n"; // item_number 0 is a donation // The only downside of setting the item number is that PayPal may display |