function getIsHumanCode($field_object, $form_id) { $admin_options = parent::getAdminOptions(); $code_type = $admin_options['code_type'] == 'XHTML' ? ' /' : ''; if (empty($field_object->field_instructions)) { $instructions = ''; $tooltip_class = ''; } else { $instructions = 'title="' . $field_object->field_instructions . '"'; $tooltip_class = 'ccf-tooltip-field'; } $out = ' <div><input value="1" class="' . $field_object->field_class . ' ' . $tooltip_class . '" type="checkbox" ' . $instructions . ' name="ishuman" id="ishuman-' . $form_id . '"' . $code_type . '> <label for="ishuman-' . $form_id . '" class="checkbox">* ' . $field_object->field_label . '</label></div>'; return $out; }
function printSettingsPage() { $admin_options = parent::getAdminOptions(); if ($admin_options['show_install_popover'] == 1) { $admin_options['show_install_popover'] = 0; ?> <script type="text/javascript" language="javascript"> $j(document).ready(function() { showCCFUsagePopover(); }); </script> <?php update_option(parent::getAdminOptionsName(), $admin_options); } if ($_POST['general_settings']) { $_POST['settings'] = array_map(array('ccf_utils', 'encodeOption'), $_POST['settings']); $admin_options = array_merge($admin_options, $_POST['settings']); $admin_options[show_widget_categories] = $_POST['settings']['show_widget_categories']; $admin_options[show_widget_singles] = $_POST['settings']['show_widget_singles']; $admin_options[show_widget_pages] = $_POST['settings']['show_widget_pages']; $admin_options[show_widget_archives] = $_POST['settings']['show_widget_archives']; $admin_options[show_widget_home] = $_POST['settings']['show_widget_home']; $this->action_complete = __('Your settings have been successfully saved!', 'custom-contact-forms'); update_option(parent::getAdminOptionsName(), $admin_options); } elseif ($_POST['configure_mail']) { $_POST['mail_config'] = array_map(array('ccf_utils', 'encodeOption'), $_POST['mail_config']); $admin_options = array_merge($admin_options, $_POST['mail_config']); $this->action_complete = __('Your mail settings have been successfully saved!', 'custom-contact-forms'); update_option(parent::getAdminOptionsName(), $admin_options); } ccf_utils::load_module('export/custom-contact-forms-export.php'); ?> <div id="customcontactforms-admin"> <div class="plugin-header"> <h2> <?php _e("Custom Contact Forms", 'custom-contact-forms'); ?> </h2> <div class="links"> <a href="javascript:void(0)" class="quick-start-button">Quick Start Guide</a> - <a href="javascript:void(0)" class="usage-popover-button">Plugin Usage Manual</a> </div> </div> <a class="genesis" href="http://www.shareasale.com/r.cfm?b=241369&u=481196&m=28169&urllink=&afftrack=">Custom Contact Forms works best with any of the 20+ <span>Genesis</span> Wordpress child themes. The <span>Genesis Framework</span> empowers you to quickly and easily build incredible websites with WordPress.</a> <form class="blog-horizontal-form" method="post" action="http://www.aweber.com/scripts/addlead.pl"> <input type="hidden" name="meta_web_form_id" value="1578604781" /> <input type="hidden" name="meta_split_id" value="" /> <input type="hidden" name="listname" value="ccf-plugin" /> <input type="hidden" name="redirect" value="http://www.taylorlovett.com/wordpress-plugins/tutorials-offers-tips/" id="redirect_5832e41084448adb07da67a35dc83c27" /> <input type="hidden" name="meta_adtracking" value="CCF_-_Wordpress_Plugins_Horizontal" /> <input type="hidden" name="meta_message" value="1" /> <input type="hidden" name="meta_required" value="name,email" /> <span>WP Blogging Tips, Downloads, SEO Tricks & Exclusive Tutorials</span> <input type="text" name="name" value="Your Name" onclick="value=''" /> <input type="text" name="email" value="Your Email" onclick="value=''" /> <input type="submit" value="Sign Up for Free" /> </form> <?php if (!empty($this->action_complete)) { ?> <div id="message" class="updated below-h2"> <p><?php echo $this->action_complete; ?> </p> </div> <?php } ?> <div id="general-settings" class="postbox"> <h3 class="hndle"><span> <?php _e("General Settings", 'custom-contact-forms'); ?> </span></h3> <div class="inside"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <ul class="gleft"> <li> <label for="email_form_submissions"> <?php _e("Email Form Submissions:", 'custom-contact-forms'); ?> </label> <select name="settings[email_form_submissions]"> <option value="1"> <?php _e("Yes", 'custom-contact-forms'); ?> </option> <option value="0" <?php if ($admin_options['email_form_submissions'] == 0) { echo 'selected="selected"'; } ?> > <?php _e("No", 'custom-contact-forms'); ?> </option> </select> </li> <li class="descrip"> <?php _e("When a user fills out one of your forms, the info submitted is saved in the Saved Form Submission section of the admin panel for you to view. If this is enabled, you will also be sent an email containing the submission info.", 'custom-contact-forms'); ?> </li> <li> <label for="default_to_email"> <?php _e("Default Email:", 'custom-contact-forms'); ?> </label> <input name="settings[default_to_email]" value="<?php echo $admin_options['default_to_email']; ?> " type="text" maxlength="100" /> </li> <li class="descrip"> <?php _e("Form emails will be sent <span>to</span> this address, if no destination email is specified by the form.", 'custom-contact-forms'); ?> </li> <li> <label for="enable_jquery"> <?php _e("Front End JQuery:", 'custom-contact-forms'); ?> </label> <select name="settings[enable_jquery]"> <option value="1"> <?php _e("Enabled", 'custom-contact-forms'); ?> </option> <option <?php if ($admin_options['enable_jquery'] != 1) { echo 'selected="selected"'; } ?> value="0"> <?php _e("Disabled", 'custom-contact-forms'); ?> </option> </select> </li> <li class="descrip"> <?php _e("Some plugins don't setup JQuery correctly, so when any other plugin uses JQuery (whether correctly or not), JQuery works for neither plugin. This plugin uses JQuery correctly. If another plugin isn't using JQuery correctly but is more important to you than this one: disable this option. 99% of this plugin's functionality will work without JQuery, just no field instruction tooltips.", 'custom-contact-forms'); ?> </li> <li> <label for="default_from_email"> <?php _e("Default From Email:", 'custom-contact-forms'); ?> </label> <input name="settings[default_from_email]" value="<?php echo $admin_options['default_from_email']; ?> " type="text" maxlength="100" /> </li> <li class="descrip"> <?php _e("Form emails will be sent <span>from</span> this address. It is recommended you provide a real email address that has been created through your host.", 'custom-contact-forms'); ?> </li> <li> <label for="default_from_name"> <?php _e("Default From Name:", 'custom-contact-forms'); ?> </label> <input name="settings[default_from_name]" value="<?php echo $admin_options['default_from_name']; ?> " type="text" maxlength="100" /> </li> <li class="descrip"> <?php _e("This setting allows you to specify the name under which form emails are sent. The default is 'Custom Contact Forms'.", 'custom-contact-forms'); ?> </li> <li> <label for="default_form_subject"> <?php _e("Default Email Subject:", 'custom-contact-forms'); ?> </label> <input name="settings[default_form_subject]" value="<?php echo $admin_options['default_form_subject']; ?> " type="text" /> </li> <li class="descrip"> <?php _e("Default subject to be included in all form emails.", 'custom-contact-forms'); ?> </li> <li> <label for="enable_dashboard_widget"> <?php _e("Enable Dashboard Widget:", 'custom-contact-forms'); ?> </label> <select name="settings[enable_dashboard_widget]"> <option value="1"> <?php _e("Enabled", 'custom-contact-forms'); ?> </option> <option value="0" <?php if ($admin_options['enable_dashboard_widget'] == 0) { echo 'selected="selected"'; } ?> > <?php _e("Disabled", 'custom-contact-forms'); ?> </option></select> </li> <li class="descrip"> <?php _e("Enabling this will display a widget on your dashboard that shows the latest form submissions.", 'custom-contact-forms'); ?> </li> <li> <label for="dashboard_access"> <?php _e("Dashboard Widget Accessibility:", 'custom-contact-forms'); ?> </label> <select name="settings[dashboard_access]"> <option value="2"> <?php _e("Only admins can view", 'custom-contact-forms'); ?> </option> <option value="1" <?php if ($admin_options['dashboard_access'] == 1) { echo 'selected="selected"'; } ?> > <?php _e("All roles except subscribers can view", 'custom-contact-forms'); ?> </option> <option value="0" <?php if ($admin_options['dashboard_access'] == 0) { echo 'selected="selected"'; } ?> > <?php _e("All roles can view", 'custom-contact-forms'); ?> </option></select> </li> <li class="descrip"> <?php _e("If you are using the dashboard widget, this allows you to disallow certain users from viewing it.", 'custom-contact-forms'); ?> </li> <li> <label for="code_type"> <?php _e("Use Code Type:", 'custom-contact-forms'); ?> </label> <select name="settings[code_type]"> <option>XHTML</option> <option <?php if ($admin_options['code_type'] == 'HTML') { echo 'selected="selected"'; } ?> >HTML</option> </select> </li> <li class="descrip"> <?php _e("This lets you switch the form code between HTML and XHTML.", 'custom-contact-forms'); ?> </li> <li> <label for="form_page_inclusion_only"> <?php _e("Restrict Frontend JS and CSS to Form Pages Only:", 'custom-contact-forms'); ?> </label> <select name="settings[form_page_inclusion_only]"> <option value="1"> <?php _e("Yes", 'custom-contact-forms'); ?> </option> <option value="0" <?php if ($admin_options['form_page_inclusion_only'] == 0) { echo 'selected="selected"'; } ?> > <?php _e("No", 'custom-contact-forms'); ?> </option></select> </li> <li class="descrip"> <?php _e("Within each form in the form manager, you can specify the page id's on which that form will be used. If you set this to 'Yes', the plugin will only include CSS and JS files on pages/posts where a CCF form is inserted. If this is set to 'No', CSS and JS files for this plugin will be included on every page of your site except in the admin area.", 'custom-contact-forms'); ?> </li> </ul> <ul class="gright"> <li> <label for="form_success_message_title"> <?php _e("Default Form Success Message Title:", 'custom-contact-forms'); ?> </label> <input name="settings[form_success_message_title]" value="<?php echo $admin_options['form_success_message_title']; ?> " type="text"/> </li> <li class="descrip"> <?php _e("If someone fills out a form for which a success message title is not provided and a custom success page is not provided, the plugin will show a popover using this field as the window title.", 'custom-contact-forms'); ?> </li> <li> <label for="form_success_message"> <?php _e("Default Form Success Message:", 'custom-contact-forms'); ?> </label> <input name="settings[form_success_message]" value="<?php echo $admin_options['form_success_message']; ?> " type="text"/> </li> <li class="descrip"> <?php _e("If someone fills out a form for which a success message is not provided and a custom success page is not provided, the plugin will show a popover containing this message.", 'custom-contact-forms'); ?> </li> <li> <label for="default_form_error_header"> <?php _e("Default Form Error Header:", 'custom-contact-forms'); ?> </label> <input name="settings[default_form_error_header]" value="<?php echo $admin_options['default_form_error_header']; ?> " type="text" /> </li> <li class="descrip"> <?php _e("When a form is filled out incorrectly, this message will be displayed followed by the individual field error messages.", 'custom-contact-forms'); ?> </li> <li> <label for="remember_field_values"> <?php _e("Remember Field Values:", 'custom-contact-forms'); ?> </label> <select name="settings[remember_field_values]"> <option value="1"> <?php _e("Yes", 'custom-contact-forms'); ?> </option> <option <?php if ($admin_options['remember_field_values'] == 0) { echo 'selected="selected"'; } ?> value="0"> <?php _e("No", 'custom-contact-forms'); ?> </option> </select> </li> <li class="descrip"> <?php _e("Selecting yes will make form fields remember how they were last filled out.", 'custom-contact-forms'); ?> </li> <li> <label for="enable_widget_tooltips"> <?php _e("Tooltips in Widget:", 'custom-contact-forms'); ?> </label> <select name="settings[enable_widget_tooltips]"> <option value="1"> <?php _e("Enabled", 'custom-contact-forms'); ?> </option> <option <?php if ($admin_options['enable_widget_tooltips'] == 0) { echo 'selected="selected"'; } ?> value="0"> <?php _e("Disabled", 'custom-contact-forms'); ?> </option> </select> </li> <li class="descrip"> <?php _e("Enabling this shows tooltips containing field instructions on forms in the widget.", 'custom-contact-forms'); ?> </li> <li> <label for="admin_ajax"> <?php _e("Fancy Admin AJAX Abilities:", 'custom-contact-forms'); ?> </label> <select name="settings[admin_ajax]"> <option value="1"> <?php _e("Enabled", 'custom-contact-forms'); ?> </option> <option value="0" <?php if ($admin_options['admin_ajax'] == 0) { echo 'selected="selected"'; } ?> > <?php _e("Disabled", 'custom-contact-forms'); ?> </option> </select> </li> <li class="descrip"> <?php _e("If you enable this, creating, editing and modifying forms, fields, styles, etc in the admin panel will be done using AJAX. This means that clicking things like 'Edit' or 'Delete' will not cause the page to reload thus managing your forms will be much smoother and quicker. If you are having problems with things not saving, deleting, or inserting correctly, then disable this and fill out a bug report below.", 'custom-contact-forms'); ?> </li> <li> <label for="default_form_bad_permissions"> <?php _e("Default Permissions Error:", 'custom-contact-forms'); ?> </label> <input name="settings[default_form_bad_permissions]" value="<?php echo $admin_options['default_form_bad_permissions']; ?> " type="text" /> </li> <li class="descrip"> <?php _e("When someone doesn't have the proper permissions to use a form, this message is displayed in place of the form. You control who can view each form with the form access manager which is located inside the form manager.", 'custom-contact-forms'); ?> </li> <li> <label for="enable_form_access_manager"> <?php _e("Form Access Capabilities:", 'custom-contact-forms'); ?> </label> <select name="settings[enable_form_access_manager]"> <option value="0"> <?php _e("Disabled", 'custom-contact-forms'); ?> </option> <option value="1" <?php if ($admin_options['enable_form_access_manager'] == 1) { echo 'selected="selected"'; } ?> > <?php _e("Enabled", 'custom-contact-forms'); ?> </option> </select> </li> <li class="descrip"> <?php _e("The form access manager within each form allows you to control who can view your form. However, that will take effect on any of your forms unless this is enabled.", 'custom-contact-forms'); ?> </li> <li> <label for="max_file_upload_size"> <?php _e("Maximum File Upload Size:", 'custom-contact-forms'); ?> </label> <input name="settings[max_file_upload_size]" class="ccf-width75" type="text" value="<?php echo $admin_options['max_file_upload_size']; ?> " /> <?php _e("MB"); ?> </li> <li class="descrip"> <?php _e("When creating file fields, you can specify maximum upload sizes for each individual field. This setting lets you set an overall cap for security reasons. It is recommended you leave this at 10 MB.", 'custom-contact-forms'); ?> </li> <li class="show-widget"><b> <?php _e("Show Sidebar Widget:", 'custom-contact-forms'); ?> </b></li> <li> <label> <input value="1" type="checkbox" name="settings[show_widget_home]" <?php if ($admin_options['show_widget_home'] == 1) { echo 'checked="checked"'; } ?> /> <?php _e("On Homepage", 'custom-contact-forms'); ?> </label> <label> <input value="1" type="checkbox" name="settings[show_widget_pages]" <?php if ($admin_options['show_widget_pages'] == 1) { echo 'checked="checked"'; } ?> /> <?php _e("On Pages", 'custom-contact-forms'); ?> </label> <label> <input value="1" type="checkbox" name="settings[show_widget_singles]" <?php if ($admin_options['show_widget_singles'] == 1) { echo 'checked="checked"'; } ?> /> <?php _e("On Single Posts", 'custom-contact-forms'); ?> </label> <br /> <label> <input value="1" type="checkbox" name="settings[show_widget_categories]" <?php if ($admin_options['show_widget_categories'] == 1) { echo 'checked="checked"'; } ?> /> <?php _e("On Categories", 'custom-contact-forms'); ?> </label> <label> <input value="1" type="checkbox" name="settings[show_widget_archives]" <?php if ($admin_options['show_widget_archives'] == 1) { echo 'checked="checked"'; } ?> /> <?php _e("On Archives", 'custom-contact-forms'); ?> </label> </li> <li> <input type="submit" value="<?php _e("Update", 'custom-contact-forms'); ?> " name="general_settings" /> </li> </ul> </form> </div> </div> <div id="configure-mail" class="postbox"> <h3 class="hndle"><span> <?php _e("Mail Settings", 'custom-contact-forms'); ?> </span></h3> <div class="inside"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <p><?php _e("There are two ways you can send emails: using the PHP mail() function or using SMTP (secure/insecure). If you choose to use the PHP mail() function you can ignore all the other options. For some people Wordpress's default way of sending mail does not work; if for some reason your mail is being sent you should try the SMTP option.", 'custom-contact-forms'); ?> </p> <label for="mail_function"><?php _e("* Send My Emails Using the Following:", 'custom-contact-forms'); ?> </label> <select name="mail_config[mail_function]"> <option value="default"><?php _e("Wordpress Default", 'custom-contact-forms'); ?> </option> <option <?php if ($admin_options['mail_function'] == 'smtp') { echo 'selected="selected"'; } ?> value="smtp"><?php _e("SMTP", 'custom-contact-forms'); ?> </option> </select> <?php _e("(If mail isn't sending, try toggling this option.)", 'custom-contact-forms'); ?> <div> <ul class="left"> <li><label for="smtp_host"><?php _e("SMTP Host:", 'custom-contact-forms'); ?> </label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_host]" value="<?php echo $admin_options['smtp_host']; ?> " /></li> <li><label for="smtp_port"><?php _e("SMTP Port:", 'custom-contact-forms'); ?> </label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_port]" value="<?php echo $admin_options['smtp_port']; ?> " /></li> <li><label for="smtp_encryption"><?php _e("Encryption:", 'custom-contact-forms'); ?> </label> <select name="mail_config[smtp_encryption]"> <option value="none"><?php _e("None", 'custom-contact-forms'); ?> </option> <option <?php if ($admin_options['smtp_encryption'] == 'ssl') { echo 'selected="selected"'; } ?> value="ssl"><?php _e("SSL", 'custom-contact-forms'); ?> </option> <option <?php if ($admin_options['smtp_encryption'] == 'tls') { echo 'selected="selected"'; } ?> value="tls"><?php _e("TLS", 'custom-contact-forms'); ?> </option> </select></li> </ul> <ul class="right"> <li><label for="smtp_authentication"><?php _e("SMTP Authentication:", 'custom-contact-forms'); ?> </label> <select name="mail_config[smtp_authentication]"><option value="0"><?php _e("None Needed", 'custom-contact-forms'); ?> </option><option <?php if ($admin_options['smtp_authentication'] == 1) { echo 'selected="selected"'; } ?> value="1"><?php _e("Use SMTP Username/Password", 'custom-contact-forms'); ?> </option></select></li> <li><label for="smtp_username"><?php _e("SMTP Username:"******"ccf-width125" type="text" size="10" name="mail_config[smtp_username]" value="<?php echo $admin_options['smtp_username']; ?> " /></li> <li><label for="smtp_password"><?php _e("SMTP Password:"******"ccf-width125" type="text" size="10" name="mail_config[smtp_password]" value="<?php echo $admin_options['smtp_password']; ?> " /></li> </ul> </div> <input type="submit" name="configure_mail" value="<?php _e("Save Mail Sending Options", 'custom-contact-forms'); ?> " /> </form> </div> </div> <div id="export" class="postbox"> <h3 class="hndle"><span> <?php _e("Export", 'custom-contact-forms'); ?> </span></h3> <div class="inside"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <p> <?php _e("Preforming a Custom Contact Forms export will create a file of the form \n\t\t\t\t\t\tccf-export-xxxx.sql on your web server. The file created contains SQL that \n\t\t\t\t\t\twill recreate all the plugin data on any Wordpress installation. After Custom Contact Forms creates the export file, you will be prompted to download it. You can use this file as a backup in case your Wordpress database gets ruined.", 'custom-contact-forms'); ?> </p> <input type="submit" name="ccf_export" value="<?php _e("Export All CCF Plugin Content", 'custom-contact-forms'); ?> " /> </form> </div> </div> <div id="import" class="postbox"> <h3 class="hndle"><span> <?php _e("Import", 'custom-contact-forms'); ?> </span></h3> <div class="inside"> <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <p> <?php _e("Browse to a CCF .sql export file to import Custom Contact Form data from another Wordpress installation to this one. Pressing the 'Clear and Import' button deletes all current data and then imports the selected file; this will not work for merging to data!. Clearing all CCF data before importing prevents any conflicts from occuring. Before you attempt an import, you should always download a backup, by clicking the 'Export All' button.", 'custom-contact-forms'); ?> </p> <p class="choose_import"> <?php _e("Choose What You Want to Use from the Import File:", 'custom-contact-forms'); ?> </p> <ul> <li> <input type="checkbox" checked="checked" name="ccf_import_overwrite_settings" value="1" /> <label for="ccf_import_overwrite_settings"> <?php _e("Use General Settings", 'custom-contact-forms'); ?> </label> </li> <li> <input type="checkbox" checked="checked" name="ccf_import_forms" value="1" /> <label for="ccf_import_forms"> <?php _e("Forms", 'custom-contact-forms'); ?> </label> </li> <li> <input type="checkbox" checked="checked" name="ccf_import_saved_submissions" value="1" /> <label for="ccf_import_saved_submissions"> <?php _e("Form Submissions", 'custom-contact-forms'); ?> </label> </li> <li> <input type="checkbox" checked="checked" name="ccf_import_fields" value="1" /> <label for="ccf_import_fields"> <?php _e("Fields", 'custom-contact-forms'); ?> </label> </li> <li> <input type="checkbox" checked="checked" name="ccf_import_forms" value="1" /> <label for="ccf_import_forms"> <?php _e("Forms", 'custom-contact-forms'); ?> </label> </li> <li> <input type="checkbox" checked="checked" name="ccf_import_field_options" value="1" /> <label for="ccf_import_field_options"> <?php _e("Field Options", 'custom-contact-forms'); ?> </label> </li> <li> <input type="checkbox" checked="checked" name="ccf_import_styles" value="1" /> <label for="ccf_import_styles"> <?php _e("Styles", 'custom-contact-forms'); ?> </label> </li> </ul> <p class="choose_import"> <label for="import_file"> <?php _e("Choose an Import File:", 'custom-contact-forms'); ?> </label> <input type="file" name="import_file" /> </p> <input name="ccf_clear_import" type="submit" value="<?php _e("Clear and Import", 'custom-contact-forms'); ?> " /> <input type="checkbox" name="ccf_import_confirm" value="1" /> <?php _e('Yes, I want to do this and have created a backup.', 'custom-contact-forms'); ?> </form> </div> </div> <?php $this->insertUsagePopover(); ?> <?php $this->insertQuickStartPopover(); ?> </div> <?php }