PluginProbe
Mailchimp List Subscribe Form / 1.5.9
Mailchimp List Subscribe Form v1.5.9
1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 All 55 releases
mailchimp / views / setup_page.php

setup_page.php in Mailchimp List Subscribe Form 1.5.9, at views/setup_page.php

453 lines 21.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="wrap">
2
3 <div class="mailchimp-header">
4 <h2><?php esc_html_e('MailChimp List Setup', 'mailchimp_i18n');?> </h2>
5 </div>
6 <?php
7
8 $user = get_option('mc_user');
9 /* TODO MC SOPRESTO USER INFO */
10
11 // If we have an API Key, see if we need to change the lists and its options
12 mailchimpSF_change_list_if_necessary();
13
14 // Display our success/error message(s) if have them
15 if (mailchimpSF_global_msg() != ''){
16 // Message has already been html escaped, so we don't want to 2x escape it here
17 ?>
18 <div id="mc_message" class=""><?php echo mailchimpSF_global_msg(); ?></div>
19 <?php
20 }
21
22 // If we don't have an API Key, do a login form
23 if (!$user || !get_option('mc_api_key')) {
24 ?>
25 <div>
26 <h3 class="mc-h2"><?php esc_html_e('Log In', 'mailchimp_i18n');?></h3>
27 <p class="mc-p" style="width: 40%;line-height: 21px;"><?php echo __('To get started, we’ll need to access your MailChimp account with an <a href="http://kb.mailchimp.com/integrations/api-integrations/about-api-keys">API Key</a>. Paste your MailChimp API key, and click <strong>Connect</strong> to continue.
28 ', 'mailchimp_i18n'); ?></p>
29 <p class="mc-a">
30 <?php
31 echo sprintf(
32 '%1$s <a href="http://www.mailchimp.com/signup/" target="_blank">%2$s</a>',
33 esc_html(__("Don't have a MailChimp account?", 'mailchimp_i18n')),
34 esc_html(__('Try one for Free!', 'mailchimp_i18n'))
35 );
36 ?>
37 </p>
38
39 <div style="width: 900px;">
40 <table class="widefat mc-widefat mc-api">
41 <form method="POST" action="">
42 <tr valign="top">
43 <th scope="row" class="mailchimp-connect"><?php esc_html_e('Connect to MailChimp', 'mailchimp_i18n'); ?></th>
44 <td>
45 <input type="hidden" name="mcsf_action" value="login"/>
46 <input type="password" name="mailchimpSF_api_key" placeholder="API Key">
47 </td>
48 <td>
49 <?php wp_nonce_field('mc_login', '_mcsf_nonce_action'); ?>
50 <input type="submit" value="Connnect">
51 </td>
52 </tr>
53 </form>
54 </table>
55 </div>
56 </div>
57
58 <br/>
59 <?php
60 if ($user && $user['username'] != '') {
61 ?>
62 <!--<div class="notes_msg">
63 <strong><?php esc_html_e('Notes', 'mailchimp_i18n'); ?>:</strong>
64 <ul>
65 <li><?php esc_html_e('Changing your settings at MailChimp.com may cause this to stop working.', 'mailchimp_i18n'); ?></li>
66 <li><?php esc_html_e('If you change your login to a different account, the info you have setup below will be erased.', 'mailchimp_i18n'); ?></li>
67 <li><?php esc_html_e('If any of that happens, no biggie - just reconfigure your login and the items below...', 'mailchimp_i18n'); ?></li>
68 </ul>
69 </div>-->
70 <?php
71 }
72 } // End of login form
73
74 // Start logout form
75 else {
76 ?>
77 <table style="min-width:400px;" class="mc-user" cellspacing="0">
78 <tr>
79 <td><h3><?php esc_html_e('Logged in as', 'mailchimp_i18n');?>: <?php echo esc_html($user['username']);
80 ?></h3>
81 </td>
82 <td>
83 <form method="post" action="">
84 <input type="hidden" name="mcsf_action" value="logout"/>
85 <input type="submit" name="Submit" value="<?php esc_attr_e('Logout', 'mailchimp_i18n');?>" class="button" />
86 <?php wp_nonce_field('mc_logout', '_mcsf_nonce_action'); ?>
87 </form>
88 </td>
89 </tr>
90 </table>
91 <?php
92 } // End Logout form
93
94 //Just get out if nothing else matters...
95 $api = mailchimpSF_get_api();
96 if (!$api) { return; }
97
98 if ($api){
99 ?>
100 <h3 class="mc-h2"><?php esc_html_e('Your Lists', 'mailchimp_i18n'); ?></h3>
101
102 <div>
103
104 <p class="mc-p"><?php esc_html_e('Please select the MailChimp list you’d like to connect to your form.', 'mailchimp_i18n'); ?></p>
105 <p class="mc-list-note"><strong><?php esc_html_e('Note:', 'mailchimp_i18n'); ?></strong> <?php esc_html_e('Updating your list will not remove list settings in this plugin, but changing lists will.', 'mailchimp_i18n'); ?></p>
106
107 <form method="post" action="options-general.php?page=mailchimpSF_options">
108 <?php
109 //we *could* support paging, but few users have that many lists (and shouldn't)
110 $lists = $api->get('lists', 100, array('fields' => 'lists.id,lists.name,lists.email_type_option'));
111 $lists = $lists['lists'];
112
113 if (count($lists) == 0) {
114 ?>
115 <span class='error_msg'>
116 <?php
117 echo sprintf(
118 esc_html(__("Uh-oh, you don't have any lists defined! Please visit %s, login, and setup a list before using this tool!", 'mailchimp_i18n')),
119 "<a href='http://www.mailchimp.com/'>MailChimp</a>"
120 );
121 ?>
122 </span>
123 <?php
124 }
125 else {
126 ?>
127 <table style="min-width:400px" class="mc-list-select" cellspacing="0">
128 <tr class="mc-list-row">
129 <td>
130 <select name="mc_list_id" style="min-width:200px;">
131 <option value=""> &mdash; <?php esc_html_e('Select A List','mailchimp_i18n'); ?> &mdash; </option>
132 <?php
133 foreach ($lists as $list) {
134 $option = get_option('mc_list_id');
135 ?>
136 <option value="<?php echo esc_attr($list['id']); ?>"<?php selected($list['id'], $option); ?>><?php echo esc_html($list['name']); ?></option>
137 <?php
138 }
139 ?>
140 </select>
141 </td>
142 <td>
143 <input type="hidden" name="mcsf_action" value="update_mc_list_id" />
144 <?php wp_nonce_field( 'update_mc_list_id_action', 'update_mc_list_id_nonce' ); ?>
145 <input type="submit" name="Submit" value="<?php esc_attr_e('Update List', 'mailchimp_i18n'); ?>" class="button" />
146 </td>
147 </tr>
148 </table>
149 <?php
150 } //end select list
151 ?>
152 </form>
153 </div>
154
155 <br/>
156
157 <?php
158 }
159 else {
160 //display the selected list...
161 ?>
162
163 <p class="submit">
164 <form method="post" action="options-general.php?page=mailchimpSF_options">
165 <input type="hidden" name="mcsf_action" value="reset_list" />
166 <input type="submit" name="reset_list" value="<?php esc_attr_e('Reset List Options and Select again', 'mailchimp_i18n'); ?>" class="button" />
167 <?php wp_nonce_field('reset_mailchimp_list', '_mcsf_nonce_action'); ?>
168 </form>
169 </p>
170 <h3><?php esc_html_e('Subscribe Form Widget Settings for this List', 'mailchimp_i18n'); ?>:</h3>
171 <h4><?php esc_html_e('Selected MailChimp List', 'mailchimp_i18n'); ?>: <?php echo esc_html(get_option('mc_list_name')); ?></h4>
172 <?php
173 }
174
175 //Just get out if nothing else matters...
176 if (get_option('mc_list_id') == '') return;
177
178
179 // The main Settings form
180 ?>
181
182 <div>
183 <form method="post" action="options-general.php?page=mailchimpSF_options">
184 <div style="width:900px;">
185 <input type="hidden" name="mcsf_action" value="change_form_settings">
186 <?php wp_nonce_field('update_general_form_settings', '_mcsf_nonce_action'); ?>
187
188 <table class="widefat mc-widefat mc-label-options">
189 <tr><th colspan="2">Content Options</th></tr>
190 <tr valign="top">
191 <th scope="row"><?php esc_html_e('Header', 'mailchimp_i18n'); ?></th>
192 <td>
193 <textarea name="mc_header_content" rows="2" cols="70"><?php echo esc_html(get_option('mc_header_content')); ?></textarea><br/>
194 <?php esc_html_e('Add your own text, HTML markup (including image links), or keep it blank.', 'mailchimp_i18n'); ?>
195 </td>
196 </tr>
197
198 <tr valign="top">
199 <th scope="row"><?php esc_html_e('Sub-header', 'mailchimp_i18n'); ?></th>
200 <td>
201 <textarea name="mc_subheader_content" rows="2" cols="70"><?php echo esc_html(get_option('mc_subheader_content')); ?></textarea><br/>
202 <?php esc_html_e('Add your own text, HTML markup (including image links), or keep it blank.', 'mailchimp_i18n'); ?>.<br/>
203 <?php esc_html_e('This will be displayed under the heading and above the form.', 'mailchimp_i18n'); ?>
204 </td>
205 </tr>
206
207 <tr valign="top" class="last-row">
208 <th scope="row"><?php esc_html_e('Submit Button', 'mailchimp_i18n'); ?></th>
209 <td>
210 <input type="text" name="mc_submit_text" size="70" value="<?php echo esc_attr(get_option('mc_submit_text')); ?>"/>
211 </td>
212 </tr>
213 </table>
214
215 <input type="submit" value="<?php esc_attr_e('Update Subscribe Form Settings', 'mailchimp_i18n'); ?>" class="button mc-submit" /><br/>
216
217 <table class="widefat mc-widefat mc-nuke-styling">
218 <tr><th colspan="2">Remove MailChimp CSS</th></tr>
219 <tr class="mc-internal-heading"><th><label for="mc_nuke_all_styles"><?php esc_html_e('Remove CSS');?></label></th><td><span class="mc-pre-input"></span><input type="checkbox" name="mc_nuke_all_styles" id="mc_nuke_all_styles" <?php checked(get_option('mc_nuke_all_styles'), true);?> onclick="showMe('mc-custom-styling')"/><?php esc_html_e('This will disable all MailChimp CSS, so it’s recommended for WordPress experts only.');?></td></tr>
220 </table>
221 <?php if(get_option('mc_nuke_all_styles') == true) {
222 ?>
223 <table class="widefat mc-widefat mc-custom-styling" id="mc-custom-styling" style="display:none">
224 <?php } else {?>
225 <table class="widefat mc-widefat mc-custom-styling" id="mc-custom-styling">
226 <?php } ?>
227 <tr><th colspan="2">Custom Styling</th></tr>
228 <tr class="mc-turned-on"><th><label for="mc_custom_style"><?php esc_html_e('Enabled?', 'mailchimp_i18n'); ?></label></th><td><span class="mc-pre-input"></span><input type="checkbox" name="mc_custom_style" id="mc_custom_style"<?php checked(get_option('mc_custom_style'), 'on'); ?> /><?php esc_html_e('Edit the default MailChimp CSS style.');?></td></tr>
229
230 <tr><th><?php esc_html_e('Border Width (px)', 'mailchimp_i18n'); ?></th><td><span class="mc-pre-input"></span><input type="text" name="mc_form_border_width" size="3" maxlength="3" value="<?php echo esc_attr(get_option('mc_form_border_width')); ?>"/>
231 <em><?php esc_html_e('Set to 0 for no border, do not enter', 'mailchimp_i18n'); ?> px</em>
232 </td></tr>
233 <tr><th><?php esc_html_e('Border Color', 'mailchimp_i18n'); ?></th><td><span class="mc-pre-input">#</span><input type="text" name="mc_form_border_color" size="7" maxlength="6" value="<?php echo esc_attr(get_option('mc_form_border_color')); ?>"/>
234 <em><?php esc_html_e('Do not enter initial', 'mailchimp_i18n'); ?> <strong>#</strong></em>
235 </td></tr>
236 <tr><th><?php esc_html_e('Text Color', 'mailchimp_i18n'); ?></th><td><span class="mc-pre-input">#</span><input type="text" name="mc_form_text_color" size="7" maxlength="6" value="<?php echo esc_attr(get_option('mc_form_text_color')); ?>"/>
237 <em><?php esc_html_e('Do not enter initial', 'mailchimp_i18n'); ?> <strong>#</strong></em>
238 </td></tr>
239 <tr class="last-row"><th><?php esc_html_e('Background Color', 'mailchimp_i18n'); ?></th><td><span class="mc-pre-input">#</span><input type="text" name="mc_form_background" size="7" maxlength="6" value="<?php echo esc_attr(get_option('mc_form_background')); ?>"/>
240 <em><?php esc_html_e('Do not enter initial', 'mailchimp_i18n'); ?> <strong>#</strong></em>
241 </td></tr>
242 </table>
243
244 <input type="submit" value="<?php esc_attr_e('Update Subscribe Form Settings', 'mailchimp_i18n'); ?>" class="button mc-submit" /><br/>
245
246
247 <table class="widefat mc-widefat">
248 <tr><th colspan="2">List Options</th></tr>
249 <tr valign="top">
250 <th scope="row"><?php esc_html_e('MonkeyRewards', 'mailchimp_i18n'); ?>?</th>
251 <td><input name="mc_rewards" type="checkbox"<?php if (get_option('mc_rewards')=='on' || get_option('mc_rewards')=='' ) { echo ' checked="checked"'; } ?> id="mc_rewards" class="code" />
252 <em><label for="mc_rewards"><?php echo __('We’ll add a "powered by MailChimp" link to your form that will help you earn <a href="http://kb.mailchimp.com/accounts/account-setup/monkeyrewards-credits" target="_blank">MonkeyRewards</a>. You can turn it off at any time.', 'mailchimp_i18n'); ?></label></em>
253 </td>
254 </tr>
255
256 <tr valign="top">
257 <th scope="row"><?php esc_html_e('Use JavaScript Support?', 'mailchimp_i18n'); ?></th>
258 <td><input name="mc_use_javascript" type="checkbox" <?php checked(get_option('mc_use_javascript'), 'on'); ?> id="mc_use_javascript" class="code" />
259 <em><label for="mc_use_javascript"><?php esc_html_e('This plugin uses JavaScript submission, and it should degrade gracefully for users not using JavaScript. It is optional, and you can turn it off at any time.', 'mailchimp_i18n'); ?></label></em>
260 </td>
261 </tr>
262
263 <tr valign="top">
264 <th scope="row"><?php esc_html_e('Use JavaScript Datepicker?', 'mailchimp_i18n'); ?></th>
265 <td><input name="mc_use_datepicker" type="checkbox" <?php checked(get_option('mc_use_datepicker'), 'on'); ?> id="mc_use_datepicker" class="code" />
266 <em><label for="mc_use_datepicker"><?php esc_html_e('We’ll use the jQuery UI Datepicker for dates.', 'mailchimp_i18n'); ?></label></em>
267 </td>
268 </tr>
269
270 <tr valign="top">
271 <th scope="row"><?php esc_html_e('Use Double Opt-In (Recommended)?', 'mailchimp_i18n'); ?></th>
272 <td><input name="mc_double_optin" type="checkbox" <?php checked(get_option('mc_double_optin'), true); ?> id="mc_double_optin" class="code" />
273 <em><label for="mc_double_optin"><?php esc_html_e('Before new your subscribers are added via the plugin, they\'ll need to confirm their email address.', 'mailchimp_i18n'); ?></label></em>
274 </td>
275 </tr>
276 <tr valign="top">
277 <th scope="row"><?php esc_html_e('Update existing subscribers?', 'mailchimp_i18n'); ?></th>
278 <td><input name="mc_update_existing" type="checkbox" <?php checked(get_option('mc_update_existing'), true); ?> id="mc_update_existing" class="code" />
279 <em><label for="mc_double_optin"><?php esc_html_e('If an existing subscriber fills out this form, we will update their information with what\'s provided.', 'mailchimp_i18n'); ?></label></em>
280 </td>
281 </tr>
282
283 <tr valign="top" class="last-row">
284 <th scope="row"><?php esc_html_e('Include Unsubscribe link?', 'mailchimp_i18n'); ?></th>
285 <td><input name="mc_use_unsub_link" type="checkbox"<?php checked(get_option('mc_use_unsub_link'), 'on'); ?> id="mc_use_unsub_link" class="code" />
286 <em><label for="mc_use_unsub_link"><?php esc_html_e('We’ll automatically add a link to your list’s unsubscribe form.', 'mailchimp_i18n'); ?></label></em>
287 </td>
288 </tr>
289 </table>
290
291 </div>
292
293 <div style="width:900px;">
294
295 <input type="submit" value="<?php esc_attr_e('Update Subscribe Form Settings', 'mailchimp_i18n'); ?>" class="button mc-submit" /><br/>
296
297 <table class='widefat mc-widefat'>
298 <tr>
299 <th colspan="4">
300 <?php esc_html_e('Merge Fields Included', 'mailchimp_i18n'); ?>
301
302 <?php
303 $mv = get_option('mc_merge_vars');
304
305 if (count($mv) == 0 || !is_array($mv)){
306 ?>
307 <em><?php esc_html_e('No Merge Fields found.', 'mailchimp_i18n'); ?></em>
308 <?php
309 } else {
310 ?>
311 </th>
312 </tr>
313 <tr valign="top">
314 <th><?php esc_html_e('Name', 'mailchimp_i18n');?></th>
315 <th><?php esc_html_e('Tag', 'mailchimp_i18n');?></th>
316 <th><?php esc_html_e('Required?', 'mailchimp_i18n');?></th>
317 <th><?php esc_html_e('Include?', 'mailchimp_i18n');?></th>
318 </tr>
319 <?php
320 foreach($mv as $var){
321 ?>
322 <tr valign="top">
323 <td><?php echo esc_html($var['name']); ?></td>
324 <td><?php echo esc_html($var['tag']); ?></td>
325 <td><?php echo esc_html(($var['required'] == 1) ? 'Y' : 'N'); ?></td>
326 <td>
327 <?php
328 if (!$var['required']){
329 $opt = 'mc_mv_'.$var['tag'];
330 ?>
331 <input name="<?php echo esc_attr($opt); ?>" type="checkbox" id="<?php echo esc_attr($opt); ?>" class="code"<?php checked(get_option($opt), 'on'); ?> />
332 <?php
333 } else {
334 ?>
335 &nbsp;&mdash;&nbsp;
336 <?php
337 }
338 ?>
339 </td>
340 </tr>
341 <?php
342 }
343 ?>
344 </table>
345 <input type="submit" value="<?php esc_attr_e('Update Subscribe Form Settings', 'mailchimp_i18n'); ?>" class="button mc-submit" /><br/>
346 </div>
347
348 <?php
349 // Interest Groups Table
350 $igs = get_option('mc_interest_groups');
351 if (is_array($igs) && !isset($igs['id'])) { ?>
352 <h3 class="mc-h3"><?php esc_html_e('Group Settings', 'mailchimp_i18n'); ?></h3> <?php
353 // Determines whether or not to continue processing. Only false if there was an error.
354 $continue = true;
355 foreach ($igs as $ig) {
356 if ($continue) {
357 if (!is_array($ig) || empty($ig) || $ig == 'N' ) {
358 ?>
359 <em><?php esc_html_e('No Interest Groups Setup for this List', 'mailchimp_i18n'); ?></em>
360 <?php
361 $continue = false;
362 }
363 else {
364 ?>
365 <table class='mc-widefat mc-blue' width="450px" cellspacing="0">
366 <tr valign="top">
367 <th colspan="2"><?php echo esc_html($ig['title']); ?></th>
368 </tr>
369 <tr valign="top">
370 <th>
371 <label for="<?php echo esc_attr('mc_show_interest_groups_'.$ig['id']); ?>"><?php esc_html_e('Show?', 'mailchimp_i18n'); ?></label>
372 </th>
373 <th>
374 <input name="<?php echo esc_attr('mc_show_interest_groups_'.$ig['id']); ?>" id="<?php echo esc_attr('mc_show_interest_groups_'.$ig['id']); ?>" type="checkbox" class="code"<?php checked('on', get_option('mc_show_interest_groups_'.$ig['id'])); ?> />
375 </th>
376 </tr>
377 <tr valign="top">
378 <th><?php esc_html_e('Input Type', 'mailchimp_i18n'); ?></th>
379 <td><?php echo esc_html($ig['type']); ?></td>
380 </tr>
381 <tr valign="top" class="last-row">
382 <th><?php esc_html_e('Options', 'mailchimp_i18n'); ?></th>
383 <td>
384 <ul>
385 <?php
386 foreach($ig['groups'] as $interest){
387 ?>
388 <li><?php echo esc_html($interest['name']); ?></li>
389 <?php
390 }
391 ?>
392 </ul>
393 </td>
394 </tr>
395 </table>
396 <?php
397 }
398 }
399 }
400 }
401 }
402 ?>
403 <div style="width: 900px; margin-top: 35px;">
404 <table class="widefat mc-widefat mc-yellow">
405 <tr><th colspan="2">CSS Cheat Sheet</th></tr>
406 <tr valign="top">
407 <th scope="row">.widget_mailchimpsf_widget </th>
408 <td>This targets the entire widget container.</td>
409 </tr>
410 <tr valign="top">
411 <th scope="row">.widget-title</th>
412 <td>This styles the title of your MailChimp widget. <i>Modifying this class will affect your other widget titles.</i></td>
413 </tr>
414 <tr valign="top">
415 <th scope="row">#mc_signup</th>
416 <td>This targets the entirity of the widget beneath the widget title.</td>
417 </tr>
418 <tr valign="top">
419 <th scope="row">#mc_subheader</th>
420 <td>This styles the subheader text.</td>
421 </tr>
422 <tr valign="top">
423 <th scope="row">.mc_form_inside</th>
424 <td>The guts and main container for the all of the form elements (the entirety of the widget minus the header and the sub header).</td>
425 </tr>
426 <tr valign="top">
427 <th scope="row">.mc_header</th>
428 <td>This targets the label above the input fields.</td>
429 </tr>
430 <tr valign="top">
431 <th scope="row">.mc_input</th>
432 <td>This attaches to the input fields.</td>
433 </tr>
434 <tr valign="top">
435 <th scope="row">.mc_header_address</th>
436 <td>This is the label above an address group.</td>
437 </tr>
438 <tr valign="top">
439 <th scope="row">.mc_radio_label</th>
440 <td>These are the labels associated with radio buttons.</td>
441 </tr>
442 <tr valign="top">
443 <th scope="row">#mc-indicates-required</th>
444 <td>This targets the “Indicates Required Field” text.</td>
445 </tr>
446 <tr valign="top">
447 <th scope="row">#mc_signup_submit</th>
448 <td>Use this to style the submit button.</td>
449 </tr>
450 </table>
451 </div>
452
453 </form>