/**
     * Hook into show_user_profile action to display our user subscription settings if necessary
     *
     * @global  $cc
     *
     * @param <type> $user
     *
     * @return <type>
     */
    function display($user)
    {
        $Contact = new KWSContact($this->cc->getContactByEmail($user->data->user_email));
        if ($Contact && current_user_can('edit_users') && !isset($_GET['debug-user-display'])) {
            echo sprintf(__('
				<p><img src="%s" width="225" height="33" alt="Constant Contact" class="block" /><a href="%s">Admin-Only: Edit this User\'s Details</a> %s</p>
			', 'ctct'), plugins_url('images/admin/logo-horizontal.png', CTCT_FILE), admin_url('admin.php?page=constant-contact-contacts&amp;edit=' . $Contact->id), constant_contact_tip(__('Users will not see this link or the Constant Contact logo.', 'ctct'), false));
        }
        if (!$this->subscribe_method) {
            return;
        }
        $register_page_method = CTCT_Settings::get('profile_page_form');
        // Prepare the description from the settings screen
        $signup_description = CTCT_Settings::get('signup_description');
        if ($signup_description) {
            $signup_description = wpautop($signup_description);
            $signup_description = "<div class='description'>{$signup_description}</div>";
        }
        ?>
		<h3><?php 
        echo CTCT_Settings::get('signup_title');
        ?>
</h3>
		<?php 
        echo $signup_description;
        ?>

		<p><?php 
        $lists = (array) $Contact->get('lists', true);
        echo KWSContactList::outputHTML('all', array('checked' => $lists));
        ?>
</p>
		<br/>
	<?php 
    }
function cc_form_meta_box_fontstyles($post, $metabox = array())
{
    $form = $metabox['args'][0];
    ?>
<fieldset>
				<legend><?php 
    esc_html_e('Text', 'ctct');
    ?>
</legend>
				<p class="description"><?php 
    esc_html_e('These settings are for the Custom Text field. If the checkboxes are checked, the settings also apply to the input labels.', 'ctct');
    ?>
</p>
				<div class="block">
					<label for="tcolor" class="block"><span><?php 
    esc_html_e('Text Color:', 'ctct');
    ?>
</span></label>
					<div class="input">
						<input type="hidden" id="tcolor" name="tcolor" class="wpcolor" value="<?php 
    ctct_input_value($form, 'tcolor', '#accbf7');
    ?>
" />
					</div>

					<label for="lusc" class="checkbox block howto"><input type="checkbox" class="checkbox" name="lusc" id="lusc" <?php 
    ctct_check_checkbox($form, 'lusc', 'yes', true);
    ?>
 /> <span><?php 
    esc_html_e('Use Same Color for Labels', 'ctct');
    ?>
</span></label>
				</div>

				<div class="block">

					<label for="tfont" class="block"><span><?php 
    esc_html_e('Font Family', 'ctct');
    constant_contact_tip(__('* next to a font means that the font may not be available on all users\' computers. If not, a similar font will be used.', 'ctct'));
    ?>
</span></label>

					<select id="tfont" name="tfont" class="inline">
						<option <?php 
    ctct_check_select($form, 'tfont', 'inherit');
    ?>
 style="font-family: inherit;" id="inherit"><?php 
    esc_html_e('Use Theme Font', 'ctct');
    ?>
</option>
							<optgroup label="Serif">
								<option <?php 
    ctct_check_select($form, 'tfont', 'times');
    ?>
 style="font-family: 'Times New Roman', Times, Georgia, serif;" id="times"><?php 
    echo 'Times New Roman';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'georgia');
    ?>
 style="font-family: Georgia, 'Times New Roman', Times, serif;" id="georgia"><?php 
    echo 'Georgia';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'palatino');
    ?>
 style="font-family: 'Palatino Linotype', Palatino, 'Book Antiqua',Garamond, Bookman, 'Times New Roman', Times, Georgia, serif" id="palatino"><?php 
    echo 'Palatino *';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'garamond');
    ?>
 style="font-family: Garamond,'Palatino Linotype', Palatino, Bookman, 'Book Antiqua', 'Times New Roman', Times, Georgia, serif" id="garamond"><?php 
    echo 'Garamond *';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'bookman');
    ?>
 style="font-family: Bookman,'Palatino Linotype', Palatino, Garamond, 'Book Antiqua','Times New Roman', Times, Georgia, serif" id="bookman"><?php 
    echo 'Bookman *';
    ?>
