| 1 |
<div id="form_settings_page" class="wrap"> |
| 2 |
<h2><?php esc_html_e( 'Settings', 'formidable' ) ?> |
| 3 |
<a href="#" class="add-new-h2 frm_invisible"></a> |
| 4 |
</h2> |
| 5 |
|
| 6 |
<?php |
| 7 |
// Add form messages |
| 8 |
require( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); |
| 9 |
?> |
| 10 |
|
| 11 |
<div id="poststuff"> |
| 12 |
<div id="post-body" class="metabox-holder columns-2"> |
| 13 |
<div id="post-body-content"> |
| 14 |
<?php FrmAppController::get_form_nav( $id, true ); ?> |
| 15 |
|
| 16 |
<form method="post" class="frm_form_settings"> |
| 17 |
<input type="hidden" name="id" id="form_id" value="<?php echo (int) $id; ?>" /> |
| 18 |
<input type="hidden" name="frm_action" value="update_settings" /> |
| 19 |
|
| 20 |
<div class="meta-box-sortables"> |
| 21 |
<div class="categorydiv postbox" id="frm-categorydiv"> |
| 22 |
<h3 class="hndle"><span><?php esc_html_e( 'Form Settings', 'formidable' ) ?></span></h3> |
| 23 |
<div class="inside frm-help-tabs"> |
| 24 |
<div id="contextual-help-back"></div> |
| 25 |
<div id="contextual-help-columns"> |
| 26 |
<div class="contextual-help-tabs"> |
| 27 |
<ul class="frm-category-tabs frm-form-setting-tabs"> |
| 28 |
<?php $a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'advanced_settings' ); ?> |
| 29 |
<li class="<?php echo esc_attr( 'advanced_settings' === $a ? 'tabs active' : '' ); ?>"> |
| 30 |
<a href="#advanced_settings"><?php esc_html_e( 'General', 'formidable' ) ?></a> |
| 31 |
</li> |
| 32 |
<li class="<?php echo esc_attr( 'email_settings' === $a ? 'tabs active' : '' ); ?>"> |
| 33 |
<a href="#email_settings"><?php esc_html_e( 'Form Actions', 'formidable' ); ?></a> |
| 34 |
</li> |
| 35 |
<li class="<?php echo esc_attr( 'html_settings' === $a ? 'class="tabs active"' : '' ); ?>"> |
| 36 |
<a href="#html_settings"><?php esc_html_e( 'Customize HTML', 'formidable' ) ?></a> |
| 37 |
</li> |
| 38 |
<?php |
| 39 |
foreach ( $sections as $key => $section ) { |
| 40 |
if ( isset( $section['name'] ) ) { |
| 41 |
$sec_name = $section['name']; |
| 42 |
$sec_anchor = $section['anchor']; |
| 43 |
} else { |
| 44 |
$sec_name = $key; |
| 45 |
$sec_anchor = $key; |
| 46 |
} |
| 47 |
?> |
| 48 |
<li class="<?php echo esc_attr( $a === $sec_anchor . '_settings' ? 'tabs active' : '' ); ?>"> |
| 49 |
<a href="#<?php echo esc_attr( $sec_anchor ) ?>_settings"><?php echo ucfirst( $sec_name ) ?></a> |
| 50 |
</li> |
| 51 |
<?php } ?> |
| 52 |
</ul> |
| 53 |
</div> |
| 54 |
<div class="advanced_settings tabs-panel <?php echo esc_attr( $a === 'advanced_settings' ? 'frm_block' : 'frm_hidden' ); ?>"> |
| 55 |
<?php FrmTipsHelper::pro_tip( 'get_form_settings_tip', 'p' ); ?> |
| 56 |
|
| 57 |
<?php |
| 58 |
$tooltip = __( 'Choose what will happen after the user submits this form.', 'formidable' ); |
| 59 |
if ( ! FrmAppHelper::pro_is_installed() ) { |
| 60 |
$tooltip .= __( ' Upgrade to Formidable Pro to get access to all options in the dropdown.', 'formidable' ); |
| 61 |
} |
| 62 |
?> |
| 63 |
<h3 class="frm_first_h3"> |
| 64 |
<?php esc_html_e( 'On Submit', 'formidable' ); ?> |
| 65 |
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php echo esc_attr( $tooltip ) ?>"></span> |
| 66 |
</h3> |
| 67 |
|
| 68 |
<!--On Submit Section--> |
| 69 |
<table class="form-table"> |
| 70 |
<tr> |
| 71 |
<td class="frm_175_width"> |
| 72 |
<select name="options[success_action]" id="success_action"> |
| 73 |
<option value="message" <?php selected( $values['success_action'], 'message' ) ?>> |
| 74 |
<?php esc_html_e( 'Show Message', 'formidable' ); ?> |
| 75 |
</option> |
| 76 |
<?php if ( FrmAppHelper::pro_is_installed() ) { ?> |
| 77 |
<option value="redirect" <?php selected( $values['success_action'], 'redirect' ); ?>> |
| 78 |
<?php esc_html_e( 'Redirect to URL', 'formidable' ) ?> |
| 79 |
</option> |
| 80 |
<option value="page" <?php selected( $values['success_action'], 'page' ); ?>> |
| 81 |
<?php esc_html_e( 'Show Page Content', 'formidable' ) ?> |
| 82 |
</option> |
| 83 |
<?php } else { ?> |
| 84 |
<option value="redirect" disabled="disabled" <?php selected( $values['success_action'], 'redirect' ); ?>> |
| 85 |
<?php esc_html_e( 'Redirect to URL', 'formidable' ); ?> |
| 86 |
<?php esc_html_e( '(Premium feature)', 'formidable' ); ?> |
| 87 |
</option> |
| 88 |
<option value="page" disabled="disabled" <?php selected( $values['success_action'], 'page' ); ?>> |
| 89 |
<?php esc_html_e( 'Show Page Content', 'formidable' ); ?> |
| 90 |
<?php esc_html_e( '(Premium feature)', 'formidable' ); ?> |
| 91 |
</option> |
| 92 |
<?php } ?> |
| 93 |
</select> |
| 94 |
</td> |
| 95 |
<td> |
| 96 |
<span class="success_action_redirect_box success_action_box<?php echo esc_attr( $values['success_action'] === 'redirect' ? '' : ' frm_hidden' ); ?>"> |
| 97 |
<input type="text" name="options[success_url]" id="success_url" value="<?php echo esc_attr( isset( $values['success_url'] ) ? $values['success_url'] : '' ); ?>" placeholder="http://example.com" /> |
| 98 |
</span> |
| 99 |
|
| 100 |
<?php if ( FrmAppHelper::pro_is_installed() ) { ?> |
| 101 |
<span class="success_action_page_box success_action_box<?php echo esc_attr( $values['success_action'] === 'page' ? '' : ' frm_hidden' ); ?>"> |
| 102 |
<label><?php esc_html_e( 'Use Content from Page', 'formidable' ) ?></label> |
| 103 |
<?php FrmAppHelper::wp_pages_dropdown( 'options[success_page_id]', $values['success_page_id'] ) ?> |
| 104 |
</span> |
| 105 |
<?php } ?> |
| 106 |
</td> |
| 107 |
</tr> |
| 108 |
<tr class="frm_show_form_opt success_action_message_box success_action_box<?php echo esc_attr( $values['success_action'] == 'message' ? '' : ' frm_hidden' ); ?>"> |
| 109 |
<td colspan="2"> |
| 110 |
<label for="show_form"> |
| 111 |
<input type="checkbox" name="options[show_form]" id="show_form" value="1" <?php checked( $values['show_form'], 1 ) ?> /> |
| 112 |
<?php esc_html_e( 'Show the form with the confirmation message', 'formidable' ) ?> |
| 113 |
</label> |
| 114 |
</td> |
| 115 |
</tr> |
| 116 |
<tr> |
| 117 |
<td colspan="2"> |
| 118 |
<label for="no_save"> |
| 119 |
<input type="checkbox" name="options[no_save]" id="no_save" value="1" <?php checked( $values['no_save'], 1 ); ?> /> |
| 120 |
<?php esc_html_e( 'Do not store entries submitted from this form', 'formidable' ) ?> |
| 121 |
</label> |
| 122 |
</td> |
| 123 |
</tr> |
| 124 |
<?php if ( function_exists( 'akismet_http_post') ) { ?> |
| 125 |
<tr> |
| 126 |
<td colspan="2"><?php esc_html_e( 'Use Akismet to check entries for spam for', 'formidable' ) ?> |
| 127 |
<select name="options[akismet]"> |
| 128 |
<option value=""> |
| 129 |
<?php esc_html_e( 'no one', 'formidable' ) ?> |
| 130 |
</option> |
| 131 |
<option value="1" <?php selected( $values['akismet'], 1 ) ?>> |
| 132 |
<?php esc_html_e( 'everyone', 'formidable' ) ?> |
| 133 |
</option> |
| 134 |
<option value="logged" <?php selected( $values['akismet'], 'logged' ) ?>> |
| 135 |
<?php esc_html_e( 'visitors who are not logged in', 'formidable' ) ?> |
| 136 |
</option> |
| 137 |
</select> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
<?php } ?> |
| 141 |
</table> |
| 142 |
|
| 143 |
<!--AJAX Section--> |
| 144 |
<h3><?php esc_html_e( 'AJAX', 'formidable' ) ?> |
| 145 |
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Make stuff happen in the background without a page refresh', 'formidable' ) ?>" ></span> |
| 146 |
</h3> |
| 147 |
<table class="form-table"> |
| 148 |
<tr> |
| 149 |
<td> |
| 150 |
<label for="ajax_load"> |
| 151 |
<input type="checkbox" name="options[ajax_load]" id="ajax_load" value="1"<?php echo ( $values['ajax_load'] ) ? ' checked="checked"' : ''; ?> /> <?php esc_html_e( 'Load and save form builder page with AJAX', 'formidable' ) ?> |
| 152 |
</label> |
| 153 |
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Recommended for long forms.', 'formidable' ) ?>" ></span> |
| 154 |
</td> |
| 155 |
</tr> |
| 156 |
<?php do_action( 'frm_add_form_ajax_options', $values ); ?> |
| 157 |
</table> |
| 158 |
|
| 159 |
<!--Permissions Section--> |
| 160 |
<?php do_action( 'frm_add_form_perm_options', $values ); ?> |
| 161 |
|
| 162 |
<!--Styling & Buttons Section--> |
| 163 |
<h3><?php esc_html_e( 'Styling & Buttons', 'formidable' ) ?> |
| 164 |
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Select a style for this form and set the text for your buttons.', 'formidable' ) ?>" ></span> |
| 165 |
</h3> |
| 166 |
<table class="form-table"> |
| 167 |
<tr> |
| 168 |
<td class="frm_left_label"> |
| 169 |
<label for="custom_style"><?php esc_html_e( 'Style Template', 'formidable' ) ?></label> |
| 170 |
</td> |
| 171 |
<td><select name="options[custom_style]" id="custom_style"> |
| 172 |
<option value="1" <?php selected( $values['custom_style'], 1 ) ?>> |
| 173 |
<?php esc_html_e( 'Always use default', 'formidable' ) ?> |
| 174 |
</option> |
| 175 |
<?php foreach ( $styles as $s ) { ?> |
| 176 |
<option value="<?php echo esc_attr( $s->ID ) ?>" <?php selected( $s->ID, $values['custom_style'] ) ?>> |
| 177 |
<?php echo esc_html( $s->post_title . ( empty( $s->menu_order ) ? '' : ' (' . __( 'default', 'formidable' ) . ')' ) ) ?> |
| 178 |
</option> |
| 179 |
<?php } ?> |
| 180 |
<option value="0" <?php selected( $values['custom_style'], 0 ); selected( $values['custom_style'], '' ) ?>> |
| 181 |
<?php esc_html_e( 'Do not use Formidable styling', 'formidable' ) ?> |
| 182 |
</option> |
| 183 |
</select></td> |
| 184 |
</tr> |
| 185 |
<tr> |
| 186 |
<td><label><?php esc_html_e( 'Submit Button Text', 'formidable' ) ?></label></td> |
| 187 |
<td> |
| 188 |
<input type="text" name="options[submit_value]" value="<?php echo esc_attr( $values['submit_value'] ); ?>" /> |
| 189 |
</td> |
| 190 |
</tr> |
| 191 |
<?php do_action( 'frm_add_form_button_options', $values ); ?> |
| 192 |
</table> |
| 193 |
|
| 194 |
<!--Message Section--> |
| 195 |
<h3 id="frm_messages_header" class="<?php echo esc_attr( ( ( isset( $values['edit_action'] ) && $values['edit_action'] == 'message' && isset( $values['editable'] ) && $values['editable'] == 1 ) || $values['success_action'] == 'message' || $values['save_draft'] == 1 ) ? '' : 'frm_hidden' ); ?>"> |
| 196 |
<?php esc_html_e( 'Messages', 'formidable' ); ?> |
| 197 |
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Set up your confirmation messages.', 'formidable' ) ?>" ></span> |
| 198 |
</h3> |
| 199 |
<table class="form-table"> |
| 200 |
<tr class="success_action_message_box success_action_box<?php echo esc_attr( $values['success_action'] === 'message' ? '' : ' frm_hidden' ); ?>"> |
| 201 |
<td> |
| 202 |
<div><?php esc_html_e( 'On Submit', 'formidable' ) ?></div> |
| 203 |
<textarea id="success_msg" name="options[success_msg]" cols="50" rows="2" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['success_msg'] ); ?></textarea> |
| 204 |
</td> |
| 205 |
</tr> |
| 206 |
<?php do_action( 'frm_add_form_msg_options', $values ); ?> |
| 207 |
</table> |
| 208 |
|
| 209 |
<!--Misc Section--> |
| 210 |
<?php if ( has_action( 'frm_additional_form_options' ) ) { ?> |
| 211 |
<h3><?php esc_html_e( 'Miscellaneous', 'formidable' ); ?></h3> |
| 212 |
<table class="form-table"> |
| 213 |
<?php do_action( 'frm_additional_form_options', $values ); ?> |
| 214 |
</table> |
| 215 |
<?php } ?> |
| 216 |
|
| 217 |
</div> |
| 218 |
|
| 219 |
|
| 220 |
<div id="frm_notification_settings" class="frm_email_settings email_settings tabs-panel widgets-holder-wrap <?php echo esc_attr( $a === 'email_settings' ? ' frm_block' : ' frm_hidden' ); ?>"> |
| 221 |
<?php FrmTipsHelper::pro_tip( 'get_form_action_tip', 'p' ); ?> |
| 222 |
<div id="frm_email_addon_menu" class="manage-menus"> |
| 223 |
<h3><?php esc_html_e( 'Add New Action', 'formidable' ) ?></h3> |
| 224 |
<ul class="frm_actions_list"> |
| 225 |
<?php |
| 226 |
|
| 227 |
//For each add-on, add an li, class, and javascript function. If active, add an additional class. |
| 228 |
foreach ( $action_controls as $action_control ) { |
| 229 |
$classes = ( isset( $action_control->action_options['active'] ) && $action_control->action_options['active'] ) ? 'frm_active_action ' : 'frm_inactive_action '; |
| 230 |
$classes .= $action_control->action_options['classes']; |
| 231 |
?> |
| 232 |
<li> |
| 233 |
<a href="javascript:void(0)" class="frm_<?php echo esc_attr( $action_control->id_base ) ?>_action frm_bstooltip <?php echo esc_attr( $classes ); ?>" title="<?php echo esc_attr( $action_control->action_options['tooltip'] ) ?>" data-limit="<?php echo esc_attr( isset( $action_control->action_options['limit'] ) ? $action_control->action_options['limit'] : '99' ); ?>" data-actiontype="<?php echo esc_attr( $action_control->id_base ) ?>"></a> |
| 234 |
</li> |
| 235 |
<?php |
| 236 |
unset( $actions_icon, $classes ); |
| 237 |
} |
| 238 |
?> |
| 239 |
</ul> |
| 240 |
</div> |
| 241 |
<div class="frm_no_actions"> |
| 242 |
<div class="inner_actions"> |
| 243 |
<img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/sketch_arrow1.png' ); ?>" alt=""/> |
| 244 |
<div class="clear"></div> |
| 245 |
<?php esc_html_e( 'Click an action to add it to this form', 'formidable' ) ?> |
| 246 |
</div> |
| 247 |
</div> |
| 248 |
<?php FrmFormActionsController::list_actions( $form, $values ); ?> |
| 249 |
</div> |
| 250 |
|
| 251 |
<div id="html_settings" class="tabs-panel <?php echo esc_attr( $a === 'html_settings' ) ? ' frm_block' : ' frm_hidden'; ?>"> |
| 252 |
|
| 253 |
<div class="frm_field_html_box frm_top_container"> |
| 254 |
<p> |
| 255 |
<label><?php esc_html_e( 'Form Classes', 'formidable' ) ?></label> |
| 256 |
<input type="text" name="options[form_class]" value="<?php echo esc_attr( $values['form_class'] ) ?>" /> |
| 257 |
</p> |
| 258 |
<div class="clear"></div> |
| 259 |
|
| 260 |
<p> |
| 261 |
<label><?php esc_html_e( 'Before Fields', 'formidable' ) ?></label> |
| 262 |
<textarea name="options[before_html]" rows="4" id="before_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['before_html'] ) ?></textarea> |
| 263 |
</p> |
| 264 |
|
| 265 |
<div id="add_html_fields"> |
| 266 |
<?php |
| 267 |
if ( isset( $values['fields'] ) ) { |
| 268 |
foreach ( $values['fields'] as $field ) { |
| 269 |
if ( apply_filters( 'frm_show_custom_html', true, $field['type'] ) ) { |
| 270 |
?> |
| 271 |
<p> |
| 272 |
<label><?php echo esc_html( $field['name'] ) ?></label> |
| 273 |
<textarea name="field_options[custom_html_<?php echo esc_attr( $field['id'] ) ?>]" rows="7" id="custom_html_<?php echo esc_attr( $field['id'] ) ?>" class="field_custom_html frm_long_input"><?php echo FrmAppHelper::esc_textarea( $field['custom_html'] ) ?></textarea> |
| 274 |
</p> |
| 275 |
<?php |
| 276 |
} |
| 277 |
unset( $field ); |
| 278 |
} |
| 279 |
} |
| 280 |
?> |
| 281 |
</div> |
| 282 |
|
| 283 |
<p><label><?php esc_html_e( 'After Fields', 'formidable' ) ?></label> |
| 284 |
<textarea name="options[after_html]" rows="3" id="after_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['after_html']) ?></textarea></p> |
| 285 |
|
| 286 |
<p><label><?php esc_html_e( 'Submit Button', 'formidable' ) ?></label> |
| 287 |
<textarea name="options[submit_html]" rows="3" id="submit_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['submit_html']) ?></textarea></p> |
| 288 |
</div> |
| 289 |
</div> |
| 290 |
|
| 291 |
<?php |
| 292 |
foreach ( $sections as $key => $section ) { |
| 293 |
if ( isset( $section['anchor'] ) ) { |
| 294 |
$sec_anchor = $section['anchor']; |
| 295 |
} else { |
| 296 |
$sec_anchor = $key; |
| 297 |
} |
| 298 |
?> |
| 299 |
<div id="<?php echo esc_attr( $sec_anchor ) ?>_settings" class="tabs-panel <?php echo ( $a === $sec_anchor . '_settings' ) ? ' frm_block' : ' frm_hidden'; ?>"> |
| 300 |
<?php |
| 301 |
if ( isset( $section['class'] ) ) { |
| 302 |
call_user_func( array( $section['class'], $section['function'] ), $values ); |
| 303 |
} else { |
| 304 |
call_user_func( ( isset( $section['function'] ) ? $section['function'] : $section ), $values ); |
| 305 |
} |
| 306 |
?> |
| 307 |
</div> |
| 308 |
<?php } ?> |
| 309 |
|
| 310 |
<?php do_action('frm_add_form_option_section', $values); ?> |
| 311 |
<div class="clear"></div> |
| 312 |
</div> |
| 313 |
</div> |
| 314 |
</div> |
| 315 |
|
| 316 |
</div> |
| 317 |
|
| 318 |
<p> |
| 319 |
<input type="submit" value="<?php esc_attr_e( 'Update', 'formidable' ) ?>" class="button-primary" /> |
| 320 |
</p> |
| 321 |
</form> |
| 322 |
|
| 323 |
|
| 324 |
</div> |
| 325 |
<?php require( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/sidebar-settings.php' ); ?> |
| 326 |
</div> |
| 327 |
</div> |
| 328 |
</div> |
| 329 |
|