| 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 |
// Settings saved before this section existed have none of these keys. |
| 11 |
$settings = array_merge(HashFormHelper::get_form_settings_default(), (array) $settings); |
| 12 |
?> |
| 13 |
|
| 14 |
<div class="hf-form-container"> |
| 15 |
<div class="hf-form-row"> |
| 16 |
<label><?php esc_html_e('One Entry Per Person', 'hash-form'); ?></label> |
| 17 |
<div class="hf-setting-fields hf-toggle-input-field"> |
| 18 |
<input type="hidden" name="one_entry_per_user" value="off"> |
| 19 |
<input type="checkbox" name="one_entry_per_user" value="on" data-condition="toggle" id="hf-one-entry" <?php checked($settings['one_entry_per_user'], 'on', true); ?>> |
| 20 |
</div> |
| 21 |
<p class="hf-desc"><?php esc_html_e('Logged in visitors are matched by their account, guests by IP address.', 'hash-form'); ?></p> |
| 22 |
</div> |
| 23 |
|
| 24 |
<div class="hf-form-row" data-condition-toggle="hf-one-entry" data-condition-val="on"> |
| 25 |
<label><?php esc_html_e('Message After Submitting Once', 'hash-form'); ?></label> |
| 26 |
<textarea name="duplicate_message"><?php echo esc_textarea($settings['duplicate_message']); ?></textarea> |
| 27 |
</div> |
| 28 |
|
| 29 |
<?php |
| 30 |
// Scheduling, entry limits and login requirements live in the Pro plugin, |
| 31 |
// which adds its own section when active. |
| 32 |
if (!defined('HASH_FORM_PRO_VERSION')) { |
| 33 |
?> |
| 34 |
<div class="hf-form-row"> |
| 35 |
<p class="hf-desc"> |
| 36 |
<?php esc_html_e('Looking to schedule this form, cap the number of entries or require visitors to log in?', 'hash-form'); ?> |
| 37 |
<a href="https://hashthemes.com/plugin/hash-form-pro/" target="_blank" rel="noopener"><?php esc_html_e('Hash Form Pro', 'hash-form'); ?></a> |
| 38 |
<?php esc_html_e('adds those under Schedule & Restriction.', 'hash-form'); ?> |
| 39 |
</p> |
| 40 |
</div> |
| 41 |
<?php |
| 42 |
} |
| 43 |
?> |
| 44 |
</div> |