Permalink
Browse files

Fix include javascript without donate options & incorrect form labels

  • Loading branch information...
1 parent e422676 commit 6cf28a3c68288727bf8d1c182ae497bffe652bc3 @aimakun aimakun committed Mar 15, 2011
Showing with 9 additions and 3 deletions.
  1. +3 −3 paypal_donate.module
  2. +6 −0 paypal_form.tpl.php
View
@@ -170,14 +170,14 @@ function paypal_donate_form(&$node) {
$form['donate_options'] = array(
'#type' => 'textarea',
'#default_value' => variable_get('paypal_donate_options_' . $node->nid, ''),
- '#title' => t('Global options'),
- '#description' => t('One item per line, this would appear dropdown selection in Paypal form.'),
+ '#title' => t('Donate options'),
+ '#description' => t('One item per line, this would appear dropdown selection in Paypal form, leave blank for use default "Donation" and hide dropdown from page.'),
);
$form['donate_currency'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('paypal_donate_currency_' . $node->nid, 'USD'),
- '#title' => t('Global currency code'),
+ '#title' => t('Currency code'),
'#description' => t('See currency code in !link, default: USD', array('!link' => l('Paypal Currency Codes', 'https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_currency_codes', array('attributes' => array('target' => '_blank'))))),
);
View
@@ -34,6 +34,9 @@
<input type="image" id="donate_button" src="https://www.paypal.com/en_GB/TH/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
+ <?php
+ if (!empty($options)):
+ ?>
<script type="text/javascript">
$('#paypal_donate_form').submit( function() {
var item_names = [];
@@ -45,6 +48,9 @@
$('input[name="item_name"]').val(item_names.join(' + '));
});
</script>
+ <?php
+ endif;
+ ?>
</div>
<?php /*
<form action="http://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

0 comments on commit 6cf28a3

Please sign in to comment.