Version Description
Download this release
Release Info
Developer | artstorm |
Plugin | PayPal Donations |
Version | 1.8 |
Comparing to | |
See all releases |
Code changes from version 1.7 to 1.8
- assets/tabs.css +15 -0
- assets/tabs.js +13 -0
- lang/paypal-donations-sv_SE.mo +0 -0
- lang/paypal-donations-sv_SE.po +129 -68
- lang/paypal-donations.pot +90 -70
- lib/PayPalDonations/Admin.php +593 -6
- lib/PayPalDonations/Help.php +22 -0
- paypal-donations.php +19 -76
- phpunit.xml +2 -2
- readme.txt +37 -7
- {tests → utest}/PayPalDonationsTest.php +0 -0
- {tests → utest}/bootstrap.php +0 -0
- views/admin.php +19 -135
- views/paypal-button.php +2 -0
assets/tabs.css
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#paypal-donations-tabs {
|
2 |
+
margin: 0;
|
3 |
+
}
|
4 |
+
|
5 |
+
#paypal-donations-tabs li {
|
6 |
+
cursor: pointer;
|
7 |
+
}
|
8 |
+
|
9 |
+
#paypal-donations-tabs-content > div {
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
#paypal-donations-tabs-content > #paypal-donations-tab-content-1 {
|
14 |
+
display: block;
|
15 |
+
}
|
assets/tabs.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
$("#paypal-donations-tabs li").each(function() {
|
3 |
+
$(this).click(function() {
|
4 |
+
var tabId = $(this).attr('id');
|
5 |
+
var tabId = tabId.split('_');
|
6 |
+
var tabContent = document.getElementById('paypal-donations-tab-content-' + tabId[1]);
|
7 |
+
tabContent.style.display = 'block';
|
8 |
+
$(this).addClass('nav-tab-active');
|
9 |
+
$(this).siblings().removeClass('nav-tab-active');
|
10 |
+
$(tabContent).siblings().css('display','none');
|
11 |
+
});
|
12 |
+
});
|
13 |
+
});
|
lang/paypal-donations-sv_SE.mo
CHANGED
Binary file
|
lang/paypal-donations-sv_SE.po
CHANGED
@@ -2,171 +2,232 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: PayPal Donations\n"
|
4 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/paypal-donations\n"
|
5 |
-
"POT-Creation-Date:
|
6 |
"PO-Revision-Date: \n"
|
7 |
-
"Last-Translator:
|
8 |
-
"Language-Team:
|
|
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-
|
13 |
-
"X-Poedit-Country: SWEDEN\n"
|
14 |
|
15 |
-
#:
|
|
|
|
|
|
|
|
|
16 |
msgid "PayPal Account"
|
17 |
msgstr "PayPal Konto"
|
18 |
|
19 |
-
#:
|
20 |
-
|
|
|
21 |
msgstr "Din PayPal epost adress eller ditt PayPal secure merchant konto ID."
|
22 |
|
23 |
-
#:
|
24 |
msgid "Currency"
|
25 |
msgstr "Valuta"
|
26 |
|
27 |
-
#:
|
28 |
msgid "The currency to use for the donations."
|
29 |
msgstr "Valutan som doneringarna ska ges i."
|
30 |
|
31 |
-
#:
|
32 |
msgid "Optional Settings"
|
33 |
msgstr "Valfria inställningar"
|
34 |
|
35 |
-
#:
|
36 |
msgid "Page Style"
|
37 |
msgstr "Sido Stil"
|
38 |
|
39 |
-
#:
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
#:
|
44 |
msgid "Return Page"
|
45 |
msgstr "Återvändings Sida"
|
46 |
|
47 |
-
#:
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
#:
|
52 |
msgid "Defaults"
|
53 |
msgstr "Förval"
|
54 |
|
55 |
-
#:
|
56 |
msgid "Amount"
|
57 |
msgstr "Summa"
|
58 |
|
59 |
-
#:
|
60 |
msgid "The default amount for a donation (Optional)."
|
61 |
msgstr "Den förvalda summan för en donation (Valfri)."
|
62 |
|
63 |
-
#:
|
64 |
msgid "Purpose"
|
65 |
msgstr "Syfte"
|
66 |
|
67 |
-
#:
|
68 |
msgid "The default purpose of a donation (Optional)."
|
69 |
msgstr "Det förvalda syftet för en donering (Valfri)."
|
70 |
|
71 |
-
#:
|
72 |
msgid "Reference"
|
73 |
msgstr "Referens"
|
74 |
|
75 |
-
#:
|
76 |
msgid "Default reference for the donation (Optional)."
|
77 |
msgstr "Den förvalda referensen för en donering (Valfri)."
|
78 |
|
79 |
-
#:
|
80 |
msgid "Donation Button"
|
81 |
msgstr "Donerings Knapp"
|
82 |
|
83 |
-
#:
|
84 |
msgid "Select Button"
|
85 |
msgstr "Välj Knapp"
|
86 |
|
87 |
-
#:
|
88 |
-
|
89 |
-
|
|
|
90 |
|
91 |
-
#:
|
92 |
msgid "Enter a URL to a custom donation button."
|
93 |
msgstr "Ange en URL till en egen donerings knapp."
|
94 |
|
95 |
-
#:
|
96 |
msgid "Country and Language"
|
97 |
msgstr "Land och Språk"
|
98 |
|
99 |
-
#:
|
100 |
-
msgid "Localize the language and the country for the button
|
101 |
-
msgstr "Ställ in språk och land för knappen
|
102 |
|
103 |
-
#:
|
104 |
msgid "Extras"
|
105 |
msgstr "Extra"
|
106 |
|
107 |
-
#:
|
108 |
msgid "Disable PayPal Statistics"
|
109 |
msgstr "Stäng av PayPals statistik insamling"
|
110 |
|
111 |
-
#:
|
112 |
msgid "Theme CSS Override: Center Button"
|
113 |
msgstr "Lägg till CSS som överskrider temat: Centrera knappen"
|
114 |
|
115 |
-
#:
|
116 |
-
msgid "
|
|
|
|
|
|
|
|
|
117 |
msgstr "Sätt språk för checkout"
|
118 |
|
119 |
-
#:
|
120 |
-
msgid "
|
121 |
-
msgstr "
|
|
|
|
|
|
|
|
|
122 |
|
123 |
-
#: paypal-donations.php:
|
124 |
-
msgid "
|
125 |
-
msgstr "
|
126 |
|
127 |
-
#: paypal-donations.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
msgid "PayPal Donation Button"
|
129 |
msgstr "PayPal Donerings Knapp"
|
130 |
|
131 |
-
#: paypal-donations.php:
|
132 |
msgid "Donate"
|
133 |
msgstr "Donera"
|
134 |
|
135 |
-
#: paypal-donations.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
msgid "Title:"
|
137 |
msgstr "Titel:"
|
138 |
|
139 |
-
#: paypal-donations.php:
|
140 |
msgid "Text:"
|
141 |
msgstr "Text:"
|
142 |
|
143 |
-
#: paypal-donations.php:
|
144 |
msgid "Purpose:"
|
145 |
msgstr "Syfte:"
|
146 |
|
147 |
-
#: paypal-donations.php:
|
148 |
msgid "Reference:"
|
149 |
msgstr "Referens:"
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
msgstr "http://wpstorm.net/wordpress-plugins/paypal-donations/"
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
msgstr "Johan Steen"
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
msgstr "http://johansteen.se/"
|
170 |
|
171 |
#~ msgid "PayPal Donations requires WordPress version 2.7 or later!"
|
172 |
#~ msgstr "PayPal Donations kräver WordPress version 2.7 eller nyare!"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: PayPal Donations\n"
|
4 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/paypal-donations\n"
|
5 |
+
"POT-Creation-Date: 2013-03-09 16:48+0700\n"
|
6 |
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: < >\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: sv_SE\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.5.5\n"
|
|
|
14 |
|
15 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:106
|
16 |
+
msgid "Account Setup"
|
17 |
+
msgstr "Konto inställningar"
|
18 |
+
|
19 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:112
|
20 |
msgid "PayPal Account"
|
21 |
msgstr "PayPal Konto"
|
22 |
|
23 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:119
|
24 |
+
#, fuzzy
|
25 |
+
msgid "Your PayPal Email or Secure Merchant Account ID."
|
26 |
msgstr "Din PayPal epost adress eller ditt PayPal secure merchant konto ID."
|
27 |
|
28 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:126
|
29 |
msgid "Currency"
|
30 |
msgstr "Valuta"
|
31 |
|
32 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:133
|
33 |
msgid "The currency to use for the donations."
|
34 |
msgstr "Valutan som doneringarna ska ges i."
|
35 |
|
36 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:141
|
37 |
msgid "Optional Settings"
|
38 |
msgstr "Valfria inställningar"
|
39 |
|
40 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:147
|
41 |
msgid "Page Style"
|
42 |
msgstr "Sido Stil"
|
43 |
|
44 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:154
|
45 |
+
#, fuzzy
|
46 |
+
msgid ""
|
47 |
+
"The name of a custom payment page style that exist in your\n"
|
48 |
+
" PayPal account profile."
|
49 |
+
msgstr ""
|
50 |
+
"Ange namnet av en egen sidostil för betalningar i din PayPal konto profil."
|
51 |
|
52 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:162
|
53 |
msgid "Return Page"
|
54 |
msgstr "Återvändings Sida"
|
55 |
|
56 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:169
|
57 |
+
#, fuzzy
|
58 |
+
msgid ""
|
59 |
+
"URL to which the donator comes to after completing the\n"
|
60 |
+
" donation; for example, a URL on your site that displays "
|
61 |
+
"a\n"
|
62 |
+
" \"Thank you for your donation\"."
|
63 |
+
msgstr ""
|
64 |
+
"URL som den som har donerat kommer till efter att ha fullföljt donationen; "
|
65 |
+
"till exempel, en URL på din sajt som visar ett \"Tack för din donation\"."
|
66 |
|
67 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:179
|
68 |
msgid "Defaults"
|
69 |
msgstr "Förval"
|
70 |
|
71 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:185
|
72 |
msgid "Amount"
|
73 |
msgstr "Summa"
|
74 |
|
75 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:192
|
76 |
msgid "The default amount for a donation (Optional)."
|
77 |
msgstr "Den förvalda summan för en donation (Valfri)."
|
78 |
|
79 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:199
|
80 |
msgid "Purpose"
|
81 |
msgstr "Syfte"
|
82 |
|
83 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:206
|
84 |
msgid "The default purpose of a donation (Optional)."
|
85 |
msgstr "Det förvalda syftet för en donering (Valfri)."
|
86 |
|
87 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:213
|
88 |
msgid "Reference"
|
89 |
msgstr "Referens"
|
90 |
|
91 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:220
|
92 |
msgid "Default reference for the donation (Optional)."
|
93 |
msgstr "Den förvalda referensen för en donering (Valfri)."
|
94 |
|
95 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:228
|
96 |
msgid "Donation Button"
|
97 |
msgstr "Donerings Knapp"
|
98 |
|
99 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:234
|
100 |
msgid "Select Button"
|
101 |
msgstr "Välj Knapp"
|
102 |
|
103 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:245
|
104 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:494
|
105 |
+
msgid "Custom Button"
|
106 |
+
msgstr "Egen Knapp"
|
107 |
|
108 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:252
|
109 |
msgid "Enter a URL to a custom donation button."
|
110 |
msgstr "Ange en URL till en egen donerings knapp."
|
111 |
|
112 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:259
|
113 |
msgid "Country and Language"
|
114 |
msgstr "Land och Språk"
|
115 |
|
116 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:266
|
117 |
+
msgid "Localize the language and the country for the button."
|
118 |
+
msgstr "Ställ in språk och land för knappen."
|
119 |
|
120 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:281
|
121 |
msgid "Extras"
|
122 |
msgstr "Extra"
|
123 |
|
124 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:287
|
125 |
msgid "Disable PayPal Statistics"
|
126 |
msgstr "Stäng av PayPals statistik insamling"
|
127 |
|
128 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:298
|
129 |
msgid "Theme CSS Override: Center Button"
|
130 |
msgstr "Lägg till CSS som överskrider temat: Centrera knappen"
|
131 |
|
132 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:309
|
133 |
+
msgid "Enable Checkout Language"
|
134 |
+
msgstr "Aktivera språk för checkout"
|
135 |
+
|
136 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:320
|
137 |
+
msgid "Checkout Language"
|
138 |
msgstr "Sätt språk för checkout"
|
139 |
|
140 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:331
|
141 |
+
msgid "Return Method"
|
142 |
+
msgstr "Återvändnings metod"
|
143 |
+
|
144 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:338
|
145 |
+
msgid "Takes effect only if the return page is set."
|
146 |
+
msgstr "Är bara aktuell om återvändnings sida är inställt."
|
147 |
|
148 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:356
|
149 |
+
msgid "Required fields."
|
150 |
+
msgstr "Dessa fällt måste fyllas i."
|
151 |
|
152 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:368
|
153 |
+
msgid ""
|
154 |
+
"Optional extra settings to fine tune the setup in certain\n"
|
155 |
+
" scenarios."
|
156 |
+
msgstr ""
|
157 |
+
"Valfria extra inställningar att finjustera pluginet med under vissa "
|
158 |
+
"omständigheter."
|
159 |
+
|
160 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:611
|
161 |
+
msgid "GET method (default)"
|
162 |
+
msgstr "GET metod (standard)"
|
163 |
+
|
164 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:612
|
165 |
+
msgid "GET method, no variables"
|
166 |
+
msgstr "GET metod, inga variabler"
|
167 |
+
|
168 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:613
|
169 |
+
msgid "POST method"
|
170 |
+
msgstr "POST metod"
|
171 |
+
|
172 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Widget.php:17
|
173 |
msgid "PayPal Donation Button"
|
174 |
msgstr "PayPal Donerings Knapp"
|
175 |
|
176 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Widget.php:86
|
177 |
msgid "Donate"
|
178 |
msgstr "Donera"
|
179 |
|
180 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/admin.php:8
|
181 |
+
msgid "General"
|
182 |
+
msgstr "Allmänt"
|
183 |
+
|
184 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/admin.php:9
|
185 |
+
msgid "Advanced"
|
186 |
+
msgstr "Avancerad"
|
187 |
+
|
188 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:2
|
189 |
msgid "Title:"
|
190 |
msgstr "Titel:"
|
191 |
|
192 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:8
|
193 |
msgid "Text:"
|
194 |
msgstr "Text:"
|
195 |
|
196 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:14
|
197 |
msgid "Purpose:"
|
198 |
msgstr "Syfte:"
|
199 |
|
200 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:20
|
201 |
msgid "Reference:"
|
202 |
msgstr "Referens:"
|
203 |
|
204 |
+
#~ msgid "Save Changes"
|
205 |
+
#~ msgstr "Spara Ändringar"
|
206 |
+
|
207 |
+
#~ msgid "The PayPal Donations settings have been updated."
|
208 |
+
#~ msgstr "PayPal Donation inställningarna har uppdaterats."
|
209 |
+
|
210 |
+
#~ msgid "PayPal Donations"
|
211 |
+
#~ msgstr "PayPal Donations"
|
212 |
|
213 |
+
#~ msgid "http://wpstorm.net/wordpress-plugins/paypal-donations/"
|
214 |
+
#~ msgstr "http://wpstorm.net/wordpress-plugins/paypal-donations/"
|
|
|
215 |
|
216 |
+
#~ msgid ""
|
217 |
+
#~ "Easy and simple setup and insertion of PayPal donate buttons with a "
|
218 |
+
#~ "shortcode or through a sidebar Widget. Donation purpose can be set for "
|
219 |
+
#~ "each button. A few other customization options are available as well."
|
220 |
+
#~ msgstr ""
|
221 |
+
#~ "Snabb och enkel installation och konfigurering av PayPal donerings "
|
222 |
+
#~ "knappar med en shortcode eller en Widget i sidopanelen. Syftet för "
|
223 |
+
#~ "doneringen kan defineras för varje knapp. Ett par andra inställningar är "
|
224 |
+
#~ "också tillgängliga."
|
225 |
|
226 |
+
#~ msgid "Johan Steen"
|
227 |
+
#~ msgstr "Johan Steen"
|
|
|
228 |
|
229 |
+
#~ msgid "http://johansteen.se/"
|
230 |
+
#~ msgstr "http://johansteen.se/"
|
|
|
231 |
|
232 |
#~ msgid "PayPal Donations requires WordPress version 2.7 or later!"
|
233 |
#~ msgstr "PayPal Donations kräver WordPress version 2.7 eller nyare!"
|
lang/paypal-donations.pot
CHANGED
@@ -2,177 +2,197 @@
|
|
2 |
# This file is distributed under the same license as the PayPal Donations package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: PayPal Donations 1.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/paypal-donations\n"
|
7 |
-
"POT-Creation-Date:
|
|
|
|
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
#:
|
16 |
msgid "PayPal Account"
|
17 |
msgstr ""
|
18 |
|
19 |
-
#:
|
20 |
-
msgid "Your PayPal
|
21 |
msgstr ""
|
22 |
|
23 |
-
#:
|
24 |
msgid "Currency"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#:
|
28 |
msgid "The currency to use for the donations."
|
29 |
msgstr ""
|
30 |
|
31 |
-
#:
|
32 |
msgid "Optional Settings"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#:
|
36 |
msgid "Page Style"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#:
|
40 |
msgid ""
|
41 |
-
"
|
42 |
-
"profile."
|
43 |
msgstr ""
|
44 |
|
45 |
-
#:
|
46 |
msgid "Return Page"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#:
|
50 |
msgid ""
|
51 |
-
"URL to which the donator comes to after completing the
|
52 |
-
"example, a URL on your site that displays
|
|
|
|
|
53 |
msgstr ""
|
54 |
|
55 |
-
#:
|
56 |
msgid "Defaults"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#:
|
60 |
msgid "Amount"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#:
|
64 |
msgid "The default amount for a donation (Optional)."
|
65 |
msgstr ""
|
66 |
|
67 |
-
#:
|
68 |
msgid "Purpose"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#:
|
72 |
msgid "The default purpose of a donation (Optional)."
|
73 |
msgstr ""
|
74 |
|
75 |
-
#:
|
76 |
msgid "Reference"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#:
|
80 |
msgid "Default reference for the donation (Optional)."
|
81 |
msgstr ""
|
82 |
|
83 |
-
#:
|
84 |
msgid "Donation Button"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#:
|
88 |
msgid "Select Button"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#:
|
92 |
-
|
|
|
93 |
msgstr ""
|
94 |
|
95 |
-
#:
|
96 |
msgid "Enter a URL to a custom donation button."
|
97 |
msgstr ""
|
98 |
|
99 |
-
#:
|
100 |
msgid "Country and Language"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#:
|
104 |
-
msgid ""
|
105 |
-
"Localize the language and the country for the button (Updated after saving "
|
106 |
-
"the settings)."
|
107 |
msgstr ""
|
108 |
|
109 |
-
#:
|
110 |
msgid "Extras"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#:
|
114 |
msgid "Disable PayPal Statistics"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#:
|
118 |
msgid "Theme CSS Override: Center Button"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#:
|
122 |
-
msgid "
|
123 |
msgstr ""
|
124 |
|
125 |
-
#:
|
126 |
-
msgid "
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: paypal-donations.php:
|
130 |
-
msgid "
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: paypal-donations.php:
|
134 |
-
msgid "
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: paypal-donations.php:
|
138 |
-
msgid "
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: paypal-donations.php:
|
142 |
-
msgid "
|
|
|
|
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: paypal-donations.php:
|
146 |
-
msgid "
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: paypal-donations.php:
|
150 |
-
msgid "
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: paypal-donations.php:
|
154 |
-
msgid "
|
155 |
msgstr ""
|
156 |
|
157 |
-
|
158 |
-
msgid "PayPal
|
159 |
msgstr ""
|
160 |
|
161 |
-
|
162 |
-
msgid "
|
163 |
msgstr ""
|
164 |
|
165 |
-
|
166 |
-
msgid ""
|
167 |
-
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
msgstr ""
|
171 |
|
172 |
-
|
173 |
-
msgid "
|
174 |
msgstr ""
|
175 |
|
176 |
-
|
177 |
-
msgid "
|
178 |
msgstr ""
|
2 |
# This file is distributed under the same license as the PayPal Donations package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: PayPal Donations 1.8\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/paypal-donations\n"
|
7 |
+
"POT-Creation-Date: 2013-03-09 16:48+0700\n"
|
8 |
+
"PO-Revision-Date: 2013-03-09 16:49+0700\n"
|
9 |
+
"Last-Translator: \n"
|
10 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11 |
"MIME-Version: 1.0\n"
|
12 |
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
"Content-Transfer-Encoding: 8bit\n"
|
14 |
+
"X-Generator: Poedit 1.5.5\n"
|
15 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Poedit-SearchPath-0: D:\\Dropbox\\Code\\WordPress\\paypal-donations\n"
|
18 |
+
|
19 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:106
|
20 |
+
msgid "Account Setup"
|
21 |
+
msgstr ""
|
22 |
|
23 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:112
|
24 |
msgid "PayPal Account"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:119
|
28 |
+
msgid "Your PayPal Email or Secure Merchant Account ID."
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:126
|
32 |
msgid "Currency"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:133
|
36 |
msgid "The currency to use for the donations."
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:141
|
40 |
msgid "Optional Settings"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:147
|
44 |
msgid "Page Style"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:154
|
48 |
msgid ""
|
49 |
+
"The name of a custom payment page style that exist in your\n"
|
50 |
+
" PayPal account profile."
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:162
|
54 |
msgid "Return Page"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:169
|
58 |
msgid ""
|
59 |
+
"URL to which the donator comes to after completing the\n"
|
60 |
+
" donation; for example, a URL on your site that displays "
|
61 |
+
"a\n"
|
62 |
+
" \"Thank you for your donation\"."
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:179
|
66 |
msgid "Defaults"
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:185
|
70 |
msgid "Amount"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:192
|
74 |
msgid "The default amount for a donation (Optional)."
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:199
|
78 |
msgid "Purpose"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:206
|
82 |
msgid "The default purpose of a donation (Optional)."
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:213
|
86 |
msgid "Reference"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:220
|
90 |
msgid "Default reference for the donation (Optional)."
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:228
|
94 |
msgid "Donation Button"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:234
|
98 |
msgid "Select Button"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:245
|
102 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:494
|
103 |
+
msgid "Custom Button"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:252
|
107 |
msgid "Enter a URL to a custom donation button."
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:259
|
111 |
msgid "Country and Language"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:266
|
115 |
+
msgid "Localize the language and the country for the button."
|
|
|
|
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:281
|
119 |
msgid "Extras"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:287
|
123 |
msgid "Disable PayPal Statistics"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:298
|
127 |
msgid "Theme CSS Override: Center Button"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:309
|
131 |
+
msgid "Enable Checkout Language"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:320
|
135 |
+
msgid "Checkout Language"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:331
|
139 |
+
msgid "Return Method"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:338
|
143 |
+
msgid "Takes effect only if the return page is set."
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:356
|
147 |
+
msgid "Required fields."
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:368
|
151 |
+
msgid ""
|
152 |
+
"Optional extra settings to fine tune the setup in certain\n"
|
153 |
+
" scenarios."
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:611
|
157 |
+
msgid "GET method (default)"
|
158 |
msgstr ""
|
159 |
|
160 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:612
|
161 |
+
msgid "GET method, no variables"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Admin.php:613
|
165 |
+
msgid "POST method"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Widget.php:17
|
169 |
+
msgid "PayPal Donation Button"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/lib/PayPalDonations/Widget.php:86
|
173 |
+
msgid "Donate"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/admin.php:8
|
177 |
+
msgid "General"
|
178 |
+
msgstr ""
|
179 |
+
|
180 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/admin.php:9
|
181 |
+
msgid "Advanced"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:2
|
185 |
+
msgid "Title:"
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:8
|
189 |
+
msgid "Text:"
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:14
|
193 |
+
msgid "Purpose:"
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: D:\Dropbox\Code\WordPress\paypal-donations/views/widget-form.php:20
|
197 |
+
msgid "Reference:"
|
198 |
msgstr ""
|
lib/PayPalDonations/Admin.php
CHANGED
@@ -17,6 +17,18 @@ class PayPalDonations_Admin
|
|
17 |
private $localized_buttons;
|
18 |
private $checkout_languages;
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
public function setOptions(
|
21 |
$options,
|
22 |
$code,
|
@@ -31,19 +43,594 @@ class PayPalDonations_Admin
|
|
31 |
$this->checkout_languages = $checkout_lng;
|
32 |
}
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
{
|
36 |
$data = array(
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'donate_buttons' => $this->donate_buttons,
|
40 |
-
'localized_buttons' => $this->localized_buttons,
|
41 |
-
'checkout_languages' => $this->checkout_languages,
|
42 |
);
|
43 |
echo PayPalDonations_View::render(
|
44 |
plugin_dir_path(__FILE__).'../../views/admin.php', $data);
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
// -------------------------------------------------------------------------
|
48 |
// HTML and Form element methods
|
49 |
// -------------------------------------------------------------------------
|
17 |
private $localized_buttons;
|
18 |
private $checkout_languages;
|
19 |
|
20 |
+
const PAGE_SLUG = 'paypal-donations-options';
|
21 |
+
|
22 |
+
public function __construct()
|
23 |
+
{
|
24 |
+
add_action('admin_menu', array($this, 'menu'));
|
25 |
+
add_action('admin_init', array($this, 'init'));
|
26 |
+
add_action('admin_enqueue_scripts', array($this, 'scripts'));
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* To be deprecated soon!
|
31 |
+
*/
|
32 |
public function setOptions(
|
33 |
$options,
|
34 |
$code,
|
43 |
$this->checkout_languages = $checkout_lng;
|
44 |
}
|
45 |
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Register the Menu.
|
49 |
+
*/
|
50 |
+
public function menu()
|
51 |
+
{
|
52 |
+
add_options_page(
|
53 |
+
'PayPal Donations Options',
|
54 |
+
'PayPal Donations',
|
55 |
+
'administrator',
|
56 |
+
self::PAGE_SLUG,
|
57 |
+
array($this, 'renderpage')
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
public function renderpage()
|
62 |
{
|
63 |
$data = array(
|
64 |
+
'pageSlug' => PayPalDonations_Admin::PAGE_SLUG,
|
65 |
+
'optionDBKey' => PayPalDonations::OPTION_DB_KEY,
|
|
|
|
|
|
|
66 |
);
|
67 |
echo PayPalDonations_View::render(
|
68 |
plugin_dir_path(__FILE__).'../../views/admin.php', $data);
|
69 |
}
|
70 |
|
71 |
+
/**
|
72 |
+
* Load CSS and JS on the settings page.
|
73 |
+
*/
|
74 |
+
public function scripts($hook)
|
75 |
+
{
|
76 |
+
if ($hook != 'settings_page_paypal-donations-options') {
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
$plugin = get_plugin_data(PayPalDonations::FILE, false, false);
|
80 |
+
$version = $plugin['Version'];
|
81 |
+
|
82 |
+
wp_register_style(
|
83 |
+
'paypal-donations',
|
84 |
+
plugins_url('assets/tabs.css', PayPalDonations::FILE),
|
85 |
+
array(),
|
86 |
+
$version
|
87 |
+
);
|
88 |
+
wp_enqueue_style('paypal-donations');
|
89 |
+
|
90 |
+
wp_enqueue_script(
|
91 |
+
'paypal-donations',
|
92 |
+
plugins_url('assets/tabs.js', PayPalDonations::FILE),
|
93 |
+
array('jquery'),
|
94 |
+
$version,
|
95 |
+
false
|
96 |
+
);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Register the settings.
|
101 |
+
*/
|
102 |
+
public function init()
|
103 |
+
{
|
104 |
+
add_settings_section(
|
105 |
+
'account_setup_section',
|
106 |
+
__('Account Setup', 'paypal-donations'),
|
107 |
+
array($this, 'accountSetupCallback'),
|
108 |
+
self::PAGE_SLUG
|
109 |
+
);
|
110 |
+
add_settings_field(
|
111 |
+
'paypal_account',
|
112 |
+
__('PayPal Account', 'paypal-donations'),
|
113 |
+
array($this, 'paypalAccountCallback'),
|
114 |
+
self::PAGE_SLUG,
|
115 |
+
'account_setup_section',
|
116 |
+
array(
|
117 |
+
'label_for' => 'paypal_account',
|
118 |
+
'description' => __(
|
119 |
+
'Your PayPal Email or Secure Merchant Account ID.',
|
120 |
+
'paypal-donations'
|
121 |
+
),
|
122 |
+
)
|
123 |
+
);
|
124 |
+
add_settings_field(
|
125 |
+
'currency_code',
|
126 |
+
__('Currency', 'paypal-donations'),
|
127 |
+
array($this, 'currencyCallback'),
|
128 |
+
self::PAGE_SLUG,
|
129 |
+
'account_setup_section',
|
130 |
+
array(
|
131 |
+
'label_for' => 'currency_code',
|
132 |
+
'description' => __(
|
133 |
+
'The currency to use for the donations.',
|
134 |
+
'paypal-donations'
|
135 |
+
),
|
136 |
+
)
|
137 |
+
);
|
138 |
+
|
139 |
+
add_settings_section(
|
140 |
+
'optional_section',
|
141 |
+
__('Optional Settings', 'paypal-donations'),
|
142 |
+
'',
|
143 |
+
self::PAGE_SLUG
|
144 |
+
);
|
145 |
+
add_settings_field(
|
146 |
+
'page_style',
|
147 |
+
__('Page Style', 'paypal-donations'),
|
148 |
+
array($this, 'pageStyleCallback'),
|
149 |
+
self::PAGE_SLUG,
|
150 |
+
'optional_section',
|
151 |
+
array(
|
152 |
+
'label_for' => 'page_style',
|
153 |
+
'description' => __(
|
154 |
+
'The name of a custom payment page style that exist in your
|
155 |
+
PayPal account profile.',
|
156 |
+
'paypal-donations'
|
157 |
+
),
|
158 |
+
)
|
159 |
+
);
|
160 |
+
add_settings_field(
|
161 |
+
'return_page',
|
162 |
+
__('Return Page', 'paypal-donations'),
|
163 |
+
array($this, 'returnPageCallback'),
|
164 |
+
self::PAGE_SLUG,
|
165 |
+
'optional_section',
|
166 |
+
array(
|
167 |
+
'label_for' => 'return_page',
|
168 |
+
'description' => __(
|
169 |
+
'URL to which the donator comes to after completing the
|
170 |
+
donation; for example, a URL on your site that displays a
|
171 |
+
"Thank you for your donation".',
|
172 |
+
'paypal-donations'
|
173 |
+
),
|
174 |
+
)
|
175 |
+
);
|
176 |
+
|
177 |
+
add_settings_section(
|
178 |
+
'default_section',
|
179 |
+
__('Defaults', 'paypal-donations'),
|
180 |
+
'',
|
181 |
+
self::PAGE_SLUG
|
182 |
+
);
|
183 |
+
add_settings_field(
|
184 |
+
'amount',
|
185 |
+
__('Amount', 'paypal-donations'),
|
186 |
+
array($this, 'amountCallback'),
|
187 |
+
self::PAGE_SLUG,
|
188 |
+
'default_section',
|
189 |
+
array(
|
190 |
+
'label_for' => 'amount',
|
191 |
+
'description' => __(
|
192 |
+
'The default amount for a donation (Optional).',
|
193 |
+
'paypal-donations'
|
194 |
+
),
|
195 |
+
)
|
196 |
+
);
|
197 |
+
add_settings_field(
|
198 |
+
'purpose',
|
199 |
+
__('Purpose', 'paypal-donations'),
|
200 |
+
array($this, 'purposeCallback'),
|
201 |
+
self::PAGE_SLUG,
|
202 |
+
'default_section',
|
203 |
+
array(
|
204 |
+
'label_for' => 'purpose',
|
205 |
+
'description' => __(
|
206 |
+
'The default purpose of a donation (Optional).',
|
207 |
+
'paypal-donations'
|
208 |
+
),
|
209 |
+
)
|
210 |
+
);
|
211 |
+
add_settings_field(
|
212 |
+
'reference',
|
213 |
+
__('Reference', 'paypal-donations'),
|
214 |
+
array($this, 'referenceCallback'),
|
215 |
+
self::PAGE_SLUG,
|
216 |
+
'default_section',
|
217 |
+
array(
|
218 |
+
'label_for' => 'reference',
|
219 |
+
'description' => __(
|
220 |
+
'Default reference for the donation (Optional).',
|
221 |
+
'paypal-donations'
|
222 |
+
),
|
223 |
+
)
|
224 |
+
);
|
225 |
+
|
226 |
+
add_settings_section(
|
227 |
+
'donate_button_section',
|
228 |
+
__('Donation Button', 'paypal-donations'),
|
229 |
+
'',
|
230 |
+
self::PAGE_SLUG
|
231 |
+
);
|
232 |
+
add_settings_field(
|
233 |
+
'button',
|
234 |
+
__('Select Button', 'paypal-donations'),
|
235 |
+
array($this, 'buttonCallback'),
|
236 |
+
self::PAGE_SLUG,
|
237 |
+
'donate_button_section',
|
238 |
+
array(
|
239 |
+
'label_for' => 'button',
|
240 |
+
'description' => ''
|
241 |
+
)
|
242 |
+
);
|
243 |
+
add_settings_field(
|
244 |
+
'button_url',
|
245 |
+
__('Custom Button', 'paypal-donations'),
|
246 |
+
array($this, 'buttonUrlCallback'),
|
247 |
+
self::PAGE_SLUG,
|
248 |
+
'donate_button_section',
|
249 |
+
array(
|
250 |
+
'label_for' => 'button_url',
|
251 |
+
'description' => __(
|
252 |
+
'Enter a URL to a custom donation button.',
|
253 |
+
'paypal-donations'
|
254 |
+
),
|
255 |
+
)
|
256 |
+
);
|
257 |
+
add_settings_field(
|
258 |
+
'button_localized',
|
259 |
+
__('Country and Language', 'paypal-donations'),
|
260 |
+
array($this, 'localizeButtonCallback'),
|
261 |
+
self::PAGE_SLUG,
|
262 |
+
'donate_button_section',
|
263 |
+
array(
|
264 |
+
'label_for' => 'button_localized',
|
265 |
+
'description' => __(
|
266 |
+
'Localize the language and the country for the button.',
|
267 |
+
'paypal-donations'
|
268 |
+
),
|
269 |
+
)
|
270 |
+
);
|
271 |
+
|
272 |
+
add_settings_section(
|
273 |
+
'tab_splitter',
|
274 |
+
'',
|
275 |
+
array($this, 'tabsCallback'),
|
276 |
+
self::PAGE_SLUG
|
277 |
+
);
|
278 |
+
|
279 |
+
add_settings_section(
|
280 |
+
'extras_section',
|
281 |
+
__('Extras', 'paypal-donations'),
|
282 |
+
array($this, 'extrasCallback'),
|
283 |
+
self::PAGE_SLUG
|
284 |
+
);
|
285 |
+
add_settings_field(
|
286 |
+
'disable_stats',
|
287 |
+
__('Disable PayPal Statistics', 'paypal-donations'),
|
288 |
+
array($this, 'disableStatsCallback'),
|
289 |
+
self::PAGE_SLUG,
|
290 |
+
'extras_section',
|
291 |
+
array(
|
292 |
+
'label_for' => 'disable_stats',
|
293 |
+
'description' => ''
|
294 |
+
)
|
295 |
+
);
|
296 |
+
add_settings_field(
|
297 |
+
'center_button',
|
298 |
+
__('Theme CSS Override: Center Button', 'paypal-donations'),
|
299 |
+
array($this, 'centerButtonCallback'),
|
300 |
+
self::PAGE_SLUG,
|
301 |
+
'extras_section',
|
302 |
+
array(
|
303 |
+
'label_for' => 'center_button',
|
304 |
+
'description' => ''
|
305 |
+
)
|
306 |
+
);
|
307 |
+
add_settings_field(
|
308 |
+
'set_checkout_language',
|
309 |
+
__('Enable Checkout Language', 'paypal-donations'),
|
310 |
+
array($this, 'setCheckoutLangugageCallback'),
|
311 |
+
self::PAGE_SLUG,
|
312 |
+
'extras_section',
|
313 |
+
array(
|
314 |
+
'label_for' => 'set_checkout_language',
|
315 |
+
'description' => '',
|
316 |
+
)
|
317 |
+
);
|
318 |
+
add_settings_field(
|
319 |
+
'checkout_language',
|
320 |
+
__('Checkout Language', 'paypal-donations'),
|
321 |
+
array($this, 'checkoutLangugageCallback'),
|
322 |
+
self::PAGE_SLUG,
|
323 |
+
'extras_section',
|
324 |
+
array(
|
325 |
+
'label_for' => 'checkout_language',
|
326 |
+
'description' => '',
|
327 |
+
)
|
328 |
+
);
|
329 |
+
add_settings_field(
|
330 |
+
'return_method',
|
331 |
+
__('Return Method', 'paypal-donations'),
|
332 |
+
array($this, 'returnMethodCallback'),
|
333 |
+
self::PAGE_SLUG,
|
334 |
+
'extras_section',
|
335 |
+
array(
|
336 |
+
'label_for' => 'return_method',
|
337 |
+
'description' => __(
|
338 |
+
'Takes effect only if the return page is set.',
|
339 |
+
'post-snippets'
|
340 |
+
),
|
341 |
+
)
|
342 |
+
);
|
343 |
+
|
344 |
+
register_setting(
|
345 |
+
PayPalDonations::OPTION_DB_KEY,
|
346 |
+
PayPalDonations::OPTION_DB_KEY
|
347 |
+
);
|
348 |
+
}
|
349 |
+
|
350 |
+
// -------------------------------------------------------------------------
|
351 |
+
// Section Callbacks
|
352 |
+
// -------------------------------------------------------------------------
|
353 |
+
|
354 |
+
public function accountSetupCallback()
|
355 |
+
{
|
356 |
+
printf('<p>%s</p>', __('Required fields.', 'paypal-donations'));
|
357 |
+
}
|
358 |
+
|
359 |
+
public function tabsCallback()
|
360 |
+
{
|
361 |
+
echo "</div><div id='paypal-donations-tab-content-2'>";
|
362 |
+
}
|
363 |
+
|
364 |
+
public function extrasCallback()
|
365 |
+
{
|
366 |
+
printf(
|
367 |
+
'<p>%s</p>',
|
368 |
+
__('Optional extra settings to fine tune the setup in certain
|
369 |
+
scenarios.',
|
370 |
+
'paypal-donations'
|
371 |
+
)
|
372 |
+
);
|
373 |
+
}
|
374 |
+
|
375 |
+
// -------------------------------------------------------------------------
|
376 |
+
// Fields Callbacks
|
377 |
+
// -------------------------------------------------------------------------
|
378 |
+
|
379 |
+
public function paypalAccountCallback($args)
|
380 |
+
{
|
381 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
382 |
+
$options = get_option($optionKey);
|
383 |
+
echo "<input class='regular-text' type='text' id='paypal_account' ";
|
384 |
+
echo "name='{$optionKey}[paypal_account]'' ";
|
385 |
+
echo "value='{$options['paypal_account']}' />";
|
386 |
+
|
387 |
+
echo "<p class='description'>{$args['description']}</p>";
|
388 |
+
}
|
389 |
+
|
390 |
+
public function currencyCallback($args)
|
391 |
+
{
|
392 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
393 |
+
$options = get_option($optionKey);
|
394 |
+
echo "<select id='currency_code' name='{$optionKey}[currency_code]'>";
|
395 |
+
if (isset($options['currency_code'])) {
|
396 |
+
$current_currency = $options['currency_code'];
|
397 |
+
} else {
|
398 |
+
$current_currency = 'USD';
|
399 |
+
}
|
400 |
+
foreach ($this->currency_codes as $key => $code) {
|
401 |
+
echo '<option value="'.$key.'"';
|
402 |
+
if ($current_currency == $key) {
|
403 |
+
echo ' selected="selected"';
|
404 |
+
}
|
405 |
+
echo '>'.$code.'</option>';
|
406 |
+
}
|
407 |
+
echo "</select>";
|
408 |
+
|
409 |
+
echo "<p class='description'>{$args['description']}</p>";
|
410 |
+
}
|
411 |
+
|
412 |
+
public function pageStyleCallback($args)
|
413 |
+
{
|
414 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
415 |
+
$options = get_option($optionKey);
|
416 |
+
echo "<input class='regular-text' type='text' id='page_style' ";
|
417 |
+
echo "name='{$optionKey}[page_style]'' ";
|
418 |
+
echo "value='{$options['page_style']}' />";
|
419 |
+
|
420 |
+
echo "<p class='description'>{$args['description']}</p>";
|
421 |
+
}
|
422 |
+
|
423 |
+
public function returnPageCallback($args)
|
424 |
+
{
|
425 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
426 |
+
$options = get_option($optionKey);
|
427 |
+
echo "<input class='regular-text' type='text' id='return_page' ";
|
428 |
+
echo "name='{$optionKey}[return_page]'' ";
|
429 |
+
echo "value='{$options['return_page']}' />";
|
430 |
+
|
431 |
+
echo "<p class='description'>{$args['description']}</p>";
|
432 |
+
}
|
433 |
+
|
434 |
+
public function amountCallback($args)
|
435 |
+
{
|
436 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
437 |
+
$options = get_option($optionKey);
|
438 |
+
echo "<input class='regular-text' type='text' id='amount' ";
|
439 |
+
echo "name='{$optionKey}[amount]'' ";
|
440 |
+
echo "value='{$options['amount']}' />";
|
441 |
+
|
442 |
+
echo "<p class='description'>{$args['description']}</p>";
|
443 |
+
}
|
444 |
+
|
445 |
+
public function purposeCallback($args)
|
446 |
+
{
|
447 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
448 |
+
$options = get_option($optionKey);
|
449 |
+
echo "<input class='regular-text' type='text' id='purpose' ";
|
450 |
+
echo "name='{$optionKey}[purpose]'' ";
|
451 |
+
echo "value='{$options['purpose']}' />";
|
452 |
+
|
453 |
+
echo "<p class='description'>{$args['description']}</p>";
|
454 |
+
}
|
455 |
+
|
456 |
+
public function referenceCallback($args)
|
457 |
+
{
|
458 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
459 |
+
$options = get_option($optionKey);
|
460 |
+
echo "<input class='regular-text' type='text' id='reference' ";
|
461 |
+
echo "name='{$optionKey}[reference]'' ";
|
462 |
+
echo "value='{$options['reference']}' />";
|
463 |
+
|
464 |
+
echo "<p class='description'>{$args['description']}</p>";
|
465 |
+
}
|
466 |
+
|
467 |
+
public function buttonCallback($args)
|
468 |
+
{
|
469 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
470 |
+
$options = get_option($optionKey);
|
471 |
+
|
472 |
+
$custom = true;
|
473 |
+
if (isset($options['button_localized'])) {
|
474 |
+
$button_localized = $options['button_localized'];
|
475 |
+
} else {
|
476 |
+
$button_localized = 'en_US';
|
477 |
+
}
|
478 |
+
if (isset($options['button'])) {
|
479 |
+
$current_button = $options['button'];
|
480 |
+
} else {
|
481 |
+
$current_button = 'large';
|
482 |
+
}
|
483 |
+
|
484 |
+
foreach ( $this->donate_buttons as $key => $button ) {
|
485 |
+
echo "\t<label title='" . esc_attr($key) . "'><input style='padding: 10px 0 10px 0;' type='radio' name='{$optionKey}[button]' value='" . esc_attr($key) . "'";
|
486 |
+
if ( $current_button === $key ) { // checked() uses "==" rather than "==="
|
487 |
+
echo " checked='checked'";
|
488 |
+
$custom = false;
|
489 |
+
}
|
490 |
+
echo " /> <img src='" . str_replace('en_US', $button_localized, $button) . "' alt='" . $key . "' style='vertical-align: middle;' /></label><br /><br />\n";
|
491 |
+
}
|
492 |
+
echo ' <label><input type="radio" name="{$optionKey}[button]" value="custom"';
|
493 |
+
checked( $custom, true );
|
494 |
+
echo '/> '.__('Custom Button', 'paypal-donations');
|
495 |
+
|
496 |
+
}
|
497 |
+
|
498 |
+
public function buttonUrlCallback($args)
|
499 |
+
{
|
500 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
501 |
+
$options = get_option($optionKey);
|
502 |
+
echo "<input class='regular-text' type='text' id='button_url' ";
|
503 |
+
echo "name='{$optionKey}[button_url]'' ";
|
504 |
+
echo "value='{$options['button_url']}' />";
|
505 |
+
|
506 |
+
echo "<p class='description'>{$args['description']}</p>";
|
507 |
+
}
|
508 |
+
|
509 |
+
public function localizeButtonCallback($args)
|
510 |
+
{
|
511 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
512 |
+
$options = get_option($optionKey);
|
513 |
+
echo "<select id='button_localized' name='{$optionKey}[button_localized]'>";
|
514 |
+
if (isset($options['button_localized'])) {
|
515 |
+
$button_localized = $options['button_localized'];
|
516 |
+
} else {
|
517 |
+
$button_localized = 'en_US';
|
518 |
+
}
|
519 |
+
foreach ($this->localized_buttons as $key => $code) {
|
520 |
+
echo '<option value="'.$key.'"';
|
521 |
+
if ($button_localized == $key) {
|
522 |
+
echo ' selected="selected"';
|
523 |
+
}
|
524 |
+
echo '>'.$code.'</option>';
|
525 |
+
}
|
526 |
+
echo "</select>";
|
527 |
+
|
528 |
+
echo "<p class='description'>{$args['description']}</p>";
|
529 |
+
}
|
530 |
+
|
531 |
+
public function disableStatsCallback($args)
|
532 |
+
{
|
533 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
534 |
+
$options = get_option($optionKey);
|
535 |
+
$checked = isset($options['disable_stats']) ?
|
536 |
+
$options['disable_stats'] :
|
537 |
+
false;
|
538 |
+
echo "<input type='checkbox' id='disable_stats' ";
|
539 |
+
echo "name='{$optionKey}[disable_stats]' value='1' ";
|
540 |
+
if ($checked) {
|
541 |
+
echo 'checked ';
|
542 |
+
}
|
543 |
+
echo " />";
|
544 |
+
|
545 |
+
echo "<p class='description'>{$args['description']}</p>";
|
546 |
+
}
|
547 |
+
|
548 |
+
public function centerButtonCallback($args)
|
549 |
+
{
|
550 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
551 |
+
$options = get_option($optionKey);
|
552 |
+
$checked = isset($options['center_button']) ?
|
553 |
+
$options['center_button'] :
|
554 |
+
false;
|
555 |
+
echo "<input type='checkbox' id='center_button' ";
|
556 |
+
echo "name='{$optionKey}[center_button]' value='1' ";
|
557 |
+
if ($checked) {
|
558 |
+
echo 'checked ';
|
559 |
+
}
|
560 |
+
echo "/>";
|
561 |
+
|
562 |
+
echo "<p class='description'>{$args['description']}</p>";
|
563 |
+
}
|
564 |
+
|
565 |
+
public function setCheckoutLangugageCallback($args)
|
566 |
+
{
|
567 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
568 |
+
$options = get_option($optionKey);
|
569 |
+
$checked = isset($options['set_checkout_language']) ?
|
570 |
+
$options['set_checkout_language'] :
|
571 |
+
false;
|
572 |
+
|
573 |
+
echo "<input type='checkbox' id='set_checkout_language' ";
|
574 |
+
echo "name='{$optionKey}[set_checkout_language]' value='1' ";
|
575 |
+
if ($checked) {
|
576 |
+
echo 'checked ';
|
577 |
+
}
|
578 |
+
echo " />";
|
579 |
+
echo "<p class='description'>{$args['description']}</p>";
|
580 |
+
}
|
581 |
+
|
582 |
+
public function checkoutLangugageCallback($args)
|
583 |
+
{
|
584 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
585 |
+
$options = get_option($optionKey);
|
586 |
+
|
587 |
+
echo "<select id='checkout_language' name='{$optionKey}[checkout_language]'>";
|
588 |
+
echo "<option value=''>None</option>";
|
589 |
+
if (isset($options['checkout_language'])) {
|
590 |
+
$checkout_language = $options['checkout_language'];
|
591 |
+
} else {
|
592 |
+
$checkout_language = 'en_US';
|
593 |
+
}
|
594 |
+
foreach ($this->checkout_languages as $key => $code) {
|
595 |
+
echo '<option value="'.$key.'"';
|
596 |
+
if ($checkout_language == $key) {
|
597 |
+
echo ' selected="selected"';
|
598 |
+
}
|
599 |
+
echo '>'.$code.'</option>';
|
600 |
+
}
|
601 |
+
echo "</select>";
|
602 |
+
|
603 |
+
echo "<p class='description'>{$args['description']}</p>";
|
604 |
+
}
|
605 |
+
|
606 |
+
public function returnMethodCallback($args)
|
607 |
+
{
|
608 |
+
$optionKey = PayPalDonations::OPTION_DB_KEY;
|
609 |
+
$options = get_option($optionKey);
|
610 |
+
$methods = array(
|
611 |
+
__('GET method (default)', 'post-snippets'),
|
612 |
+
__('GET method, no variables', 'post-snippets'),
|
613 |
+
__('POST method', 'post-snippets')
|
614 |
+
);
|
615 |
+
|
616 |
+
echo "<select id='return_method' name='{$optionKey}[return_method]'>";
|
617 |
+
if (isset($options['return_method'])) {
|
618 |
+
$return_method = $options['return_method'];
|
619 |
+
} else {
|
620 |
+
$return_method = '0';
|
621 |
+
}
|
622 |
+
foreach ($methods as $key => $code) {
|
623 |
+
echo '<option value="'.$key.'"';
|
624 |
+
if ($return_method == $key) {
|
625 |
+
echo ' selected="selected"';
|
626 |
+
}
|
627 |
+
echo '>'.$code.'</option>';
|
628 |
+
}
|
629 |
+
echo "</select>";
|
630 |
+
|
631 |
+
echo "<p class='description'>{$args['description']}</p>";
|
632 |
+
}
|
633 |
+
|
634 |
// -------------------------------------------------------------------------
|
635 |
// HTML and Form element methods
|
636 |
// -------------------------------------------------------------------------
|
lib/PayPalDonations/Help.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
NOT IMPLEMENTED YET!
|
4 |
+
WILL BE A HELP CLASS FOR v1.9
|
5 |
+
|
6 |
+
https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
|
7 |
+
UNder: HTML Variables for Displaying PayPal Checkout Pages
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
ADVANCED
|
12 |
+
RETURN METHOD
|
13 |
+
|
14 |
+
Optional
|
15 |
+
Return method. The FORM METHOD used to send data to the URL specified by the return variable.
|
16 |
+
Allowable values are:
|
17 |
+
0 – all shopping cart payments use the GET method
|
18 |
+
1 – the buyer’s browser is redirected to the return URL by using the GET method, but no payment variables are included
|
19 |
+
2 – the buyer’s browser is redirected to the return URL by using the POST method, and all payment variables are included
|
20 |
+
The default is 0.
|
21 |
+
NOTE:The rm variable takes effect only if the return variable is set.
|
22 |
+
*/
|
paypal-donations.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wpstorm.net/wordpress-plugins/paypal-donations/
|
|
5 |
Description: Easy and simple setup and insertion of PayPal donate buttons with a shortcode or through a sidebar Widget. Donation purpose can be set for each button. A few other customization options are available as well.
|
6 |
Author: Johan Steen
|
7 |
Author URI: http://johansteen.se/
|
8 |
-
Version: 1.
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: paypal-donations
|
11 |
|
@@ -37,15 +37,15 @@ spl_autoload_register('PayPalDonations::autoload');
|
|
37 |
*/
|
38 |
class PayPalDonations
|
39 |
{
|
40 |
-
private static $instance = false;
|
41 |
-
|
42 |
const MIN_PHP_VERSION = '5.2.4';
|
43 |
const MIN_WP_VERSION = '2.8';
|
44 |
const OPTION_DB_KEY = 'paypal_donations_options';
|
|
|
45 |
|
|
|
46 |
|
47 |
// -------------------------------------------------------------------------
|
48 |
-
// Define constant
|
49 |
// -------------------------------------------------------------------------
|
50 |
private $donate_buttons = array(
|
51 |
'small' => 'https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif',
|
@@ -123,7 +123,7 @@ class PayPalDonations
|
|
123 |
}
|
124 |
|
125 |
/**
|
126 |
-
* Constructor
|
127 |
* Initializes the plugin by setting localization, filters, and
|
128 |
* administration functions.
|
129 |
*/
|
@@ -133,12 +133,18 @@ class PayPalDonations
|
|
133 |
return;
|
134 |
}
|
135 |
|
136 |
-
|
137 |
-
add_action('init', array($this, 'pluginTextdomain'));
|
138 |
-
|
139 |
register_uninstall_hook(__FILE__, array(__CLASS__, 'uninstall'));
|
140 |
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
add_shortcode('paypal-donation', array(&$this,'paypalShortcode'));
|
143 |
add_action('wp_head', array($this, 'addCss'), 999);
|
144 |
|
@@ -149,7 +155,8 @@ class PayPalDonations
|
|
149 |
/**
|
150 |
* PSR-0 compliant autoloader to load classes as needed.
|
151 |
*
|
152 |
-
* @since
|
|
|
153 |
* @param string $classname The name of the class
|
154 |
* @return null Return early if the class name does not start with the
|
155 |
* correct prefix
|
@@ -177,7 +184,7 @@ class PayPalDonations
|
|
177 |
/**
|
178 |
* Loads the plugin text domain for translation
|
179 |
*/
|
180 |
-
public function
|
181 |
{
|
182 |
$domain = 'paypal-donations';
|
183 |
$locale = apply_filters('plugin_locale', get_locale(), $domain);
|
@@ -272,76 +279,12 @@ class PayPalDonations
|
|
272 |
);
|
273 |
}
|
274 |
|
275 |
-
/**
|
276 |
-
* The Admin Page and all it's functions
|
277 |
-
*/
|
278 |
-
public function wpAdmin()
|
279 |
-
{
|
280 |
-
if (function_exists('add_options_page'))
|
281 |
-
add_options_page(
|
282 |
-
'PayPal Donations Options',
|
283 |
-
'PayPal Donations',
|
284 |
-
'administrator',
|
285 |
-
basename(__FILE__),
|
286 |
-
array(&$this, 'optionsPage')
|
287 |
-
);
|
288 |
-
}
|
289 |
-
|
290 |
-
public function adminMessage($message)
|
291 |
-
{
|
292 |
-
if ($message) {
|
293 |
-
?>
|
294 |
-
<div class="updated"><p><strong>
|
295 |
-
<?php echo $message; ?>
|
296 |
-
</strong></p></div>
|
297 |
-
<?php
|
298 |
-
}
|
299 |
-
}
|
300 |
-
|
301 |
-
public function optionsPage()
|
302 |
-
{
|
303 |
-
// Update Options
|
304 |
-
if (isset($_POST['Submit'])) {
|
305 |
-
$pd_options['paypal_account'] = trim( $_POST['paypal_account'] );
|
306 |
-
$pd_options['page_style'] = trim( $_POST['page_style'] );
|
307 |
-
$pd_options['return_page'] = trim( $_POST['return_page'] );
|
308 |
-
$pd_options['purpose'] = trim( $_POST['purpose'] );
|
309 |
-
$pd_options['reference'] = trim( $_POST['reference'] );
|
310 |
-
$pd_options['button'] = trim( $_POST['button'] );
|
311 |
-
$pd_options['button_url'] = trim( $_POST['button_url'] );
|
312 |
-
$pd_options['currency_code'] = trim( $_POST['currency_code'] );
|
313 |
-
$pd_options['amount'] = trim( $_POST['amount'] );
|
314 |
-
$pd_options['button_localized'] = trim( $_POST['button_localized'] );
|
315 |
-
$pd_options['disable_stats'] = isset($_POST['disable_stats']) ? true : false;
|
316 |
-
$pd_options['center_button'] = isset($_POST['center_button']) ? true : false;
|
317 |
-
$pd_options['set_checkout_language'] = isset($_POST['set_checkout_language']) ? true : false;
|
318 |
-
$pd_options['checkout_language'] = trim( $_POST['checkout_language'] );
|
319 |
-
update_option(self::OPTION_DB_KEY, $pd_options);
|
320 |
-
$this->adminMessage( __( 'The PayPal Donations settings have been updated.', 'paypal-donations' ) );
|
321 |
-
}
|
322 |
-
|
323 |
-
// Render the settings screen
|
324 |
-
$settings = new PayPalDonations_Admin();
|
325 |
-
$settings->setOptions(
|
326 |
-
get_option(self::OPTION_DB_KEY),
|
327 |
-
$this->currency_codes,
|
328 |
-
$this->donate_buttons,
|
329 |
-
$this->localized_buttons,
|
330 |
-
$this->checkout_languages
|
331 |
-
);
|
332 |
-
$settings->render();
|
333 |
-
}
|
334 |
-
|
335 |
// -------------------------------------------------------------------------
|
336 |
// Environment Checks
|
337 |
// -------------------------------------------------------------------------
|
338 |
|
339 |
/**
|
340 |
-
*
|
341 |
-
*
|
342 |
-
* Checks PHP and WordPress versions. If any check failes, a system notice
|
343 |
-
* is added and $passed is set to fail, which can be checked before trying
|
344 |
-
* to create the main class.
|
345 |
*/
|
346 |
private function testHost()
|
347 |
{
|
5 |
Description: Easy and simple setup and insertion of PayPal donate buttons with a shortcode or through a sidebar Widget. Donation purpose can be set for each button. A few other customization options are available as well.
|
6 |
Author: Johan Steen
|
7 |
Author URI: http://johansteen.se/
|
8 |
+
Version: 1.8
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: paypal-donations
|
11 |
|
37 |
*/
|
38 |
class PayPalDonations
|
39 |
{
|
|
|
|
|
40 |
const MIN_PHP_VERSION = '5.2.4';
|
41 |
const MIN_WP_VERSION = '2.8';
|
42 |
const OPTION_DB_KEY = 'paypal_donations_options';
|
43 |
+
const FILE = __FILE__;
|
44 |
|
45 |
+
private static $instance = false;
|
46 |
|
47 |
// -------------------------------------------------------------------------
|
48 |
+
// Define constant data arrays
|
49 |
// -------------------------------------------------------------------------
|
50 |
private $donate_buttons = array(
|
51 |
'small' => 'https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif',
|
123 |
}
|
124 |
|
125 |
/**
|
126 |
+
* Constructor.
|
127 |
* Initializes the plugin by setting localization, filters, and
|
128 |
* administration functions.
|
129 |
*/
|
133 |
return;
|
134 |
}
|
135 |
|
136 |
+
add_action('init', array($this, 'textDomain'));
|
|
|
|
|
137 |
register_uninstall_hook(__FILE__, array(__CLASS__, 'uninstall'));
|
138 |
|
139 |
+
$admin = new PayPalDonations_Admin();
|
140 |
+
$admin->setOptions(
|
141 |
+
get_option(self::OPTION_DB_KEY),
|
142 |
+
$this->currency_codes,
|
143 |
+
$this->donate_buttons,
|
144 |
+
$this->localized_buttons,
|
145 |
+
$this->checkout_languages
|
146 |
+
);
|
147 |
+
|
148 |
add_shortcode('paypal-donation', array(&$this,'paypalShortcode'));
|
149 |
add_action('wp_head', array($this, 'addCss'), 999);
|
150 |
|
155 |
/**
|
156 |
* PSR-0 compliant autoloader to load classes as needed.
|
157 |
*
|
158 |
+
* @since 1.7
|
159 |
+
*
|
160 |
* @param string $classname The name of the class
|
161 |
* @return null Return early if the class name does not start with the
|
162 |
* correct prefix
|
184 |
/**
|
185 |
* Loads the plugin text domain for translation
|
186 |
*/
|
187 |
+
public function textDomain()
|
188 |
{
|
189 |
$domain = 'paypal-donations';
|
190 |
$locale = apply_filters('plugin_locale', get_locale(), $domain);
|
279 |
);
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
// -------------------------------------------------------------------------
|
283 |
// Environment Checks
|
284 |
// -------------------------------------------------------------------------
|
285 |
|
286 |
/**
|
287 |
+
* Checks PHP and WordPress versions.
|
|
|
|
|
|
|
|
|
288 |
*/
|
289 |
private function testHost()
|
290 |
{
|
phpunit.xml
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
<phpunit
|
3 |
colors="true"
|
4 |
stopOnFailure="false"
|
5 |
-
bootstrap="
|
6 |
backupGlobals="false"
|
7 |
<testsuites>
|
8 |
<testsuite name="complete">
|
9 |
-
<directory>
|
10 |
</testsuite>
|
11 |
</testsuites>
|
12 |
</phpunit>
|
2 |
<phpunit
|
3 |
colors="true"
|
4 |
stopOnFailure="false"
|
5 |
+
bootstrap="utest/bootstrap.php">
|
6 |
backupGlobals="false"
|
7 |
<testsuites>
|
8 |
<testsuite name="complete">
|
9 |
+
<directory>utest</directory>
|
10 |
</testsuite>
|
11 |
</testsuites>
|
12 |
</phpunit>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: artstorm
|
|
3 |
Tags: paypal, donation, shortcode, widget, donate, button, sidebar
|
4 |
Requires at least: 2.8
|
5 |
Tested up to: 3.5.1
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -35,9 +35,14 @@ For complete usage instructions see: [PayPal Donations](http://wpstorm.net/wordp
|
|
35 |
|
36 |
See the [Changelog](http://wordpress.org/extend/plugins/paypal-donations/changelog/) for what's new. Available [Translations](http://wpstorm.net/wordpress-plugins/paypal-donations/#translations).
|
37 |
|
38 |
-
=
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
== Installation ==
|
43 |
|
@@ -55,7 +60,23 @@ The plugin is available on [GitHub](https://github.com/artstorm/paypal-donations
|
|
55 |
|
56 |
== Frequently Asked Questions ==
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
== Screenshots ==
|
61 |
|
@@ -64,10 +85,19 @@ Please visit [PayPal Donations' Comments](http://wpstorm.net/wordpress-plugins/p
|
|
64 |
|
65 |
== Changelog ==
|
66 |
|
67 |
-
= Version 1.
|
68 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
* Refactored code to comply with the PSR-2 standard.
|
70 |
-
* Bumped
|
71 |
* Bumped minimum required WordPress version to WordPress 2.8.
|
72 |
|
73 |
= Version 1.6 - 13 Mar 2012 =
|
3 |
Tags: paypal, donation, shortcode, widget, donate, button, sidebar
|
4 |
Requires at least: 2.8
|
5 |
Tested up to: 3.5.1
|
6 |
+
Stable tag: 1.8
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
35 |
|
36 |
See the [Changelog](http://wordpress.org/extend/plugins/paypal-donations/changelog/) for what's new. Available [Translations](http://wpstorm.net/wordpress-plugins/paypal-donations/#translations).
|
37 |
|
38 |
+
= Related Links =
|
39 |
|
40 |
+
* [Documentation](http://wpstorm.net/wordpress-plugins/paypal-donations/
|
41 |
+
"Complete usage instructions")
|
42 |
+
* [Support Forum](http://wordpress.org/tags/paypal-donations?forum_id=10
|
43 |
+
"Use this for support and feature requests")
|
44 |
+
* [GitHub](https://github.com/artstorm/paypal-donations
|
45 |
+
"Develop and contribute your code or report bugs")
|
46 |
|
47 |
== Installation ==
|
48 |
|
60 |
|
61 |
== Frequently Asked Questions ==
|
62 |
|
63 |
+
= Where can I send bug reports? =
|
64 |
+
|
65 |
+
Please visit the GitHub repository for [PayPal Donations](https://github.com/artstorm/paypal-donations)
|
66 |
+
and open an [issue](https://github.com/artstorm/paypal-donations/issues).
|
67 |
+
Please create an issue that conforms with [necolas's guidelines](https://github.com/necolas/issue-guidelines).
|
68 |
+
|
69 |
+
= Where can I get support? =
|
70 |
+
|
71 |
+
Please visit the [Support Forum](http://wordpress.org/tags/paypal-donations?forum_id=10 "Use this for support and feature requests")
|
72 |
+
for questions, answers, support and feature requests.
|
73 |
+
|
74 |
+
= How can I contribute to the plugin? =
|
75 |
+
|
76 |
+
If you want to contribute improved code or new features for the plugin. Please
|
77 |
+
open a pull request at the [PayPal Donations GitHub repository](https://github.com/artstorm/paypal-donations).
|
78 |
+
Please open a pull request that conforms with [necolas's guidelines](https://github.com/necolas/issue-guidelines).
|
79 |
+
Contributions are appreciated and encouraged.
|
80 |
|
81 |
== Screenshots ==
|
82 |
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= Version 1.8 - 9 Mar 2013 =
|
89 |
+
* Added tabbed navigation in the plugin admin settings, and moved Extras into
|
90 |
+
the advanced tab.
|
91 |
+
* Updated the admin input fields in size to follow WordPress standard layout.
|
92 |
+
* Implemented return method, as an advanced option.
|
93 |
+
* Updated administration to use WordPress Settings API.
|
94 |
+
* Updated Swedish translation.
|
95 |
+
|
96 |
+
= Version 1.7 - 19 Feb 2013 =
|
97 |
+
* Moved the development to
|
98 |
+
[GitHub](https://github.com/artstorm/paypal-donations).
|
99 |
* Refactored code to comply with the PSR-2 standard.
|
100 |
+
* Bumped minimum PHP version to 5.2.4.
|
101 |
* Bumped minimum required WordPress version to WordPress 2.8.
|
102 |
|
103 |
= Version 1.6 - 13 Mar 2012 =
|
{tests → utest}/PayPalDonationsTest.php
RENAMED
File without changes
|
{tests → utest}/bootstrap.php
RENAMED
File without changes
|
views/admin.php
CHANGED
@@ -1,137 +1,21 @@
|
|
1 |
-
|
|
|
|
|
2 |
<h2>PayPal Donations</h2>
|
3 |
-
<form method="post" action="">
|
4 |
-
<?php wp_nonce_field('update-options'); ?>
|
5 |
-
<?php // $pd_options = get_option($this->plugin_options);
|
6 |
-
$pd_options = $plugin_options;
|
7 |
-
?>
|
8 |
|
9 |
-
<
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<
|
17 |
-
<?php
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
</
|
25 |
-
</table>
|
26 |
-
|
27 |
-
<h3><?php _e( 'Optional Settings', 'paypal-donations' ) ?></h3>
|
28 |
-
<table class="form-table">
|
29 |
-
<tr valign="top">
|
30 |
-
<th scope="row"><label for="page_style"><?php _e( 'Page Style', 'paypal-donations' ) ?></label></th>
|
31 |
-
<td><input name="page_style" type="text" id="page_style" value="<?php echo $pd_options['page_style']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'Specify the name of a custom payment page style from your PayPal account profile.', 'paypal-donations' ) ?></span></td>
|
32 |
-
</tr>
|
33 |
-
<tr valign="top">
|
34 |
-
<th scope="row"><label for="return_page"><?php _e( 'Return Page', 'paypal-donations' ) ?></label></th>
|
35 |
-
<td><input name="return_page" type="text" id="return_page" value="<?php echo $pd_options['return_page']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'URL to which the donator comes to after completing the donation; for example, a URL on your site that displays a "Thank you for your donation".', 'paypal-donations' ) ?></span></td>
|
36 |
-
</tr>
|
37 |
-
</table>
|
38 |
-
|
39 |
-
<h3><?php _e( 'Defaults', 'paypal-donations' ) ?></h3>
|
40 |
-
<table class="form-table">
|
41 |
-
<tr valign="top">
|
42 |
-
<th scope="row"><label for="amount"><?php _e( 'Amount', 'paypal-donations' ) ?></label></th>
|
43 |
-
<td><input name="amount" type="text" id="amount" value="<?php echo $pd_options['amount']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'The default amount for a donation (Optional).', 'paypal-donations' ) ?></span></td>
|
44 |
-
</tr>
|
45 |
-
<tr valign="top">
|
46 |
-
<th scope="row"><label for="purpose"><?php _e( 'Purpose', 'paypal-donations' ) ?></label></th>
|
47 |
-
<td><input name="purpose" type="text" id="purpose" value="<?php echo $pd_options['purpose']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'The default purpose of a donation (Optional).', 'paypal-donations' ) ?></span></td>
|
48 |
-
</tr>
|
49 |
-
<tr valign="top">
|
50 |
-
<th scope="row"><label for="reference"><?php _e( 'Reference', 'paypal-donations' ) ?></label></th>
|
51 |
-
<td><input name="reference" type="text" id="reference" value="<?php echo $pd_options['reference']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'Default reference for the donation (Optional).', 'paypal-donations' ) ?></span></td>
|
52 |
-
</tr>
|
53 |
-
</table>
|
54 |
-
|
55 |
-
<h3><?php _e( 'Donation Button', 'paypal-donations' ) ?></h3>
|
56 |
-
<table class="form-table">
|
57 |
-
<tr>
|
58 |
-
<th scope="row"><?php _e( 'Select Button', 'paypal-donations' ) ?></th>
|
59 |
-
<td>
|
60 |
-
<fieldset><legend class="hidden">PayPal Button</legend>
|
61 |
-
<?php
|
62 |
-
$custom = true;
|
63 |
-
if (isset($pd_options['button_localized'])) { $button_localized = $pd_options['button_localized']; } else { $button_localized = 'en_US'; }
|
64 |
-
if (isset($pd_options['button'])) { $current_button = $pd_options['button']; } else { $current_button = 'large'; }
|
65 |
-
foreach ( $donate_buttons as $key => $button ) {
|
66 |
-
echo "\t<label title='" . esc_attr($key) . "'><input style='padding: 10px 0 10px 0;' type='radio' name='button' value='" . esc_attr($key) . "'";
|
67 |
-
if ( $current_button === $key ) { // checked() uses "==" rather than "==="
|
68 |
-
echo " checked='checked'";
|
69 |
-
$custom = false;
|
70 |
-
}
|
71 |
-
echo " /> <img src='" . str_replace('en_US', $button_localized, $button) . "' alt='" . $key . "' style='vertical-align: middle;' /></label><br /><br />\n";
|
72 |
-
}
|
73 |
-
|
74 |
-
echo ' <label><input type="radio" name="button" value="custom"';
|
75 |
-
checked( $custom, true );
|
76 |
-
echo '/> ' . __('Custom Button:', 'paypal-donations') . ' </label>';
|
77 |
-
?>
|
78 |
-
<input type="text" name="button_url" value="<?php echo $pd_options['button_url']; ?>" class="regular-text" /><br/>
|
79 |
-
<span class="setting-description"><?php _e( 'Enter a URL to a custom donation button.', 'paypal-donations' ) ?></span>
|
80 |
-
</fieldset>
|
81 |
-
</td>
|
82 |
-
</tr>
|
83 |
-
<tr valign="top">
|
84 |
-
<th scope="row"><label for="button_localized"><?php _e( 'Country and Language', 'paypal-donations' ) ?></label></th>
|
85 |
-
<td><select name="button_localized" id="button_localized">
|
86 |
-
<?php foreach ( $localized_buttons as $key => $localize ) {
|
87 |
-
echo '<option value="'.$key.'"';
|
88 |
-
if ($button_localized == $key) { echo ' selected="selected"'; }
|
89 |
-
echo '>'.$localize.'</option>';
|
90 |
-
}?></select>
|
91 |
-
<span class="setting-description"><br/><?php _e( 'Localize the language and the country for the button (Updated after saving the settings).', 'paypal-donations' ) ?></span></td>
|
92 |
-
</tr>
|
93 |
-
</table>
|
94 |
-
|
95 |
-
<?php
|
96 |
-
// Extras
|
97 |
-
?>
|
98 |
-
<h3><?php _e( 'Extras', 'paypal-donations' ) ?></h3>
|
99 |
-
<p>Optional extra settings to fine tune the setup in certain scenarios.</p>
|
100 |
-
<?php
|
101 |
-
PayPalDonations_Admin::checkbox(
|
102 |
-
__('Disable PayPal Statistics', 'paypal-donations'),
|
103 |
-
'disable_stats',
|
104 |
-
$pd_options['disable_stats']);
|
105 |
-
echo '<br/>';
|
106 |
-
|
107 |
-
PayPalDonations_Admin::checkbox(
|
108 |
-
__('Theme CSS Override: Center Button', 'paypal-donations'),
|
109 |
-
'center_button',
|
110 |
-
$pd_options['center_button']);
|
111 |
-
echo '<br/>';
|
112 |
-
|
113 |
-
PayPalDonations_Admin::checkbox(
|
114 |
-
__('Set Checkout Language:', 'paypal-donations'),
|
115 |
-
'set_checkout_language',
|
116 |
-
isset($pd_options['set_checkout_language']) ? $pd_options['set_checkout_language'] : false);
|
117 |
-
?>
|
118 |
-
|
119 |
-
<?php
|
120 |
-
if (isset($pd_options['checkout_language'])) { $checkout_language = $pd_options['checkout_language']; } else { $checkout_language = ''; }
|
121 |
-
?>
|
122 |
-
<select name="checkout_language" id="checkout_language">
|
123 |
-
<option value="">None</option>
|
124 |
-
<?php
|
125 |
-
foreach ( $checkout_languages as $key => $language ) {
|
126 |
-
echo '<option value="'.$key.'"';
|
127 |
-
if ($checkout_language == $key) { echo ' selected="selected"'; }
|
128 |
-
echo '>'.$language.'</option>';
|
129 |
-
}?>
|
130 |
-
</select>
|
131 |
-
<br/>
|
132 |
-
|
133 |
-
|
134 |
-
<p class="submit">
|
135 |
-
<input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Changes', 'paypal-donations' ) ?>" />
|
136 |
-
</p>
|
137 |
-
</div>
|
1 |
+
<!-- Create a header in the default WordPress 'wrap' container -->
|
2 |
+
<div class="wrap">
|
3 |
+
<div id="icon-plugins" class="icon32"></div>
|
4 |
<h2>PayPal Donations</h2>
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
<h2 class="nav-tab-wrapper">
|
7 |
+
<ul id="paypal-donations-tabs">
|
8 |
+
<li id="paypal-donations-tab_1" class="nav-tab nav-tab-active"><?php _e('General', 'paypal-donations'); ?></li>
|
9 |
+
<li id="paypal-donations-tab_2" class="nav-tab"><?php _e('Advanced', 'paypal-donations'); ?></li>
|
10 |
+
</ul>
|
11 |
+
</h2>
|
12 |
+
|
13 |
+
<form method="post" action="options.php">
|
14 |
+
<?php settings_fields($optionDBKey); ?>
|
15 |
+
<div id="paypal-donations-tabs-content">
|
16 |
+
<div id="paypal-donations-tab-content-1">
|
17 |
+
<?php do_settings_sections($pageSlug); ?>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
<?php submit_button(); ?>
|
21 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/paypal-button.php
CHANGED
@@ -20,6 +20,8 @@
|
|
20 |
$paypal_btn .= '<input type="hidden" name="amount" value="' . apply_filters( 'paypal_donations_amount', $amount ) . '" />';
|
21 |
|
22 |
// More Settings
|
|
|
|
|
23 |
if (isset($pd_options['currency_code']))
|
24 |
$paypal_btn .= '<input type="hidden" name="currency_code" value="' .$pd_options['currency_code']. '" />';
|
25 |
if (isset($pd_options['button_localized']))
|
20 |
$paypal_btn .= '<input type="hidden" name="amount" value="' . apply_filters( 'paypal_donations_amount', $amount ) . '" />';
|
21 |
|
22 |
// More Settings
|
23 |
+
if (isset($pd_options['return_method']))
|
24 |
+
$paypal_btn .= '<input type="hidden" name="rm" value="' .$pd_options['return_method']. '" />';
|
25 |
if (isset($pd_options['currency_code']))
|
26 |
$paypal_btn .= '<input type="hidden" name="currency_code" value="' .$pd_options['currency_code']. '" />';
|
27 |
if (isset($pd_options['button_localized']))
|