| 1 |
<?php |
| 2 |
defined('ABSPATH') || die(); |
| 3 |
/* |
| 4 |
* A template, included from inside a class method - never loaded on its own. |
| 5 |
* The variables below are locals of the method that includes it, not globals, |
| 6 |
* which is what the prefix sniff assumes about a file-scope assignment. |
| 7 |
*/ |
| 8 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- included from within a method, so these are function locals. |
| 9 |
?> |
| 10 |
|
| 11 |
<div class="hf-form-container"> |
| 12 |
<div class="hf-form-row"> |
| 13 |
<label><?php esc_html_e('Enable Auto Responder', 'hash-form'); ?></label> |
| 14 |
<div class="hf-setting-fields hf-toggle-input-field"> |
| 15 |
<input type="hidden" name="enable_ar" value="off"> |
| 16 |
<input type="checkbox" name="enable_ar" value="on" data-condition="toggle" id="hf-enable-ar" <?php checked($settings['enable_ar'], 'on', true); ?>> |
| 17 |
</div> |
| 18 |
</div> |
| 19 |
|
| 20 |
<?php |
| 21 |
// Everything below only applies once the responder is on, so it is |
| 22 |
// grouped and hung off the switch rather than sitting there looking |
| 23 |
// active while nothing sends. One group, not one rule per row. |
| 24 |
?> |
| 25 |
<div data-condition-toggle="hf-enable-ar"> |
| 26 |
<div class="hf-form-row"> |
| 27 |
<label><?php esc_html_e('From Email', 'hash-form'); ?></label> |
| 28 |
<input type="text" name="from_ar" value="<?php echo esc_attr($settings['from_ar']) ?>" /> |
| 29 |
</div> |
| 30 |
|
| 31 |
<div class="hf-form-row"> |
| 32 |
<label><?php esc_html_e('From Name', 'hash-form'); ?></label> |
| 33 |
<input type="text" name="from_ar_name" value="<?php echo esc_attr($settings['from_ar_name']) ?>" /> |
| 34 |
</div> |
| 35 |
|
| 36 |
<div class="hf-form-row"> |
| 37 |
<label><?php esc_html_e('Reply To Email', 'hash-form'); ?></label> |
| 38 |
<select name="reply_to_ar"> |
| 39 |
<option value=""><?php esc_html_e('Choose a Form Field', 'hash-form'); ?></option> |
| 40 |
<?php |
| 41 |
foreach ($fields as $field) { |
| 42 |
if ($field->type == 'email') { |
| 43 |
?> |
| 44 |
<option value="<?php echo esc_attr($field->id); ?>" <?php selected($settings['reply_to_ar'], $field->id); ?>><?php echo esc_html($field->name); ?></option> |
| 45 |
<?php |
| 46 |
} |
| 47 |
} |
| 48 |
?> |
| 49 |
</select> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="hf-form-row"> |
| 53 |
<label> <?php esc_html_e('Subject', 'hash-form'); ?></label> |
| 54 |
<input type="text" name="email_subject_ar" value="<?php echo esc_attr($settings['email_subject_ar']) ?>" /> |
| 55 |
</div> |
| 56 |
|
| 57 |
<div class="hf-form-row"> |
| 58 |
<label><?php esc_html_e('Message', 'hash-form'); ?></label> |
| 59 |
<textarea name="email_message_ar" cols="50" rows="5"><?php echo ($settings['email_message_ar'] ? esc_textarea($settings['email_message_ar']) : ''); ?></textarea> |
| 60 |
</div> |
| 61 |
</div> |
| 62 |
</div> |