</option>
							</optgroup>
							<optgroup label="Sans-Serif">
								<option <?php 
    ctct_check_select($form, 'tfont', 'helvetica', true);
    ?>
 style="font-family: 'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif;" id="helvetica"><?php 
    echo 'Helvetica';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'arial');
    ?>
 style="font-family:Arial, Helvetica, sans-serif;" id="arial"><?php 
    echo 'Arial';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'lucidagrande');
    ?>
 style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, sans-serif;" id="lucida"><?php 
    echo 'Lucida Grande';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'verdana');
    ?>
 style="font-family: Verdana, 'Lucida Grande', Lucida, TrebuchetMS, 'Trebuchet MS', Helvetica, Arial, sans-serif;" id="bookman"><?php 
    echo 'Verdana';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'trebuchet');
    ?>
 style="font-family:'Trebuchet MS', Trebuchet, sans-serif;" id="trebuchet"><?php 
    echo 'Trebuchet MS';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'tahoma');
    ?>
 style="font-family:Tahoma, Verdana, Arial, sans-serif;" id="tahoma"><?php 
    echo 'Tahoma';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'franklin');
    ?>
 style="font-family:'Franklin Gothic Medium','Arial Narrow Bold',Arial,sans-serif;" id="franklin"><?php 
    echo 'Franklin Gothic';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'impact');
    ?>
 style="font-family:Impact, Chicago, 'Arial Black', Arial, sans-serif;" id="impact"><?php 
    echo 'Impact *';
    ?>
</option>
							  	<option <?php 
    ctct_check_select($form, 'tfont', 'arialblack');
    ?>
 style="font-family:'Arial Black',Impact, Arial, sans-serif;" id="arial-black"><?php 
    echo 'Arial Black';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'gillsans');
    ?>
 style="font-family:'Gill Sans','Gill Sans MT', 'Trebuchet MS', Trebuchet, Verdana, sans-serif;" id="gill"><?php 
    echo 'Gill Sans *';
    ?>
</option>
							</optgroup>
							<optgroup label="Mono">
								<option <?php 
    ctct_check_select($form, 'tfont', 'courier');
    ?>
 style="font-family: 'Courier New', Courier, monospace;" id="courier"><?php 
    echo 'Courier New';
    ?>
</option>
								<option <?php 
    ctct_check_select($form, 'tfont', 'lucidaconsole');
    ?>
 style="font-family: 'Lucida Console', Monaco, monospace;" id="lucida-console"><?php 
    echo 'Lucida Console';
    ?>
</option>
							</optgroup>
							<optgroup label="Cursive">
								<option <?php 
    ctct_check_select($form, 'tfont', 'comicsans');
    ?>
 style="font-family:'Comic Sans MS','Comic Sans', Sand, 'Trebuchet MS', Verdana, sans-serif" id="comicsans"><?php 
    echo 'Comic Sans MS';
    ?>
</option>
							</optgroup>
							<optgroup label="Fantasy">
								<option <?php 
    ctct_check_select($form, 'tfont', 'papyrus');
    ?>
 style="font-family: Papyrus, 'Palatino Linotype', Palatino, Bookman, fantasy" id="papyrus"><?php 
    echo 'Papyrus';
    ?>
</option>
							</optgroup>
					</select>

					<label for="lusf" class="block howto checkbox"><input type="checkbox" name="lusf" class="checkbox" id="lusf" rel="lfont" <?php 
    ctct_check_checkbox($form, 'lusf', 'yes', true);
    ?>
 /> <span><?php 
    esc_html_e('Use Same Font for Labels', 'ctct');
    ?>
</span></label>
				</div>
			</fieldset>
			<fieldset>
				<legend><?php 
    esc_html_e('Label', 'ctct');
    ?>
