| 1 |
<div id="form_settings_page" class="wrap"> |
| 2 |
<div class="frmicon icon32"><br/></div> |
| 3 |
<h2><?php _e('Settings', 'formidable') ?> |
| 4 |
<a href="#" class="add-new-h2" style="visibility:hidden;"></a> |
| 5 |
</h2> |
| 6 |
<?php FrmAppController::get_form_nav($id, true); |
| 7 |
require(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); |
| 8 |
|
| 9 |
if(version_compare( $GLOBALS['wp_version'], '3.3.3', '<')){ ?> |
| 10 |
<div id="poststuff" class="metabox-holder has-right-sidebar"> |
| 11 |
<?php |
| 12 |
require(FrmAppHelper::plugin_path() .'/classes/views/frm-forms/sidebar-settings.php'); |
| 13 |
}else{ ?> |
| 14 |
<div id="poststuff"> |
| 15 |
<?php } ?> |
| 16 |
|
| 17 |
<div id="post-body" class="metabox-holder columns-2"> |
| 18 |
<div id="post-body-content"> |
| 19 |
|
| 20 |
<form method="post" class="frm_form_settings"> |
| 21 |
<p style="clear:left; margin-top:0;"> |
| 22 |
<input type="submit" value="<?php _e('Update', 'formidable') ?>" class="button-primary" /> |
| 23 |
<?php _e('or', 'formidable') ?> |
| 24 |
<a class="button-secondary cancel" href="<?php echo esc_url(admin_url('admin.php?page=formidable') . '&frm_action=edit&id='. $id) ?>"><?php _e('Cancel', 'formidable') ?></a> |
| 25 |
<?php do_action('frm_settings_buttons', $values); ?> |
| 26 |
</p> |
| 27 |
|
| 28 |
<div class="clear"></div> |
| 29 |
|
| 30 |
<input type="hidden" name="id" value="<?php echo $id; ?>" /> |
| 31 |
<input type="hidden" name="frm_action" value="update_settings" /> |
| 32 |
<div id="poststuff" class="metabox-holder"> |
| 33 |
<div id="post-body"> |
| 34 |
<div class="meta-box-sortables"> |
| 35 |
<div class="categorydiv postbox"> |
| 36 |
<h3 class="hndle"><span><?php echo FrmAppHelper::truncate($values['name'], 40) .' '. __('Settings', 'formidable') ?></span></h3> |
| 37 |
<div class="inside frm-help-tabs"> |
| 38 |
<div id="contextual-help-back"></div> |
| 39 |
<div id="contextual-help-columns"> |
| 40 |
<div class="contextual-help-tabs"> |
| 41 |
<ul class="frm-category-tabs frm-form-setting-tabs"> |
| 42 |
<?php $a = isset($_GET['t']) ? $_GET['t'] : 'advanced_settings'; ?> |
| 43 |
<li <?php echo ($a == 'advanced_settings') ? 'class="tabs active"' : '' ?>><a href="#advanced_settings"><?php _e('General', 'formidable') ?></a></li> |
| 44 |
<li <?php echo ($a == 'notification_settings') ? 'class="tabs active"' : '' ?>><a href="#notification_settings"><?php _e('Emails', 'formidable') ?></a></li> |
| 45 |
<li <?php echo ($a == 'html_settings') ? 'class="tabs active"' : '' ?>><a href="#html_settings"><?php _e('Customize HTML', 'formidable') ?></a></li> |
| 46 |
<li <?php echo ($a == 'post_settings') ? 'class="tabs active"' : '' ?>><a href="#post_settings"><?php _e('Create Posts', 'formidable') ?></a></li> |
| 47 |
<?php foreach($sections as $sec_name => $section){ ?> |
| 48 |
<li <?php echo ($a == $sec_name .'_settings') ? 'class="tabs active"' : '' ?>><a href="#<?php echo $sec_name ?>_settings"><?php echo ucfirst($sec_name) ?></a></li> |
| 49 |
<?php } ?> |
| 50 |
</ul> |
| 51 |
</div> |
| 52 |
<div style="display:<?php echo ($a == 'advanced_settings') ? 'block' : 'none'; ?>;" class="advanced_settings tabs-panel"> |
| 53 |
<table class="form-table"> |
| 54 |
<tr><td colspan="2"><label for="custom_style"><input type="checkbox" name="options[custom_style]" id="custom_style" <?php echo ($values['custom_style']) ? ' checked="checked"' : ''; ?> value="1" /> |
| 55 |
<?php _e('Use Formidable styling for this form', 'formidable') ?></label></td> |
| 56 |
</tr> |
| 57 |
|
| 58 |
<tr><td colspan="2"><label class="frm_left_label"><?php _e('Submit Button Text', 'formidable') ?></label> |
| 59 |
<input type="text" name="options[submit_value]" value="<?php echo esc_attr($values['submit_value']); ?>" /></td> |
| 60 |
</tr> |
| 61 |
|
| 62 |
<tr><td colspan="2"><label><?php _e('Action After Form Submission', 'formidable') ?></label> |
| 63 |
<?php if(!$frm_vars['pro_is_installed']){ ?> |
| 64 |
<span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php _e('You must upgrade to Formidable Pro to get access to the second two options.', 'formidable') ?>" ></span> |
| 65 |
<?php } ?><br/> |
| 66 |
|
| 67 |
<label for="success_action_message"><input type="radio" name="options[success_action]" id="success_action_message" value="message" <?php checked($values['success_action'], 'message') ?> /> <?php _e('Display a Message', 'formidable') ?></label> |
| 68 |
<label for="success_action_page" <?php echo $pro_feature ?>><input type="radio" name="options[success_action]" id="success_action_page" value="page" <?php checked($values['success_action'], 'page') ?> <?php if(!$frm_vars['pro_is_installed']) echo 'disabled="disabled" '; ?>/> <?php _e('Display content from another page', 'formidable') ?></label> |
| 69 |
<label for="success_action_redirect" <?php echo $pro_feature ?>><input type="radio" name="options[success_action]" id="success_action_redirect" value="redirect" <?php checked($values['success_action'], 'redirect') ?> <?php if(!$frm_vars['pro_is_installed']) echo 'disabled="disabled" '; ?>/> <?php _e('Redirect to URL', 'formidable') ?></label> |
| 70 |
|
| 71 |
<p class="frm_indent_opt success_action_redirect_box success_action_box" <?php echo ($values['success_action'] == 'redirect') ? '' : 'style="display:none;"'; ?>> |
| 72 |
<input type="text" name="options[success_url]" id="success_url" value="<?php if(isset($values['success_url'])) echo esc_attr($values['success_url']); ?>" style="width:98%" placeholder="http://example.com" /> |
| 73 |
</p> |
| 74 |
|
| 75 |
<div class="frm_indent_opt success_action_message_box success_action_box" <?php echo ($values['success_action'] == 'message') ? '' : 'style="display:none;"'; ?>> |
| 76 |
<p><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></p> |
| 77 |
<p class="frm_show_form_opt"> |
| 78 |
<label for="show_form"><input type="checkbox" name="options[show_form]" id="show_form" value="1" <?php checked($values['show_form'], 1) ?> /> <?php _e('Show the form with the confirmation message', 'formidable')?></label> |
| 79 |
</p> |
| 80 |
</div> |
| 81 |
|
| 82 |
<?php if($frm_vars['pro_is_installed']){ ?> |
| 83 |
<p class="frm_indent_opt success_action_page_box success_action_box" <?php echo ($values['success_action'] == 'page') ? '' : 'style="display:none;"'; ?>> |
| 84 |
<label><?php _e('Use Content from Page', 'formidable') ?></label> |
| 85 |
<?php FrmAppHelper::wp_pages_dropdown( 'options[success_page_id]', $values['success_page_id'] ) ?> |
| 86 |
</p> |
| 87 |
<?php } ?> |
| 88 |
</td> |
| 89 |
</tr> |
| 90 |
|
| 91 |
<tr><td colspan="2"><label for="ajax_load"><input type="checkbox" name="options[ajax_load]" id="ajax_load" value="1"<?php echo ($values['ajax_load']) ? ' checked="checked"' : ''; ?> /> <?php _e('Load and save form builder page with AJAX', 'formidable') ?></label> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php _e('Recommended for long forms.', 'formidable') ?>" ></span></td></tr> |
| 92 |
|
| 93 |
|
| 94 |
<?php do_action('frm_additional_form_options', $values); ?> |
| 95 |
|
| 96 |
<tr><td colspan="2"><label for="no_save"><input type="checkbox" name="options[no_save]" id="no_save" value="1" <?php checked($values['no_save'], 1); ?> /> <?php _e('Do not store any entries submitted from this form.', 'formidable') ?> <span class="howto"><?php _e('Warning: There is no way to retrieve unsaved entries.', 'formidable') ?></span></label></td></tr> |
| 97 |
|
| 98 |
<?php if (function_exists( 'akismet_http_post' )){ ?> |
| 99 |
<tr><td colspan="2"><?php _e('Use Akismet to check entries for spam for', 'formidable') ?> |
| 100 |
<select name="options[akismet]"> |
| 101 |
<option value=""><?php _e('no one', 'formidable') ?></option> |
| 102 |
<option value="1" <?php selected($values['akismet'], 1)?>><?php _e('everyone', 'formidable') ?></option> |
| 103 |
<option value="logged" <?php selected($values['akismet'], 'logged')?>><?php _e('visitors who are not logged in', 'formidable') ?></option> |
| 104 |
</select> |
| 105 |
</td> |
| 106 |
</tr> |
| 107 |
<?php } ?> |
| 108 |
</table> |
| 109 |
</div> |
| 110 |
|
| 111 |
<?php |
| 112 |
$first_email = true; |
| 113 |
foreach($values['notification'] as $email_key => $notification){ |
| 114 |
include(FrmAppHelper::plugin_path() .'/classes/views/frm-forms/notification.php'); |
| 115 |
unset($email_key); |
| 116 |
unset($notification); |
| 117 |
$first_email = false; |
| 118 |
} |
| 119 |
if($frm_vars['pro_is_installed']){ ?> |
| 120 |
<div id="frm_email_add_button" class="notification_settings hide_with_tabs submit" style="display:<?php echo ($a == 'notification_settings') ? 'block' : 'none'; ?>;"> |
| 121 |
<a href="javascript:frmAddEmailList(<?php echo $values['id'] ?>)" class="button-secondary">+ <?php _e('Add Notification', 'formidable') ?></a></td> |
| 122 |
</div> |
| 123 |
<?php } ?> |
| 124 |
|
| 125 |
<div id="html_settings" class="tabs-panel" style="display:<?php echo ($a == 'html_settings') ? 'block' : 'none'; ?>;"> |
| 126 |
|
| 127 |
<div id="post-body-content" class="frm_top_container" style="margin-right:260px;"> |
| 128 |
<p><label class="frm_primary_label"><?php _e('Before Fields', 'formidable') ?></label> |
| 129 |
<textarea name="options[before_html]" rows="4" id="before_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['before_html']) ?></textarea></p> |
| 130 |
|
| 131 |
<div id="add_html_fields"> |
| 132 |
<?php |
| 133 |
if (isset($values['fields'])){ |
| 134 |
foreach($values['fields'] as $field){ |
| 135 |
if (apply_filters('frm_show_custom_html', true, $field['type'])){ ?> |
| 136 |
<p><label class="frm_primary_label"><?php echo $field['name'] ?></label> |
| 137 |
<textarea name="field_options[custom_html_<?php echo $field['id'] ?>]" rows="7" id="custom_html_<?php echo $field['id'] ?>" class="field_custom_html frm_long_input"><?php echo FrmAppHelper::esc_textarea($field['custom_html']) ?></textarea></p> |
| 138 |
<?php } |
| 139 |
unset($field); |
| 140 |
} |
| 141 |
} ?> |
| 142 |
</div> |
| 143 |
|
| 144 |
<p><label class="frm_primary_label"><?php _e('After Fields', 'formidable') ?></label> |
| 145 |
<textarea name="options[after_html]" rows="3" id="after_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['after_html']) ?></textarea></p> |
| 146 |
|
| 147 |
<p><label class="frm_primary_label"><?php _e('Submit Button', 'formidable') ?></label> |
| 148 |
<textarea name="options[submit_html]" rows="3" id="submit_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['submit_html']) ?></textarea></p> |
| 149 |
</div> |
| 150 |
</div> |
| 151 |
<div id="post_settings" class="tabs-panel" style="display:<?php echo ($a == 'post_settings') ? 'block' : 'none'; ?>;"> |
| 152 |
<?php if($frm_vars['pro_is_installed']) |
| 153 |
FrmProFormsController::post_options($values); |
| 154 |
else |
| 155 |
FrmAppController::update_message('create and edit posts, pages, and custom post types through your forms'); |
| 156 |
?> |
| 157 |
</div> |
| 158 |
|
| 159 |
<?php foreach($sections as $sec_name => $section){ ?> |
| 160 |
<div id="<?php echo $sec_name ?>_settings" class="tabs-panel" style="display:<?php echo ($a == $sec_name .'_settings') ? 'block' : 'none'; ?>;"><?php |
| 161 |
if(isset($section['class'])){ |
| 162 |
call_user_func(array($section['class'], $section['function']), $values); |
| 163 |
}else{ |
| 164 |
call_user_func((isset($section['function']) ? $section['function'] : $section), $values); |
| 165 |
} ?> |
| 166 |
</div> |
| 167 |
<?php } ?> |
| 168 |
|
| 169 |
<?php do_action('frm_add_form_option_section', $values); ?> |
| 170 |
<div class="clear"></div> |
| 171 |
</div> |
| 172 |
</div> |
| 173 |
</div> |
| 174 |
</div> |
| 175 |
</div> |
| 176 |
|
| 177 |
</div> |
| 178 |
|
| 179 |
<p> |
| 180 |
<input type="submit" value="<?php _e('Update', 'formidable') ?>" class="button-primary" /> |
| 181 |
<?php _e('or', 'formidable') ?> |
| 182 |
<a class="button-secondary cancel" href="<?php echo admin_url('admin.php?page=formidable') ?>&frm_action=edit&id=<?php echo $id ?>"><?php _e('Cancel', 'formidable') ?></a> |
| 183 |
</p> |
| 184 |
</form> |
| 185 |
|
| 186 |
|
| 187 |
</div> |
| 188 |
<?php |
| 189 |
if(version_compare( $GLOBALS['wp_version'], '3.3.2', '>')) |
| 190 |
require(FrmAppHelper::plugin_path() .'/classes/views/frm-forms/sidebar-settings.php'); |
| 191 |
?> |
| 192 |
</div> |
| 193 |
</div> |
| 194 |
</div> |
| 195 |
|