first commit

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-08 12:19:53 -04:00
commit 7c8c8b1c76
4586 changed files with 2050693 additions and 0 deletions
@@ -0,0 +1,86 @@
<?php defined('ABSPATH') or exit; ?>
<div id="mc4wp-admin" class="wrap mc4wp-settings">
<div class="row">
<!-- Main Content -->
<div class="main-content col col-4">
<h1 class="page-title">
<?php _e("Add new form", 'mailchimp-for-wp'); ?>
</h1>
<h2 style="display: none;"></h2><?php // fake h2 for admin notices?>
<div style="max-width: 480px;">
<!-- Wrap entire page in <form> -->
<form method="post">
<input type="hidden" name="_mc4wp_action" value="add_form" />
<?php wp_nonce_field('add_form', '_mc4wp_nonce'); ?>
<div class="small-margin">
<h3>
<label>
<?php _e('What is the name of this form?', 'mailchimp-for-wp'); ?>
</label>
</h3>
<input type="text" name="mc4wp_form[name]" class="widefat" value="" spellcheck="true" autocomplete="off" placeholder="<?php _e('Enter your form title..', 'mailchimp-for-wp'); ?>">
</div>
<div class="small-margin">
<h3>
<label>
<?php _e('To which Mailchimp lists should this form subscribe?', 'mailchimp-for-wp'); ?>
</label>
</h3>
<?php if (! empty($lists)) {
?>
<ul id="mc4wp-lists">
<?php foreach ($lists as $list) {
?>
<li>
<label>
<input type="checkbox" name="mc4wp_form[settings][lists][<?php echo esc_attr($list->id); ?>]" value="<?php echo esc_attr($list->id); ?>" <?php checked($number_of_lists, 1); ?> >
<?php echo esc_html($list->name); ?>
</label>
</li>
<?php
} ?>
</ul>
<?php
} else {
?>
<p class="mc4wp-notice">
<?php printf(__('No lists found. Did you <a href="%s">connect with Mailchimp</a>?', 'mailchimp-for-wp'), admin_url('admin.php?page=mailchimp-for-wp')); ?>
</p>
<?php
} ?>
</div>
<?php submit_button(__('Add new form', 'mailchimp-for-wp')); ?>
</form><!-- Entire page form wrap -->
</div>
<?php include MC4WP_PLUGIN_DIR . 'includes/views/parts/admin-footer.php'; ?>
</div><!-- / Main content -->
<!-- Sidebar -->
<div class="sidebar col col-2">
<?php include MC4WP_PLUGIN_DIR . 'includes/views/parts/admin-sidebar.php'; ?>
</div>
</div>
</div>
@@ -0,0 +1,127 @@
<?php defined('ABSPATH') or exit;
$tabs = array(
'fields' => __('Fields', 'mailchimp-for-wp'),
'messages' => __('Messages', 'mailchimp-for-wp'),
'settings' => __('Settings', 'mailchimp-for-wp'),
'appearance' => __('Appearance', 'mailchimp-for-wp')
);
/**
* Filters the setting tabs on the "edit form" screen.
*
* @param array $tabs
* @ignore
*/
$tabs = apply_filters('mc4wp_admin_edit_form_tabs', $tabs);
?>
<div id="mc4wp-admin" class="wrap mc4wp-settings">
<p class="breadcrumbs">
<span class="prefix"><?php echo __('You are here: ', 'mailchimp-for-wp'); ?></span>
<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp'); ?>">Mailchimp for WordPress</a> &rsaquo;
<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-forms'); ?>"><?php _e('Forms', 'mailchimp-for-wp'); ?></a>
&rsaquo;
<span class="current-crumb"><strong><?php echo __('Form', 'mailchimp-for-wp'); ?> <?php echo $form_id; ?>
| <?php echo esc_html($form->name); ?></strong></span>
</p>
<div class="row">
<!-- Main Content -->
<div class="main-content col col-5">
<h1 class="page-title">
<?php _e("Edit Form", 'mailchimp-for-wp'); ?>
<!-- Form actions -->
<?php
/**
* @ignore
*/
do_action('mc4wp_admin_edit_form_after_title');
?>
</h1>
<h2 style="display: none;"></h2><?php // fake h2 for admin notices?>
<!-- Wrap entire page in <form> -->
<form method="post">
<?php // default submit button to prevent opening preview?>
<input type="submit" style="display: none; "/>
<input type="hidden" name="_mc4wp_action" value="edit_form"/>
<input type="hidden" name="mc4wp_form_id" value="<?php echo esc_attr($form->ID); ?>"/>
<?php wp_nonce_field('edit_form', '_mc4wp_nonce'); ?>
<div id="titlediv" class="small-margin">
<div id="titlewrap">
<label class="screen-reader-text"
for="title"><?php _e('Enter form title here', 'mailchimp-for-wp'); ?></label>
<input type="text" name="mc4wp_form[name]" size="30"
value="<?php echo esc_attr($form->name); ?>" id="title" spellcheck="true"
autocomplete="off"
placeholder="<?php echo __("Enter the title of your sign-up form", 'mailchimp-for-wp'); ?>"
style="line-height: initial;">
</div>
<div>
<?php printf(__('Use the shortcode %s to display this form inside a post, page or text widget.', 'mailchimp-for-wp'), '<input type="text" onfocus="this.select();" readonly="readonly" value="'. esc_attr(sprintf('[mc4wp_form id="%d"]', $form->ID)) .'" size="'. (strlen($form->ID) + 18) .'">'); ?>
</div>
</div>
<div>
<h2 class="nav-tab-wrapper" id="mc4wp-tabs-nav">
<?php foreach ($tabs as $tab => $name) {
$class = ($active_tab === $tab) ? 'nav-tab-active' : '';
echo sprintf('<a class="nav-tab nav-tab-%s %s" href="%s">%s</a>', $tab, $class, esc_attr($this->tab_url($tab)), $name);
} ?>
</h2>
<div id="mc4wp-tabs">
<?php foreach ($tabs as $tab => $name) :
$class = ($active_tab === $tab) ? 'tab-active' : '';
// start of .tab
echo sprintf('<div class="tab %s" id="tab-%s">', $class, $tab);
/**
* Runs when outputting a tab section on the "edit form" screen
*
* @param string $tab
* @ignore
*/
do_action('mc4wp_admin_edit_form_output_' . $tab . '_tab', $opts, $form);
$tab_file = dirname(__FILE__) . '/tabs/form-' . $tab . '.php';
if (file_exists($tab_file)) {
include $tab_file;
}
// end of .tab
echo '</div>';
endforeach; // foreach tabs?>
</div><!-- / tabs -->
</div>
</form><!-- Entire page form wrap -->
<?php include MC4WP_PLUGIN_DIR . 'includes/views/parts/admin-footer.php'; ?>
</div>
<!-- Sidebar -->
<div class="sidebar col col-1">
<?php include MC4WP_PLUGIN_DIR . 'includes/views/parts/admin-sidebar.php'; ?>
</div>
</div>
</div>
@@ -0,0 +1,17 @@
/* test if browser supports date fields */
var testInput = document.createElement('input');
testInput.setAttribute('type', 'date');
if( testInput.type !== 'date') {
/* add placeholder & pattern to all date fields */
var dateFields = document.querySelectorAll('.mc4wp-form input[type="date"]');
for(var i=0; i<dateFields.length; i++) {
if(!dateFields[i].placeholder) {
dateFields[i].placeholder = 'YYYY-MM-DD';
}
if(!dateFields[i].pattern) {
dateFields[i].pattern = '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])';
}
}
}
@@ -0,0 +1,15 @@
(function() {
if (!window.mc4wp) {
window.mc4wp = {
listeners: [],
forms : {
on: function (event, callback) {
window.mc4wp.listeners.push({
event : event,
callback: callback
});
}
}
}
}
})();
@@ -0,0 +1,7 @@
function addEventListener(element,event,handler) {
if(element.addEventListener) {
element.addEventListener(event,handler, false);
} else if(element.attachEvent){
element.attachEvent('on'+event,handler);
}
}
@@ -0,0 +1,12 @@
function maybePrefixUrlField() {
if(this.value.trim() !== '' && this.value.indexOf('http') !== 0) {
this.value = "http://" + this.value;
}
}
var urlFields = document.querySelectorAll('.mc4wp-form input[type="url"]');
if( urlFields && urlFields.length > 0 ) {
for( var j=0; j < urlFields.length; j++ ) {
addEventListener(urlFields[j],'blur',maybePrefixUrlField);
}
}
@@ -0,0 +1,53 @@
<?php defined('ABSPATH') or exit; ?>
<div class="mc4wp-admin">
<h2><?php _e('Add more fields', 'mailchimp-for-wp'); ?></h2>
<div class="help-text">
<p>
<?php echo __('To add more fields to your form, you will need to create those fields in Mailchimp first.', 'mailchimp-for-wp'); ?>
</p>
<p><strong><?php echo __("Here's how:", 'mailchimp-for-wp'); ?></strong></p>
<ol>
<li>
<p>
<?php echo __('Log in to your Mailchimp account.', 'mailchimp-for-wp'); ?>
</p>
</li>
<li>
<p>
<?php echo __('Add list fields to any of your selected lists.', 'mailchimp-for-wp'); ?>
<?php echo __('Clicking the following links will take you to the right screen.', 'mailchimp-for-wp'); ?>
</p>
<ul class="children lists--only-selected">
<?php foreach ($lists as $list) {
?>
<li data-list-id="<?php echo $list->id; ?>" style="display: <?php echo in_array($list->id, $opts['lists']) ? '' : 'none'; ?>">
<a href="https://admin.mailchimp.com/lists/settings/merge-tags?id=<?php echo $list->web_id; ?>">
<span class="screen-reader-text"><?php _e('Edit list fields for', 'mailchimp-for-wp'); ?> </span>
<?php echo $list->name; ?>
</a>
</li>
<?php
} ?>
</ul>
</li>
<li>
<p>
<?php echo __('Click the following button to have Mailchimp for WordPress pick up on your changes.', 'mailchimp-for-wp'); ?>
</p>
<p>
<a class="button button-primary" href="<?php echo esc_attr(add_query_arg(array( '_mc4wp_action' => 'empty_lists_cache' ))); ?>">
<?php _e('Renew Mailchimp lists', 'mailchimp-for-wp'); ?>
</a>
</p>
</li>
</ol>
</div>
</div>
@@ -0,0 +1,21 @@
<?php
defined('ABSPATH') or exit;
$tags = mc4wp('forms')->get_tags();
?>
<h2><?php _e('Add dynamic form variable', 'mailchimp-for-wp'); ?></h2>
<p>
<?php echo sprintf(__('The following list of variables can be used to <a href="%s">add some dynamic content to your form or success and error messages</a>.', 'mailchimp-for-wp'), 'https://kb.mc4wp.com/using-variables-in-your-form-or-messages/') . ' ' . __('This allows you to personalise your form or response messages.', 'mailchimp-for-wp'); ?>
</p>
<table class="widefat striped">
<?php foreach ($tags as $tag => $config) {
$tag = ! empty($config['example']) ? $config['example'] : $tag; ?>
<tr>
<td>
<input type="text" class="widefat" value="<?php echo esc_attr(sprintf('{%s}', $tag)); ?>" readonly="readonly" onfocus="this.select();" />
<p class="help" style="margin-bottom:0;"><?php echo strip_tags($config['description'], '<strong><b><em><i><a><code>'); ?></p>
</td>
</tr>
<?php
} ?>
</table>
@@ -0,0 +1,53 @@
<?php
defined('ABSPATH') or exit;
// fake post to prevent notices in wp_enqueue_scripts call
$GLOBALS['post'] = new \WP_Post((object) array( 'filter' => 'raw' ));
// render simple page with form in it.
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php
wp_enqueue_scripts();
wp_print_styles();
wp_print_head_scripts();
if (function_exists('wp_custom_css_cb')) {
wp_custom_css_cb();
}
?>
<style type="text/css">
body{
background: white;
width: 100%;
max-width: 100%;
text-align: left;
}
/* hide all other elements */
body::before,
body::after,
body > *:not(#form-preview) {
display:none !important;
}
#form-preview {
display: block !important;
width: 100%;
height: 100%;
padding: 20px;
border: 0;
margin: 0;
}
</style>
</head>
<body class="page-template-default page ">
<div id="form-preview" class="page type-page status-publish hentry post post-content">
<?php mc4wp_show_form($form_id); ?>
</div>
<?php wp_footer(); ?>
</body>
</html>
@@ -0,0 +1,60 @@
<?php
$theme = wp_get_theme();
$css_options = array(
'0' => sprintf(__('Inherit from %s theme', 'mailchimp-for-wp'), $theme->Name),
'basic' => __('Basic', 'mailchimp-for-wp'),
__('Form Themes', 'mailchimp-for-wp') => array(
'theme-light' => __('Light Theme', 'mailchimp-for-wp'),
'theme-dark' => __('Dark Theme', 'mailchimp-for-wp'),
'theme-red' => __('Red Theme', 'mailchimp-for-wp'),
'theme-green' => __('Green Theme', 'mailchimp-for-wp'),
'theme-blue' => __('Blue Theme', 'mailchimp-for-wp'),
)
);
/**
* Filters the <option>'s in the "CSS Stylesheet" <select> box.
*
* @ignore
*/
$css_options = apply_filters('mc4wp_admin_form_css_options', $css_options);
?>
<h2><?php _e('Form Appearance', 'mailchimp-for-wp'); ?></h2>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="mc4wp_load_stylesheet_select"><?php _e('Form Style', 'mailchimp-for-wp'); ?></label></th>
<td class="nowrap valigntop">
<select name="mc4wp_form[settings][css]" id="mc4wp_load_stylesheet_select">
<?php foreach ($css_options as $key => $option) {
if (is_array($option)) {
$label = $key;
$options = $option;
printf('<optgroup label="%s">', $label);
foreach ($options as $key => $option) {
printf('<option value="%s" %s>%s</option>', $key, selected($opts['css'], $key, false), $option);
}
print('</optgroup>');
} else {
printf('<option value="%s" %s>%s</option>', $key, selected($opts['css'], $key, false), $option);
}
} ?>
</select>
<p class="help">
<?php _e('If you want to load some default CSS styles, select "basic formatting styles" or choose one of the color themes', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<?php
/** @ignore */
do_action('mc4wp_admin_form_after_appearance_settings_rows', $opts, $form);
?>
</table>
<?php submit_button(); ?>
@@ -0,0 +1,50 @@
<?php add_thickbox(); ?>
<div class="alignright">
<a href="#TB_inline?width=0&height=550&inlineId=mc4wp-form-variables" class="thickbox button-secondary">
<span class="dashicons dashicons-info"></span>
<?php _e('Form variables', 'mailchimp-for-wp'); ?>
</a>
<a href="#TB_inline?width=600&height=400&inlineId=mc4wp-add-field-help" class="thickbox button-secondary">
<span class="dashicons dashicons-editor-help"></span>
<?php _e('Add more fields', 'mailchimp-for-wp'); ?>
</a>
</div>
<h2><?php _e("Form Fields", 'mailchimp-for-wp'); ?></h2>
<!-- Placeholder for the field wizard -->
<div id="mc4wp-field-wizard"></div>
<div class="mc4wp-row">
<div class="mc4wp-col mc4wp-col-3 mc4wp-form-editor-wrap">
<h4 style="margin: 0"><label><?php _e('Form code', 'mailchimp-for-wp'); ?></label></h4>
<!-- Textarea for the actual form content HTML -->
<textarea class="widefat" cols="160" rows="20" id="mc4wp-form-content" name="mc4wp_form[content]" placeholder="<?php _e('Enter the HTML code for your form fields..', 'mailchimp-for-wp'); ?>" autocomplete="false" autocorrect="false" autocapitalize="false" spellcheck="false"><?php echo htmlspecialchars($form->content, ENT_QUOTES, get_option('blog_charset')); ?></textarea>
</div>
<div class="mc4wp-col mc4wp-col-3 mc4wp-form-preview-wrap">
<h4 style="margin: 0;">
<label><?php _e('Form preview', 'mailchimp-for-wp'); ?>
<span class="mc4wp-tooltip dashicons dashicons-editor-help" title="<?php esc_attr_e('The form may look slightly different than this when shown in a post, page or widget area.', 'mailchimp-for-wp'); ?>"></span>
</label>
</h4>
<iframe id="mc4wp-form-preview" src="<?php echo esc_attr($form_preview_url); ?>"></iframe>
</div>
</div>
<!-- This field is updated by JavaScript as the form content changes -->
<input type="hidden" id="required-fields" name="mc4wp_form[settings][required_fields]" value="<?php echo esc_attr($form->settings['required_fields']); ?>" />
<?php submit_button(); ?>
<p class="mc4wp-form-usage"><?php printf(__('Use the shortcode %s to display this form inside a post, page or text widget.', 'mailchimp-for-wp'), '<input type="text" onfocus="this.select();" readonly="readonly" value="'. esc_attr(sprintf('[mc4wp_form id="%d"]', $form->ID)) .'" size="'. (strlen($form->ID) + 18) .'">'); ?></p>
<?php // Content for Thickboxes?>
<div id="mc4wp-form-variables" style="display: none;">
<?php include dirname(__FILE__) . '/../parts/dynamic-content-tags.php'; ?>
</div>
<div id="mc4wp-add-field-help" style="display: none;">
<?php include dirname(__FILE__) . '/../parts/add-fields-help.php'; ?>
</div>
@@ -0,0 +1,95 @@
<?php defined('ABSPATH') or exit;
/** @var MC4WP_Form $form */
?>
<h2><?php _e('Form Messages', 'mailchimp-for-wp'); ?></h2>
<table class="form-table mc4wp-form-messages">
<?php
/** @ignore */
do_action('mc4wp_admin_form_before_messages_settings_rows', $opts, $form);
?>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_subscribed"><?php _e('Successfully subscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_subscribed" name="mc4wp_form[messages][subscribed]" value="<?php echo esc_attr($form->messages['subscribed']); ?>" />
<p class="help"><?php _e('The text that shows when an email address is successfully subscribed to the selected list(s).', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_invalid_email"><?php _e('Invalid email address', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_invalid_email" name="mc4wp_form[messages][invalid_email]" value="<?php echo esc_attr($form->messages['invalid_email']); ?>" required />
<p class="help"><?php _e('The text that shows when an invalid email address is given.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_required_field_missing"><?php _e('Required field missing', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_required_field_missing" name="mc4wp_form[messages][required_field_missing]" value="<?php echo esc_attr($form->messages['required_field_missing']); ?>" required />
<p class="help"><?php _e('The text that shows when a required field for the selected list(s) is missing.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_already_subscribed"><?php _e('Already subscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_already_subscribed" name="mc4wp_form[messages][already_subscribed]" value="<?php echo esc_attr($form->messages['already_subscribed']); ?>" required />
<p class="help"><?php _e('The text that shows when the given email is already subscribed to the selected list(s).', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_error"><?php _e('General error', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_error" name="mc4wp_form[messages][error]" value="<?php echo esc_attr($form->messages['error']); ?>" required />
<p class="help"><?php _e('The text that shows when a general error occured.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_unsubscribed"><?php _e('Unsubscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_unsubscribed" name="mc4wp_form[messages][unsubscribed]" value="<?php echo esc_attr($form->messages['unsubscribed']); ?>" required />
<p class="help"><?php _e('When using the unsubscribe method, this is the text that shows when the given email address is successfully unsubscribed from the selected list(s).', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_not_subscribed"><?php _e('Not subscribed', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_not_subscribed" name="mc4wp_form[messages][not_subscribed]" value="<?php echo esc_attr($form->messages['not_subscribed']); ?>" required />
<p class="help"><?php _e('When using the unsubscribe method, this is the text that shows when the given email address is not on the selected list(s).', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_no_lists_selected"><?php _e('No list selected', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_no_lists_selected" name="mc4wp_form[messages][no_lists_selected]" value="<?php echo esc_attr($form->messages[ 'no_lists_selected']); ?>" required />
<p class="help"><?php _e('When offering a list choice, this is the text that shows when no lists were selected.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<?php $config = array( 'element' => 'mc4wp_form[settings][update_existing]', 'value' => 1 ); ?>
<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
<th scope="row"><label for="mc4wp_form_updated"><?php _e('Updated', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" id="mc4wp_form_updated" name="mc4wp_form[messages][updated]" value="<?php echo esc_attr($form->messages['updated']); ?>" />
<p class="help"><?php _e('The text that shows when an existing subscriber is updated.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<?php
/** @ignore */
do_action('mc4wp_admin_form_after_messages_settings_rows', array(), $form);
?>
<tr valign="top">
<th></th>
<td>
<p class="help"><?php printf(__('HTML tags like %s are allowed in the message fields.', 'mailchimp-for-wp'), '<code>' . esc_html('<strong><em><a>') . '</code>'); ?></p>
</td>
</tr>
</table>
<?php submit_button(); ?>
@@ -0,0 +1,156 @@
<h2><?php echo __('Form Settings', 'mailchimp-for-wp'); ?></h2>
<div class="medium-margin"></div>
<h3><?php echo __('Mailchimp specific settings', 'mailchimp-for-wp'); ?></h3>
<table class="form-table" style="table-layout: fixed;">
<?php
/** @ignore */
do_action('mc4wp_admin_form_after_mailchimp_settings_rows', $opts, $form);
?>
<tr valign="top">
<th scope="row" style="width: 250px;"><?php _e('Lists this form subscribes to', 'mailchimp-for-wp'); ?></th>
<?php // loop through lists
if (empty($lists)) {
?><td colspan="2"><?php printf(__('No lists found, <a href="%s">are you connected to Mailchimp</a>?', 'mailchimp-for-wp'), admin_url('admin.php?page=mailchimp-for-wp')); ?></td><?php
} else {
?>
<td >
<ul id="mc4wp-lists" style="margin-bottom: 20px; max-height: 300px; overflow-y: auto;">
<?php foreach ($lists as $list) {
?>
<li>
<label>
<input class="mc4wp-list-input" type="checkbox" name="mc4wp_form[settings][lists][]" value="<?php echo esc_attr($list->id); ?>" <?php checked(in_array($list->id, $opts['lists']), true); ?>> <?php echo esc_html($list->name); ?>
</label>
</li>
<?php
} ?>
</ul>
<p class="help"><?php _e('Select the list(s) to which people who submit this form should be subscribed.', 'mailchimp-for-wp'); ?></p>
</td>
<?php
} ?>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Use double opt-in?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][double_optin]" value="1" <?php checked($opts['double_optin'], 1); ?> />&rlm;
<?php _e('Yes'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][double_optin]" value="0" <?php checked($opts['double_optin'], 0); ?> onclick="return confirm('<?php esc_attr_e('Are you sure you want to disable double opt-in?', 'mailchimp-for-wp'); ?>');" />&rlm;
<?php _e('No'); ?>
</label>
<p class="help"><?php _e('We strongly suggest keeping double opt-in enabled. Disabling double opt-in may result in abuse.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Update existing subscribers?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][update_existing]" value="1" <?php checked($opts['update_existing'], 1); ?> />&rlm;
<?php _e('Yes'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][update_existing]" value="0" <?php checked($opts['update_existing'], 0); ?> />&rlm;
<?php _e('No'); ?>
</label>
<p class="help"><?php _e('Select "yes" if you want to update existing subscribers with the data that is sent.', 'mailchimp-for-wp'); ?></p>
</td>
</tr>
<?php $config = array( 'element' => 'mc4wp_form[settings][update_existing]', 'value' => 1 ); ?>
<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
<th scope="row"><?php _e('Replace interest groups?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="1" <?php checked($opts['replace_interests'], 1); ?> />&rlm;
<?php _e('Yes'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="0" <?php checked($opts['replace_interests'], 0); ?> />&rlm;
<?php _e('No'); ?>
</label>
<p class="help">
<?php _e('Select "no" if you want to add the selected interests to any previously selected interests when updating a subscriber.', 'mailchimp-for-wp'); ?>
<?php printf(' <a href="%s" target="_blank">' . __('What does this do?', 'mailchimp-for-wp') . '</a>', 'https://kb.mc4wp.com/what-does-replace-groupings-mean/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=settings-page'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_subscriber_tags"><?php _e('Subscriber tags', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][subscriber_tags]" id="mc4wp_form_subscriber_tags" placeholder="<?php echo __('Example: My tag, another tag', 'mailchimp-for-wp'); ?>" value="<?php echo esc_attr($opts['subscriber_tags']); ?>" />
<p class="help">
<?php _e('The listed tags will be applied to all new subscribers added by this form.', 'mailchimp-for-wp'); ?>
<?php _e('Separate multiple values with a comma.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<?php
/** @ignore */
do_action('mc4wp_admin_form_after_mailchimp_settings_rows', $opts, $form);
?>
</table>
<div class="medium-margin"></div>
<h3><?php _e('Form behaviour', 'mailchimp-for-wp'); ?></h3>
<table class="form-table" style="table-layout: fixed;">
<?php
/** @ignore */
do_action('mc4wp_admin_form_before_behaviour_settings_rows', $opts, $form);
?>
<tr valign="top">
<th scope="row"><?php _e('Hide form after a successful sign-up?', 'mailchimp-for-wp'); ?></th>
<td class="nowrap">
<label>
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="1" <?php checked($opts['hide_after_success'], 1); ?> />&rlm;
<?php _e('Yes'); ?>
</label> &nbsp;
<label>
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="0" <?php checked($opts['hide_after_success'], 0); ?> />&rlm;
<?php _e('No'); ?>
</label>
<p class="help">
<?php _e('Select "yes" to hide the form fields after a successful sign-up.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mc4wp_form_redirect"><?php _e('Redirect to URL after successful sign-ups', 'mailchimp-for-wp'); ?></label></th>
<td>
<input type="text" class="widefat" name="mc4wp_form[settings][redirect]" id="mc4wp_form_redirect" placeholder="<?php printf(__('Example: %s', 'mailchimp-for-wp'), esc_attr(site_url('/thank-you/'))); ?>" value="<?php echo esc_attr($opts['redirect']); ?>" />
<p class="help">
<?php _e('Leave empty or enter <code>0</code> for no redirect. Otherwise, use complete (absolute) URLs, including <code>http://</code>.', 'mailchimp-for-wp'); ?>
</p>
<p class="help">
<?php _e('Your "subscribed" message will not show when redirecting to another page, so make sure to let your visitors know they were successfully subscribed.', 'mailchimp-for-wp'); ?>
</p>
</td>
</tr>
<?php
/** @ignore */
do_action('mc4wp_admin_form_after_behaviour_settings_rows', $opts, $form);
?>
</table>
<?php submit_button(); ?>