admin-panel.php
265 lines
| 1 | <?php if (! version_compare($wp_version, '2.7-beta3', '>=') && isset($updated_message)) : ?> |
| 2 | <div id="message" class="updated fade"><p><strong><?php echo $updated_message; ?></strong></p></div> |
| 3 | <?php endif; ?> |
| 4 | <div class="wrap wpcf7"> |
| 5 | <h2><?php _e('Contact Form 7', 'wpcf7'); ?></h2> |
| 6 | |
| 7 | <?php if (version_compare($wp_version, '2.7-beta3', '>=') && isset($updated_message)) : ?> |
| 8 | <div id="message" class="updated fade"><p><strong><?php echo $updated_message; ?></strong></p></div> |
| 9 | <?php endif; ?> |
| 10 | |
| 11 | <ul class="subsubsub"> |
| 12 | <?php foreach ($contact_forms as $k => $v) : ?> |
| 13 | <li><a href="<?php echo $base_url . '?page=' . $page . '&contactform=' . $k ?>"<?php if ($k == $current) echo ' class="current"'; ?>> |
| 14 | <?php echo $v['title']; ?></a> |</li> |
| 15 | <?php endforeach; ?> |
| 16 | |
| 17 | <?php if ($this->has_edit_cap()) : ?> |
| 18 | <li class="addnew"> |
| 19 | <a href="<?php echo $base_url . '?page=' . $page . '&contactform=new'; ?>"<?php if ($unsaved) echo ' class="current"'; ?>> |
| 20 | <?php _e('Add new', 'wpcf7'); ?></a></li> |
| 21 | <?php endif; ?> |
| 22 | </ul> |
| 23 | |
| 24 | <br class="clear" /> |
| 25 | |
| 26 | <?php if ($cf) : ?> |
| 27 | <?php $disabled = ($this->has_edit_cap()) ? '' : ' disabled="disabled"'; ?> |
| 28 | |
| 29 | <form method="post" action="<?php echo $base_url . '?page=' . $page . '&contactform=' . $current; ?>" id="wpcf7-admin-form-element"> |
| 30 | <?php if ($this->has_edit_cap()) wp_nonce_field('wpcf7-save_' . $current); ?> |
| 31 | <input type="hidden" id="wpcf7-id" name="wpcf7-id" value="<?php echo $current; ?>" /> |
| 32 | |
| 33 | <table class="widefat"> |
| 34 | <tbody> |
| 35 | <tr> |
| 36 | <td scope="col"> |
| 37 | <div style="position: relative;"> |
| 38 | <input type="text" id="wpcf7-title" name="wpcf7-title" size="40" value="<?php echo htmlspecialchars($cf['title']); ?>"<?php echo $disabled; ?> /> |
| 39 | |
| 40 | <?php if (! $unsaved) : ?> |
| 41 | <p class="tagcode"> |
| 42 | <?php _e('Copy this code and paste it into your post, page or text widget content.', 'wpcf7'); ?><br /> |
| 43 | <input type="text" id="contact-form-anchor-text" onfocus="this.select();" readonly="readonly" /> |
| 44 | </p> |
| 45 | <?php endif; ?> |
| 46 | |
| 47 | <?php if ($this->has_edit_cap()) : ?> |
| 48 | <div class="save-contact-form"> |
| 49 | <input type="submit" class="button button-highlighted" name="wpcf7-save" value="<?php _e('Save', 'wpcf7'); ?>" /> |
| 50 | </div> |
| 51 | <?php endif; ?> |
| 52 | |
| 53 | <?php if ($this->has_edit_cap() && ! $unsaved) : ?> |
| 54 | <div class="delete-link"><?php $delete_nonce = wp_create_nonce('wpcf7-delete_' . $current); ?> |
| 55 | <input type="submit" name="wpcf7-delete" value="<?php _e('Delete this contact form', 'wpcf7'); ?>" |
| 56 | <?php echo "onclick=\"if (confirm('" . js_escape(__("You are about to delete this contact form.\n 'Cancel' to stop, 'OK' to delete.", 'wpcf7')) . "')) {this.form._wpnonce.value = '$delete_nonce'; return true;} return false;\""; ?> /> |
| 57 | </div> |
| 58 | <?php endif; ?> |
| 59 | </div> |
| 60 | </td> |
| 61 | </tr> |
| 62 | </tbody> |
| 63 | </table> |
| 64 | |
| 65 | <?php if ($this->has_edit_cap()) : ?> |
| 66 | |
| 67 | <table class="widefat" style="margin-top: 1em;"> |
| 68 | <thead> |
| 69 | <tr> |
| 70 | <th scope="col" colspan="2"><?php _e('Form', 'wpcf7'); ?></th> |
| 71 | </tr> |
| 72 | </thead> |
| 73 | <tbody> |
| 74 | <tr> |
| 75 | <td scope="col" style="width: 50%;"> |
| 76 | <div> |
| 77 | <textarea id="wpcf7-form" name="wpcf7-form" cols="100" rows="20"><?php echo htmlspecialchars($cf['form']); ?></textarea> |
| 78 | </div> |
| 79 | </td> |
| 80 | <td scope="col" style="width: 50%;"> |
| 81 | <div id="tag-generator-div"></div> |
| 82 | </td> |
| 83 | </tr> |
| 84 | </tbody> |
| 85 | </table> |
| 86 | |
| 87 | <table class="widefat" style="margin-top: 1em;"> |
| 88 | <thead> |
| 89 | <tr> |
| 90 | <th scope="col" colspan="2"><?php _e('Mail', 'wpcf7'); ?></th> |
| 91 | </tr> |
| 92 | </thead> |
| 93 | <tbody> |
| 94 | <tr> |
| 95 | <td scope="col" style="width: 50%;"> |
| 96 | <div class="mail-field"> |
| 97 | <label for="wpcf7-mail-recipient"><?php _e('To:', 'wpcf7'); ?></label><br /> |
| 98 | <input type="text" id="wpcf7-mail-recipient" name="wpcf7-mail-recipient" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail']['recipient']); ?>" /> |
| 99 | </div> |
| 100 | <div class="mail-field"> |
| 101 | <label for="wpcf7-mail-sender"><?php _e('From:', 'wpcf7'); ?></label><br /> |
| 102 | <input type="text" id="wpcf7-mail-sender" name="wpcf7-mail-sender" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail']['sender']); ?>" /> |
| 103 | </div> |
| 104 | <div class="mail-field"> |
| 105 | <label for="wpcf7-mail-subject"><?php _e('Subject:', 'wpcf7'); ?></label><br /> |
| 106 | <input type="text" id="wpcf7-mail-subject" name="wpcf7-mail-subject" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail']['subject']); ?>" /> |
| 107 | </div> |
| 108 | <div class="pseudo-hr"></div> |
| 109 | <div class="mail-field"> |
| 110 | <label for="wpcf7-mail-attachments"><?php _e('File attachments:', 'wpcf7'); ?></label> |
| 111 | <?php if (version_compare($wp_version, '2.7-alpha', '<')) : ?> |
| 112 | <span style="color: #ff3300; margin-left: 0.5em;"><?php _e('(You need WordPress 2.7 or greater to use this feature)', 'wpcf7'); ?></span> |
| 113 | <?php endif; ?> |
| 114 | <br /> |
| 115 | <input type="text" id="wpcf7-mail-attachments" name="wpcf7-mail-attachments" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail']['attachments']); ?>" /> |
| 116 | </div> |
| 117 | <div class="pseudo-hr"></div> |
| 118 | <div class="mail-field"> |
| 119 | <input type="checkbox" id="wpcf7-mail-use-html" name="wpcf7-mail-use-html" value="1"<?php echo ($cf['mail']['use_html']) ? ' checked="checked"' : ''; ?> /> |
| 120 | <label for="wpcf7-mail-use-html"><?php _e('Use HTML content type', 'wpcf7'); ?></label> |
| 121 | </div> |
| 122 | </td> |
| 123 | <td scope="col" style="width: 50%;"> |
| 124 | <div class="mail-field"> |
| 125 | <label for="wpcf7-mail-body"><?php _e('Message body:', 'wpcf7'); ?></label><br /> |
| 126 | <textarea id="wpcf7-mail-body" name="wpcf7-mail-body" cols="100" rows="16"><?php echo htmlspecialchars($cf['mail']['body']); ?></textarea> |
| 127 | </div> |
| 128 | </td> |
| 129 | </tr> |
| 130 | </tbody> |
| 131 | </table> |
| 132 | |
| 133 | <table class="widefat" style="margin-top: 1em;"> |
| 134 | <thead> |
| 135 | <tr> |
| 136 | <th scope="col" colspan="2"><?php _e('Mail (2)', 'wpcf7'); ?></th> |
| 137 | </tr> |
| 138 | </thead> |
| 139 | <tbody> |
| 140 | <tr> |
| 141 | <td scope="col" colspan="2"> |
| 142 | <input type="checkbox" id="wpcf7-mail-2-active" name="wpcf7-mail-2-active" value="1"<?php echo ($cf['mail_2']['active']) ? ' checked="checked"' : ''; ?> /> |
| 143 | <label for="wpcf7-mail-2-active"><?php _e('Use mail (2)', 'wpcf7'); ?></label> |
| 144 | </td> |
| 145 | </tr> |
| 146 | <tr id="mail-2-fields"> |
| 147 | <td scope="col" style="width: 50%;"> |
| 148 | <div class="mail-field"> |
| 149 | <label for="wpcf7-mail-2-recipient"><?php _e('To:', 'wpcf7'); ?></label><br /> |
| 150 | <input type="text" id="wpcf7-mail-2-recipient" name="wpcf7-mail-2-recipient" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail_2']['recipient']); ?>" /> |
| 151 | </div> |
| 152 | <div class="mail-field"> |
| 153 | <label for="wpcf7-mail-2-sender"><?php _e('From:', 'wpcf7'); ?></label><br /> |
| 154 | <input type="text" id="wpcf7-mail-2-sender" name="wpcf7-mail-2-sender" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail_2']['sender']); ?>" /> |
| 155 | </div> |
| 156 | <div class="mail-field"> |
| 157 | <label for="wpcf7-mail-2-subject"><?php _e('Subject:', 'wpcf7'); ?></label><br /> |
| 158 | <input type="text" id="wpcf7-mail-2-subject" name="wpcf7-mail-2-subject" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail_2']['subject']); ?>" /> |
| 159 | </div> |
| 160 | <div class="pseudo-hr"></div> |
| 161 | <div class="mail-field"> |
| 162 | <label for="wpcf7-mail-2-attachments"><?php _e('File attachments:', 'wpcf7'); ?></label> |
| 163 | <?php if (version_compare($wp_version, '2.7-alpha', '<')) : ?> |
| 164 | <span style="color: #ff3300; margin-left: 0.5em;"><?php _e('(You need WordPress 2.7 or greater to use this feature)', 'wpcf7'); ?></span> |
| 165 | <?php endif; ?> |
| 166 | <br /> |
| 167 | <input type="text" id="wpcf7-mail-2-attachments" name="wpcf7-mail-2-attachments" class="wide" size="70" value="<?php echo htmlspecialchars($cf['mail_2']['attachments']); ?>" /> |
| 168 | </div> |
| 169 | <div class="pseudo-hr"></div> |
| 170 | <div class="mail-field"> |
| 171 | <input type="checkbox" id="wpcf7-mail-2-use-html" name="wpcf7-mail-2-use-html" value="1"<?php echo ($cf['mail_2']['use_html']) ? ' checked="checked"' : ''; ?> /> |
| 172 | <label for="wpcf7-mail-2-use-html"><?php _e('Use HTML content type', 'wpcf7'); ?></label> |
| 173 | </div> |
| 174 | </td> |
| 175 | <td scope="col" style="width: 50%;"> |
| 176 | <div class="mail-field"> |
| 177 | <label for="wpcf7-mail-2-body"><?php _e('Message body:', 'wpcf7'); ?></label><br /> |
| 178 | <textarea id="wpcf7-mail-2-body" name="wpcf7-mail-2-body" cols="100" rows="16"><?php echo htmlspecialchars($cf['mail_2']['body']); ?></textarea> |
| 179 | </div> |
| 180 | </td> |
| 181 | </tr> |
| 182 | </tbody> |
| 183 | </table> |
| 184 | |
| 185 | <table class="widefat" style="margin-top: 1em;"> |
| 186 | <thead> |
| 187 | <tr> |
| 188 | <th scope="col"><?php _e('Messages', 'wpcf7'); ?> <span id="message-fields-toggle-switch"></span></th> |
| 189 | </tr> |
| 190 | </thead> |
| 191 | <tbody> |
| 192 | <tr> |
| 193 | <td scope="col"> |
| 194 | <div id="message-fields"> |
| 195 | <div class="message-field"> |
| 196 | <label for="wpcf7-message-mail-sent-ok"><em># <?php _e("Sender's message was sent successfully", 'wpcf7'); ?></em></label><br /> |
| 197 | <input type="text" id="wpcf7-message-mail-sent-ok" name="wpcf7-message-mail-sent-ok" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['mail_sent_ok']); ?>" /> |
| 198 | </div> |
| 199 | <div class="message-field"> |
| 200 | <label for="wpcf7-message-mail-sent-ng"><em># <?php _e("Sender's message was failed to send", 'wpcf7'); ?></em></label><br /> |
| 201 | <input type="text" id="wpcf7-message-mail-sent-ng" name="wpcf7-message-mail-sent-ng" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['mail_sent_ng']); ?>" /> |
| 202 | </div> |
| 203 | <div class="message-field"> |
| 204 | <label for="wpcf7-message-akismet-says-spam"><em># <?php _e("Akismet judged the sending activity as spamming", 'wpcf7'); ?></em></label><br /> |
| 205 | <input type="text" id="wpcf7-message-akismet-says-spam" name="wpcf7-message-akismet-says-spam" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['akismet_says_spam']); ?>" /> |
| 206 | </div> |
| 207 | <div class="message-field"> |
| 208 | <label for="wpcf7-message-validation-error"><em># <?php _e("Validation errors occurred", 'wpcf7'); ?></em></label><br /> |
| 209 | <input type="text" id="wpcf7-message-validation-error" name="wpcf7-message-validation-error" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['validation_error']); ?>" /> |
| 210 | </div> |
| 211 | <div class="message-field" style="margin-top: 1em;"> |
| 212 | <label for="wpcf7-message-invalid-required"><em># <?php _e("There is a field that sender is needed to fill in", 'wpcf7'); ?></em></label><br /> |
| 213 | <input type="text" id="wpcf7-message-invalid-required" name="wpcf7-message-invalid-required" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['invalid_required']); ?>" /> |
| 214 | </div> |
| 215 | <div class="message-field"> |
| 216 | <label for="wpcf7-message-invalid-email"><em># <?php _e("Email address that sender entered is invalid", 'wpcf7'); ?></em></label><br /> |
| 217 | <input type="text" id="wpcf7-message-invalid-email" name="wpcf7-message-invalid-email" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['invalid_email']); ?>" /> |
| 218 | </div> |
| 219 | <div class="message-field"> |
| 220 | <label for="wpcf7-message-accept-terms"><em># <?php _e("There is a field of term that sender is needed to accept", 'wpcf7'); ?></em></label><br /> |
| 221 | <input type="text" id="wpcf7-message-accept-terms" name="wpcf7-message-accept-terms" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['accept_terms']); ?>" /> |
| 222 | </div> |
| 223 | <div class="message-field"> |
| 224 | <label for="wpcf7-message-captcha-not-match"><em># <?php _e("The code that sender entered does not match the CAPTCHA", 'wpcf7'); ?></em></label><br /> |
| 225 | <input type="text" id="wpcf7-message-captcha-not-match" name="wpcf7-message-captcha-not-match" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['captcha_not_match']); ?>" /> |
| 226 | </div> |
| 227 | <div class="message-field"> |
| 228 | <label for="wpcf7-message-upload-failed"><em># <?php _e("Uploading a file fails for any reason", 'wpcf7'); ?></em></label><br /> |
| 229 | <input type="text" id="wpcf7-message-upload-failed" name="wpcf7-message-upload-failed" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['upload_failed']); ?>" /> |
| 230 | </div> |
| 231 | <div class="message-field"> |
| 232 | <label for="wpcf7-message-upload-file-type-invalid"><em># <?php _e("Uploaded file is not allowed file type", 'wpcf7'); ?></em></label><br /> |
| 233 | <input type="text" id="wpcf7-message-upload-file-type-invalid" name="wpcf7-message-upload-file-type-invalid" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['upload_file_type_invalid']); ?>" /> |
| 234 | </div> |
| 235 | <div class="message-field"> |
| 236 | <label for="wpcf7-message-upload-file-too-large"><em># <?php _e("Uploaded file is too large", 'wpcf7'); ?></em></label><br /> |
| 237 | <input type="text" id="wpcf7-message-upload-file-too-large" name="wpcf7-message-upload-file-too-large" class="wide" size="70" value="<?php echo htmlspecialchars($cf['messages']['upload_file_too_large']); ?>" /> |
| 238 | </div> |
| 239 | </div> |
| 240 | |
| 241 | </td> |
| 242 | </tr> |
| 243 | </tbody> |
| 244 | </table> |
| 245 | |
| 246 | <input type="hidden" id="wpcf7-options-recipient" name="wpcf7-options-recipient" value="<?php echo htmlspecialchars($cf['options']['recipient']); ?>" /> |
| 247 | |
| 248 | <table class="widefat" style="margin-top: 1em;"> |
| 249 | <tbody> |
| 250 | <tr> |
| 251 | <td scope="col"> |
| 252 | <div class="save-contact-form"> |
| 253 | <input type="submit" class="button button-highlighted" name="wpcf7-save" value="<?php _e('Save', 'wpcf7'); ?>" /> |
| 254 | </div> |
| 255 | </td> |
| 256 | </tr> |
| 257 | </tbody> |
| 258 | </table> |
| 259 | |
| 260 | <?php endif; ?> |
| 261 | |
| 262 | </form> |
| 263 | |
| 264 | <?php endif; ?> |
| 265 | </div> |