function qpp_error_page($id) { qpp_change_form_update(); if (isset($_POST['Submit']) && check_admin_referer("save_qpp")) { $options = array('errortitle', 'errorblurb'); foreach ($options as $item) { $error[$item] = stripslashes($_POST[$item]); $error[$item] = filter_var($error[$item], FILTER_SANITIZE_STRING); } update_option('qpp_error' . $id, $error); qpp_admin_notice("The error settings have been updated."); } if (isset($_POST['Reset']) && check_admin_referer("save_qpp")) { delete_option('qpp_error' . $id); qpp_admin_notice("The error messages have been reset."); } $qpp_setup = qpp_get_stored_setup(); $id = $qpp_setup['current']; $error = qpp_get_stored_error($id); qpp_create_css_file('update'); $content = '<div class="qpp-settings"><div class="qpp-options">'; if ($id) { $content .= '<h2>Eror message settings for ' . $id . '</h2>'; } else { $content .= '<h2>Default form error message</h2>'; } $content .= qpp_change_form($qpp_setup); $content .= '<form method="post" action=""> <p<span<b>Note:</b> Leave fields blank if you don\'t want to use them</span></p> <table> <tr> <td>Error header</td> <td><input type="text" style="width:100%" name="errortitle" value="' . $error['errortitle'] . '" /></td> </tr> <tr> <td>Error message</td> <td><input type="text" style="width:100%" name="errorblurb" value="' . $error['errorblurb'] . '" /></td> </tr> </table> <p><input type="submit" name="Submit" class="button-primary" style="color: #FFF;" value="Save Changes" /> <input type="submit" name="Reset" class="button-primary" style="color: #FFF;" value="Reset" onclick="return window.confirm( \'Are you sure you want to reset the error message?\' );"/></p>'; $content .= wp_nonce_field("save_qpp"); $content .= '</form> </div> <div class="qpp-options" style="float:right;"> <h2>Error Checker</h2> <p>Try sending a blank form to test your error messages.</p>'; if ($id) { $form = ' form="' . $id . '"'; } $args = array('form' => $id, 'id' => '', 'amount' => ''); $content .= qpp_loop($args); $content .= '<p>There are some more examples of payment forms <a href="http://quick-plugins.com/quick-paypal-payments/paypal-examples/" target="_blank">on this page</a>.</p> <p>And there are loads of shortcode options <a href="http://quick-plugins.com/quick-paypal-payments/paypal-payments-shortcodes/" target="_blank">on this page</a>.</p> </div></div>'; echo $content; }
function qpp_init() { qpp_create_css_file(''); }