</legend>

				<p class="description"><?php 
    esc_html_e('These settings apply to the label text above the inputs.', 'ctct');
    ?>
</p>
				<div id="labelcolorli" class="block">
					<label for="tcolor" class="howto block"><span><?php 
    esc_html_e('Label Color:', 'ctct');
    ?>
</span></label>
					<div class="input"><input type="hidden" id="lcolor" name="lcolor" class="wpcolor" value="<?php 
    ctct_input_value($form, 'lcolor', '#accbf7');
    ?>
" /></div>
				</div>

				<div class="block">
					<label for="lpad" class="howto">
						<span class="block"><?php 
    esc_html_e('Label Padding', 'ctct');
    constant_contact_tip(__('One "em" is equal to the height of the current font size.', 'ctct'));
    ?>
</span>
						<div class="block">
						<select id="lpad" name="lpad">
							<option<?php 
    ctct_check_select($form, 'lpad', '0');
    ?>
 value="0"><?php 
    esc_html_e('None', 'ctct');
    ?>
</option>
							<option<?php 
    ctct_check_select($form, 'lpad', '.25');
    ?>
 value=".25"><?php 
    echo '.2 em';
    ?>
</option>
							<option<?php 
    ctct_check_select($form, 'lpad', '.5');
    ?>
 value=".5"><?php 
    echo '.5 em';
    ?>
</option>
							<option<?php 
    ctct_check_select($form, 'lpad', '.75', true);
    ?>
 value=".75"><?php 
    echo '.75 em';
    ?>
</option>
							<option<?php 
    ctct_check_select($form, 'lpad', '1');
    ?>
 value="1"><?php 
    echo '1 em';
    ?>
</option>
							<option<?php 
    ctct_check_select($form, 'lpad', '1.25');
    ?>
 value="1.25"><?php 
    echo '1.25 em';
    ?>
</option>
							<option<?php 
    ctct_check_select($form, 'lpad', '1.5');
    ?>
 value="1.5"><?php 
    echo '1.5 em';
    ?>
</option>
						</select>
						</div>
					</label>
				</div>

				<div id="lfontli">
					<label for="lfont" id="lfontlabel" class="howto block"><span><?php 
    esc_html_e('Label Font', 'ctct');
    ?>
</span></label>
					<select id="lfont" name="lfont" class="inline">
						<option <?php 
    ctct_check_select($form, 'tfont', 'inherit');
    ?>
 style="font-family: inherit;" id="inherit"><?php 
    esc_html_e('Use Theme Font', 'ctct');
    ?>
</option>
						<optgroup label="Serif">
							<option <?php 
    ctct_check_select($form, 'lfont', 'times');
    ?>
 style="font-family: 'Times New Roman', Times, Georgia, serif;" id="times"><?php 
    esc_html_e('Times New Roman', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'georgia');
    ?>
 style="font-family: Georgia, 'Times New Roman', Times, serif;" id="georgia"><?php 
    esc_html_e('Georgia', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'palatino');
    ?>
 style="font-family: 'Palatino Linotype', Palatino, 'Book Antiqua',Garamond, Bookman, 'Times New Roman', Times, Georgia, serif" id="palatino"><?php 
    esc_html_e('Palatino *', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'garamond');
    ?>
 style="font-family: Garamond,'Palatino Linotype', Palatino, Bookman, 'Book Antiqua', 'Times New Roman', Times, Georgia, serif" id="garamond"><?php 
    esc_html_e('Garamond *', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'bookman');
    ?>
 style="font-family: Bookman,'Palatino Linotype', Palatino, Garamond, 'Book Antiqua','Times New Roman', Times, Georgia, serif" id="bookman"><?php 
    esc_html_e('Bookman *', 'ctct');
    ?>
