first commit
This commit is contained in:
@@ -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); ?> />‏
|
||||
<?php _e('Yes'); ?>
|
||||
</label>
|
||||
<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'); ?>');" />‏
|
||||
<?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); ?> />‏
|
||||
<?php _e('Yes'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="mc4wp_form[settings][update_existing]" value="0" <?php checked($opts['update_existing'], 0); ?> />‏
|
||||
<?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); ?> />‏
|
||||
<?php _e('Yes'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="mc4wp_form[settings][replace_interests]" value="0" <?php checked($opts['replace_interests'], 0); ?> />‏
|
||||
<?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); ?> />‏
|
||||
<?php _e('Yes'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="mc4wp_form[settings][hide_after_success]" value="0" <?php checked($opts['hide_after_success'], 0); ?> />‏
|
||||
<?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(); ?>
|
||||
Reference in New Issue
Block a user