</option>
						</optgroup>
						<optgroup label="Sans-Serif">
							<option <?php 
    ctct_check_select($form, 'lfont', 'helvetica');
    ?>
 style="font-family: 'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif;" id="helvetica"><?php 
    esc_html_e('Helvetica', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'arial');
    ?>
 style="font-family:Arial, Helvetica, sans-serif;" id="arial"><?php 
    esc_html_e('Arial', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'lucidagrande');
    ?>
 style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, sans-serif;" id="lucida"><?php 
    esc_html_e('Lucida Grande', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'verdana');
    ?>
 style="font-family: Verdana, 'Lucida Grande', Lucida, TrebuchetMS, 'Trebuchet MS', Helvetica, Arial, sans-serif;" id="bookman"><?php 
    esc_html_e('Verdana', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'trebuchet');
    ?>
 style="font-family:'Trebuchet MS', Trebuchet, sans-serif;" id="trebuchet"><?php 
    esc_html_e('Trebuchet MS', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'tahoma');
    ?>
 style="font-family:Tahoma, Verdana, Arial, sans-serif;" id="tahoma"><?php 
    esc_html_e('Tahoma', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'franklin');
    ?>
 style="font-family:'Franklin Gothic Medium','Arial Narrow Bold',Arial,sans-serif;" id="franklin"><?php 
    esc_html_e('Franklin Gothic', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'impact');
    ?>
 style="font-family:Impact, Chicago, 'Arial Black', Arial, sans-serif;" id="impact"><?php 
    esc_html_e('Impact *', 'ctct');
    ?>
</option>
						  	<option <?php 
    ctct_check_select($form, 'lfont', 'arialblack');
    ?>
 style="font-family:'Arial Black',Impact, Arial, sans-serif;" id="arial-black"><?php 
    esc_html_e('Arial Black', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'gillsans');
    ?>
 style="font-family:'Gill Sans','Gill Sans MT', 'Trebuchet MS', Trebuchet, Verdana, sans-serif;" id="gill"><?php 
    esc_html_e('Gill Sans *', 'ctct');
    ?>
</option>
						</optgroup>
						<optgroup label="Mono">
							<option <?php 
    ctct_check_select($form, 'lfont', 'courier');
    ?>
 style="font-family: 'Courier New', Courier, monospace;" id="courier"><?php 
    esc_html_e('Courier New', 'ctct');
    ?>
</option>
							<option <?php 
    ctct_check_select($form, 'lfont', 'lucidaconsole');
    ?>
 style="font-family: 'Lucida Console', Monaco, monospace;" id="lucida-console"><?php 
    esc_html_e('Lucida Console', 'ctct');
    ?>
</option>
						</optgroup>
						<optgroup label="Cursive">
							<option <?php 
    ctct_check_select($form, 'lfont', 'comicsans');
    ?>
 style="font-family:'Comic Sans MS','Comic Sans', Sand, 'Trebuchet MS', Verdana, sans-serif" id="comicsans"><?php 
    esc_html_e('Comic Sans MS', 'ctct');
    ?>
</option>
						</optgroup>
						<optgroup label="Fantasy">
							<option <?php 
    ctct_check_select($form, 'lfont', 'papyrus');
    ?>
 style="font-family: Papyrus, 'Palatino Linotype', Palatino, Bookman, fantasy" id="papyrus"><?php 
    esc_html_e('Papyrus', 'ctct');
    ?>
</option>
						</optgroup>
					</select>
					<small class="asterix"><?php 
    esc_html_e('* This font is popular, but not a "web-safe" font. If not available on an user\'s computer, it will default to a similar font.', 'ctct');
    ?>
</small>
				</div>

				<label for="lsize" class="howto block"><span><?php 
    esc_html_e('Label Font Size', 'ctct');
    ?>
</span></label>
				<select id="lsize" class="nomargin" name="lsize">
				<?php 
    $i = 7;
    $default = 12;
    while ($i < 50) {
        ?>
						<option<?php 
        ctct_check_select($form, 'lsize', $i, $i === $default);
        ?>
 value="<?php 
        echo $i;
        ?>
"><?php 
        printf('%d px', $i);
        ?>
</option>
						<?php 
        $i++;
    }
    ?>
				</select>
		</fieldset>
<?php 
}
					<div id="nav-menu-header">
						<?php 
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
wp_nonce_field('update-cc-form-' . (int) $cc_form_selected_id, 'update-cc-form-nonce', false);
?>
						<input type="hidden" name="action" value="update" />
						<input type="hidden" name="cc-form-id" id="cc-form-id" value="<?php 
echo (int) $cc_form_selected_id;
?>
" />

						<div class="major-publishing-actions">
							<label class="menu-name-label howto open-label" for="menu-name">
								<span><?php 
esc_html_e('Form Name', 'ctct') . constant_contact_tip(__('Only for internal use - the outside world won\'t see this name.', 'ctct'), false);
?>
</span>

								<?php 
$title = esc_attr__('Enter form name here', 'ctct');
?>
								<input name="form-name" id="menu-name" type="text" class="widefat text menu-name regular-text menu-item-textbox <?php 
if ($cc_form_selected_id == -1) {
    ?>
 input-with-default-title<?php 
}
?>
" title="<?php 
echo $title;
?>
    /**
     * Generate the settings page layout and settings fields
     *
     * @filter CTCT_Settings_array
     * @action CTCT_Settings_sections
     * @uses register_setting()
     * @uses add_settings_section()
     * @uses add_settings_field()
     * @return array Array of settings to be shown in the admin.
     */
    function settings_init()
    {
        global $plugin_page;
        register_setting('ctct_settings', 'ctct_settings');
        if ($plugin_page !== 'constant-contact-api') {
            return;
        }
        // We don't need this yet unless it's configured.
        if (!$this->cc->isConfigured()) {
            return;
        }
        add_settings_section('setup', '<i class="dashicons dashicons-admin-settings"></i> ' . __('Setup', 'ctct'), '', 'constant-contact-api');
        // Hook in here for more tabs.
        do_action('ctct_settings_sections');
        add_settings_section('registration', '<i class="dashicons dashicons-forms"></i> ' . __('Registration Form', 'ctct'), '<h3>' . esc_html__('Configure how users sign up.', 'ctct') . '</h3>', 'constant-contact-api');
        add_settings_section('comments', '<i class="dashicons dashicons-admin-comments
"></i> ' . __('Comment Form', 'ctct'), '<h3>' . esc_html__('Configure how users sign up.', 'ctct') . '</h3>', 'constant-contact-api');
        add_settings_section('spam', '<i class="dashicons dashicons-trash"></i> ' . __('Spam Prevention', 'ctct'), '<h3>' . esc_html__('How do you want to prevent spam?', 'ctct') . '</h3>', 'constant-contact-api');
        $groups = array('setup' => array(array('type' => 'html', 'content' => kws_ob_include(CTCT_DIR_PATH . 'views/admin/view.setup.php', $this)), array('id' => 'eventspot', 'type' => 'checkbox', 'desc' => __('Enable EventSpot Integration', 'ctct'), 'label' => __('Enable integration with Constant Contact Events (EventSpot)?', 'ctct')), array('type' => 'checkboxes', 'id' => 'logging', 'options' => array('activity' => __('Log Constant Contact Activity', 'ctct'), 'error' => __('Log Errors & Exceptions', 'ctct'), 'debug' => __('Detailed Debugging Logs (Do not leave enabled! Server-intensive.)', 'ctct')), 'desc' => __('Activity Logs', 'ctct'), 'label' => __('Log different activity from the plugin, including form submissions and the results ("Constant Contact Activity").', 'ctct'))), 'registration' => array(array('type' => 'heading', 'desc' => __('WordPress Registration Form', 'ctct'), 'label' => sprintf(__('Add signup options to WordPress\' <a href="%s" rel="external">registration form.</a>', 'ctct'), site_url('wp-login.php?action=register'))), array('type' => 'radio', 'id' => 'register_page_method', 'options' => array('none' => __('Disabled', 'ctct'), 'checkbox' => __('Single Checkbox - show users a checkbox which, if ticked, will automatically subscribe them to the lists you select below in the "Active Contact Lists" section.', 'ctct'), 'checkboxes' => __('List of Checkboxes - show a bullet list with the name of the list and a checkbox option for them to sign up', 'ctct'), 'dropdown' => __('Dropdown List', 'ctct')), 'toggle' => 'registration', 'desc' => __('User Subscription Method', 'ctct')), array('id' => 'default_opt_in', 'togglegroup' => 'registration_checkbox registration_checkboxes', 'type' => 'checkbox', 'desc' => __('Opt-in users by default?', 'ctct'), 'label' => __('Should the opt-in checkbox(es) be checked by default? If using the "List Selection" method, should lists be pre-selected by default.', 'ctct')), array('type' => 'lists', 'id' => 'registration_checkbox_lists', 'togglegroup' => 'registration_checkbox', 'desc' => __('Lists for Registration', 'ctct'), 'label' => __('<strong>Checkbox:</strong> What lists will users be added to when checking the opt-in box?<br />Others: What lists will users be presented with?', 'ctct'), 'options' => KWSContactList::outputHTML('all', array('type' => 'checkboxes', 'format' => '%%name%%', 'name_attr' => 'ctct_settings[registration_checkbox_lists]', 'id_attr' => 'constant-contact-api_registration_checkbox_lists_%%id%%', 'checked' => self::get('registration_checkbox_lists'), 'class' => 'toggle_registration_checkbox toggle_registration_checkboxes toggle_registration_dropdown')), 'help' => __('When users sign up for your newsletter while registering for a WordPress account, they will be added to the following lists.', 'ctct')), array('id' => 'signup_description', 'togglegroup' => 'registration_checkbox registration_checkboxes registration_dropdown', 'type' => 'textarea', 'desc' => __('Signup Description', 'ctct'), 'label' => __('Signup form description text displayed on the registration screen and user profile setting, if enabled. HTML is allowed. Paragraphs will be added automatically like in posts.', 'ctct')), array('type' => 'radio', 'togglegroup' => 'registration_checkbox registration_checkboxes registration_dropdown', 'id' => 'signup_description_position', 'options' => array('before' => __('Before the Opt-in', 'ctct'), 'after' => __('After the Opt-in', 'ctct')), 'desc' => __('Signup Description Position', 'ctct')), array('id' => 'signup_title', 'togglegroup' => 'registration_checkbox registration_checkboxes registration_dropdown', 'type' => 'text', 'desc' => __('Signup Title', 'ctct'), 'label' => __('Title for the signup form displayed on the registration screen and user profile settings if enabled.', 'ctct')), array('type' => 'text', 'togglegroup' => 'registration_dropdown', 'id' => 'default_select_option_text', 'desc' => __('Default Option Text', 'ctct'), 'label' => __('If "Opt-in users by default" (below) is not checked, this will be the default option in the dropdown menu. Leave blank to not show this option.', 'ctct')), array('type' => 'heading', 'desc' => __('Profile Page', 'ctct')), array('type' => 'checkbox', 'id' => 'profile_page_form', 'label' => __('Allow users to modify their subscription on their WordPress profile page', 'ctct'), 'desc' => __('Show Form on Profile Page?', 'ctct'), 'help' => __('Do you want users to be able to update their subscriptions inside WordPress?', 'ctct'))), 'comments' => array(array('type' => 'heading', 'desc' => __('Comment Form', 'ctct')), array('type' => 'checkbox', 'id' => 'comment_form_signup', 'label' => __('Add a checkbox for subscribing to a newsletter below a comment form', 'ctct'), 'toggle' => 'comment_form', 'desc' => __('Comment Form Signup', 'ctct')), array('togglegroup' => 'comment_form', 'type' => 'checkbox', 'id' => 'comment_form_default', 'desc' => __('Checked by default?', 'ctct'), 'label' => __('Should the checkbox be checked by default?', 'ctct')), array('type' => 'lists', 'id' => 'comment_form_lists', 'togglegroup' => 'comment_form', 'desc' => __('Lists for Comment Form', 'ctct'), 'label' => __('What lists will users be added to when signing up with the Comment Form?', 'ctct'), 'options' => KWSContactList::outputHTML('all', array('type' => 'checkboxes', 'format' => '%%name%%', 'name_attr' => 'ctct_settings[comment_form_lists]', 'id_attr' => 'constant-contact-api_comment_form_lists_%%id%%', 'class' => 'toggle_comment_form', 'checked' => self::get('comment_form_lists')))), array('togglegroup' => 'comment_form', 'type' => 'text', 'id' => 'comment_form_check_text', 'desc' => __('Subscribe Message', 'ctct')), array('togglegroup' => 'comment_form', 'type' => 'text', 'id' => 'comment_form_subscribed_text', 'desc' => __('Already Subscribed Message', 'ctct')), array('togglegroup' => 'comment_form', 'type' => 'checkbox', 'id' => 'comment_form_clear', 'label' => __('Uncheck if this causes layout issues', 'ctct'), 'desc' => __('Add a CSS \'clear\' to the checkbox?', 'ctct'))), 'spam' => array(array('type' => 'checkboxes', 'id' => 'spam_methods', 'toggle' => 'spam_methods', 'options' => array('datavalidation' => __('Verify Email Addresses with <a href="http://katz.si/datavalidation" rel="external">DataValidation.com</a>', 'ctct') . constant_contact_tip(__('DataValidation.com is the best way to verify that when users submit a form, the submitted email address is valid.', 'ctct'), false), 'akismet' => __('Akismet', 'ctct') . self::get_plugin_status_message('akismet'), 'wangguard' => __('WangGuard WordPress Plugin', 'ctct') . self::get_plugin_status_message('wangguard'), 'smtp' => __('Validate Email Addresses Via SMTP (<a href="http://katz.si/smtpvalidation" rel="external">See the project</a>)', 'ctct') . constant_contact_tip(__('Uses server methods to verify emails: checks for a valid domain, then sends a request for a read receipt.', 'ctct'), false)), 'desc' => __('What services do you want to use to prevent spam submissions of your forms?', 'ctct')), array('type' => 'heading', 'togglegroup' => 'spam_methods_datavalidation', 'desc' => __('DataValidation.com Settings', 'ctct')), array('type' => 'text', 'togglegroup' => 'spam_methods_datavalidation', 'id' => 'datavalidation_api_key', 'desc' => __('DataValidation.com: API Key', 'ctct'), 'label' => sprintf(__('Enter your DataValidation.com API key. %sSign up for a key here%s.', 'ctct'), '<a href="https://developer.datavalidation.com" rel="external">', '</a>')), array('type' => 'checkbox', 'togglegroup' => 'spam_methods_datavalidation', 'id' => 'datavalidation_prevent_ambiguous', 'desc' => __('DataValidation.com: Should "ambiguous" responses be blocked?', 'ctct'), 'label' => __('Ambiguous Responses basically mean that the email looks good, it has valid DNS, it has a valid MX record, it even has an email server, but for a myriad of reasons it does not accept any connections to it. Could be connection refused, could be the server is down, etc.', 'ctct'))), 'forms' => array(array('type' => 'checkboxes', 'id' => 'forms', 'options' => array('formstack' => __('<a href="http://www.formstack.com/r/31575458">Formstack</a>', 'ctct'), 'after' => __('After the Opt-in', 'ctct')), 'desc' => __('Forms', 'ctct'))));
        $groups = apply_filters('ctct_settings_array', $groups);
        $i = 0;
        if (empty($groups)) {
            return;
        }
        foreach ($groups as $group => $settings) {
            foreach ($settings as $setting) {
                $i++;
                $setting['page'] = isset($setting['page']) ? $setting['page'] : 'constant-contact-api';
                $setting['callback'] = isset($setting['callback']) ? $setting['callback'] : array('CTCT_Settings', 'setting_input_generator');
                $setting['desc'] = isset($setting['desc']) ? $setting['desc'] : '';
                if (isset($setting['type']) && $setting['type'] === 'heading') {
                    $setting['id'] = sanitize_title($setting['desc']);
                }
                $setting['id'] = isset($setting['id']) ? $setting['id'] : '';
                extract($setting);
                unset($setting['callback']);
                add_settings_field($id, $desc, $callback, $page, $group, $setting);
            }
        }
    }