Formidable Forms – Form Builder for WordPress - Version 1.06.06

Version Description

  • Removed generic classes from input fields like "text" and "date"
  • Correctly jump down to form with error messages
  • Added frm_setup_new_entry hook for overriding defaults for all fields in one hook when presenting a blank form
  • Added "This field cannot be blank" message to global settings
  • Changed substr to mb_substr for language-safe truncation
  • WP 3.5 compatibility
  • Fixed conflict with W3TC that was adding slashes into options on the form settings page
  • Show a message on the form builder page if a reCaptcha is included in the form, but not set up
  • Switch from add_object_page to add_menu_page to prevent menu position conflicts
  • (Free only) Allow emails to be sent from the admin email instead of forcing an email address from the submitted entry
  • PRO: Added multiple-image upload
  • PRO: Added unlimited emails per form and conditional routing
  • PRO: Use the "customized content" box to save the actual content if no field is selected for the post content
  • PRO: Added frm-field-value shortcode to get the value of a field in another form. [frm-field-value field_id=25 user_id=current entry_id=140 ip=1]
  • PRO: Added frm-show-entry shortcode to show an entry in the same formats as the default email message. [frm-show-entry id=100 plain_text=1 user_info=1]
  • PRO: Added frm_set_get shortcode to artificially set $_GET values for use in custom displays or dynamic defaults values. [frm-set-get any_param="any value" another="value 2"] This can be fetched with [get param="any_param"] [get param="another"]
  • PRO: Extended conditional logic for displaying fields to include text, number, email, website, and time fields
  • PRO: Added support for the [frm-search] shortcode into the [formresults] table
  • PRO: Updated NicEdit
  • PRO: If http isn't included in a url or image field, automatically add it during validation
  • PRO: Added "wrap" parameter to the frm-graph shortcode to wrap the text in long questions
  • PRO: Added localization to custom display calendar to start on day of the week selected in WordPress settings
  • PRO: Added entry updated dates to custom display shortcodes
  • PRO: Correctly check uniqueness of post fields when there are no other error messages
  • PRO: If using a number field with the value "0" that is linked through a data from entries field, show 0 instead of nothing
  • PRO: Update for more accurate checking for hierarchal taxonomies when saving posts
  • PRO: Evaluate numbers as numeric instead of a string for conditional logic for hiding and showing fields
  • PRO: Fix to allow tags fields and other fields in the same form that are mapped to the same taxonomy
  • PRO: Fixed conditional logic to work correctly when dependent on the value "0"
  • PRO: Fixed display of shortcodes inside the before or after content areas of the custom display if nesting [get param=something]
  • PRO: Fixed calculations for multiple-paged calculations with checkbox fields that may not be checked
  • PRO: Fixed checkbox fields linked through another field to display properly in a custom display
  • PRO: Fixed separate values to work with sending to email addresses
  • PRO: Show a max of 500 options in a data from entries field in the admin to prevent server limits from making the form inaccessible
  • PRO: Make sure the graphs printed from the reports page are not split when printing
  • PRO: Fixed the link to show more text in the custom display to show the text in place or link to the single page correctly depending on the custom display type
  • PRO: Removed "just show it" data from entries fields in the email checkbox settings
  • PRO: Remove post custom fields from database if blank
  • PRO: Fixed frm-stats shortcode to work with post custom fields combined with the value parameter
  • PRO: Fixed div nesting issue when using collapsible section headings followed by non-collapsible sections headings
  • PRO: Removed separate values checkbox for post status and taxonomy fields
  • PRO: Fixed double filtering forms if inserted in the dynamic box of a custom display used for posts
  • PRO: Fixed page size and limit overriding single entry displays
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 1.06.06
Comparing to
See all releases

Code changes from version 1.06.05 to 1.06.06

Files changed (48) hide show
  1. classes/controllers/FrmAppController.php +53 -22
  2. classes/controllers/FrmFieldsController.php +1 -1
  3. classes/controllers/FrmFormsController.php +1 -1
  4. classes/controllers/FrmSettingsController.php +1 -9
  5. classes/helpers/FrmAppHelper.php +66 -17
  6. classes/helpers/FrmEntriesHelper.php +2 -1
  7. classes/helpers/FrmFieldsHelper.php +16 -8
  8. classes/helpers/FrmFormsHelper.php +20 -7
  9. classes/helpers/FrmListHelper.php +1 -1
  10. classes/models/FrmEntry.php +13 -7
  11. classes/models/FrmForm.php +17 -12
  12. classes/models/FrmNotification.php +36 -16
  13. classes/models/FrmSettings.php +7 -1
  14. classes/views/frm-entries/frm-entry.php +1 -1
  15. classes/views/frm-entries/list.php +1 -1
  16. classes/views/frm-forms/add_field.php +5 -1
  17. classes/views/frm-forms/add_field_links.php +60 -80
  18. classes/views/frm-forms/edit.php +1 -1
  19. classes/views/frm-forms/insert_form_popup.php +1 -1
  20. classes/views/frm-forms/list.php +0 -3
  21. classes/views/frm-forms/mb_insert_fields.php +64 -0
  22. classes/views/frm-forms/new-selection.php +0 -3
  23. classes/views/frm-forms/new.php +1 -1
  24. classes/views/frm-forms/notification.php +73 -0
  25. classes/views/frm-forms/settings.php +63 -109
  26. classes/views/frm-forms/sidebar-html.php +0 -25
  27. classes/views/frm-forms/translate.php +0 -1
  28. classes/views/frm-settings/form.php +14 -7
  29. classes/views/frm-statistics/list.php +0 -1
  30. classes/views/frm-statistics/list_displays.php +0 -1
  31. classes/views/shared/form-nav.php +3 -3
  32. classes/views/shared/mb_insert_fields.php +80 -0
  33. classes/views/shared/nav.php +1 -18
  34. css/frm_admin.css +42 -11
  35. formidable.php +4 -4
  36. js/formidable.js +11 -0
  37. js/formidable_admin.js +194 -33
  38. js/jquery/jquery.editinplace.js +2 -2
  39. js/jquery/jquery.editinplace.packed.js +2 -2
  40. languages/formidable-de_DE.mo +0 -0
  41. languages/formidable-de_DE.po +1290 -1236
  42. languages/formidable-en_US.po +1335 -1281
  43. languages/formidable-nl_NL.mo +0 -0
  44. languages/formidable-nl_NL.po +1343 -1289
  45. languages/formidable-pl_PL.mo +0 -0
  46. languages/formidable-pl_PL.po +1346 -1292
  47. languages/formidable-pt_BR.mo +0 -0
  48. languages/formidable-pt_BR.po +1315 -1283
classes/controllers/FrmAppController.php CHANGED
@@ -7,7 +7,6 @@ class FrmAppController{
7
  function FrmAppController(){
8
  add_action('admin_menu', array( &$this, 'menu' ), 1);
9
  add_action('admin_head', array(&$this, 'menu_css'));
10
- add_filter('frm_nav_array', array( &$this, 'frm_nav'), 1);
11
  add_filter('plugin_action_links_formidable/formidable.php', array( &$this, 'settings_link'), 10, 2 );
12
  add_action('after_plugin_row_formidable/formidable.php', array( &$this, 'pro_action_needed'));
13
  add_action('admin_notices', array( &$this, 'pro_get_started_headline'));
@@ -43,32 +42,30 @@ class FrmAppController{
43
  unset($frm_role_description);
44
  }
45
 
 
 
 
 
46
  if(current_user_can('frm_view_forms')){
47
  global $frm_forms_controller;
48
- add_object_page('Formidable', $frm_settings->menu, 'frm_view_forms', 'formidable', array($frm_forms_controller, 'route'), 'div');
49
  }elseif(current_user_can('frm_view_entries') and $frmpro_is_installed){
50
  global $frmpro_entries_controller;
51
- add_object_page('Formidable', $frm_settings->menu, 'frm_view_entries', 'formidable', array($frmpro_entries_controller, 'route'), 'div');
52
  }
53
  }
54
 
55
  function menu_css(){ ?>
56
- <style type="text/css">
57
- #adminmenu .toplevel_page_formidable div.wp-menu-image{background: url(<?php echo FRM_IMAGES_URL ?>/form_16.png) no-repeat center;}
58
- </style>
59
- <?php
60
  //#adminmenu .toplevel_page_formidable:hover div.wp-menu-image{background: url(<?php echo FRM_IMAGES_URL /icon_16.png) no-repeat center;}
61
  }
62
 
63
- function frm_nav($nav=array()){
64
- if(current_user_can('frm_view_forms')){
65
- $nav['formidable'] = __('Forms', 'formidable');
66
- $nav['formidable-templates'] = __('Templates', 'formidable');
67
- }
68
- return $nav;
69
- }
70
-
71
  function get_form_nav($id, $show_nav=false){
 
 
72
  $show_nav = FrmAppHelper::get_param('show_nav', $show_nav);
73
 
74
  if($show_nav)
@@ -111,9 +108,9 @@ class FrmAppController{
111
  global $frmpro_is_installed, $frm_db_version, $frm_ajax_url;
112
  $db_version = get_option('frm_db_version');
113
  $pro_db_version = ($frmpro_is_installed) ? get_option('frmpro_db_version') : false;
114
- if(((int)$db_version < (int)$frm_db_version) or ($frmpro_is_installed and (int)$pro_db_version < 15)){ //this number should match the db_version in FrmDb.php
115
  ?>
116
- <div class="error" id="frm_install_message" style="padding:7px;"><?php _e('Your Formidable database needs to be updated.<br/>Please deactivate and reactivate the plugin to fix this or', 'formidable'); ?> <a id="frm_install_link" href="javascript:frm_install_now()"><?php _e('Update Now', 'formidable') ?></a></div>
117
  <script type="text/javascript">
118
  function frm_install_now(){
119
  jQuery('#frm_install_link').replaceWith('<img src="<?php echo FRM_IMAGES_URL; ?>/wpspin_light.gif" alt="<?php _e('Loading...', 'formidable'); ?>" />');
@@ -136,23 +133,48 @@ success:function(msg){jQuery("#frm_install_message").fadeOut("slow");}
136
  }
137
 
138
  function admin_js(){
139
- global $frm_version;
140
  wp_enqueue_script('jquery');
141
  wp_enqueue_script('jquery-ui-core');
142
-
143
- if(isset($_GET) and isset($_GET['page']) and preg_match('/formidable*/', $_GET['page'])){
 
144
  wp_enqueue_script('jquery-ui-sortable');
145
  wp_enqueue_script('jquery-ui-draggable');
146
  wp_enqueue_script('admin-widgets');
147
  wp_enqueue_style('widgets');
148
  wp_enqueue_script('formidable_admin', FRM_URL . '/js/formidable_admin.js', array('jquery', 'jquery-ui-draggable'), $frm_version);
149
  wp_enqueue_script('formidable');
150
- wp_enqueue_style('formidable-admin', FRM_URL. '/css/frm_admin.css', $frm_version);
151
  wp_enqueue_script('jquery-elastic', FRM_URL.'/js/jquery/jquery.elastic.js', array('jquery'));
152
  add_thickbox();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
  }
155
 
 
 
 
 
 
 
 
 
156
  function front_head(){
157
  global $frm_settings, $frm_version, $frm_db_version;
158
 
@@ -161,7 +183,7 @@ success:function(msg){jQuery("#frm_install_message").fadeOut("slow");}
161
  //$frm_db_version is the version of the database we're moving to
162
  $old_db_version = get_option('frm_db_version');
163
  $pro_db_version = ($frmpro_is_installed) ? get_option('frmpro_db_version') : false;
164
- if(((int)$old_db_version < (int)$frm_db_version) or ($frmpro_is_installed and (int)$pro_db_version < 15))
165
  $this->install($old_db_version);
166
  }
167
 
@@ -324,6 +346,15 @@ success:function(msg){jQuery("#frm_install_message").fadeOut("slow");}
324
 
325
  //formidable shortcode
326
  function get_form_shortcode($atts){
 
 
 
 
 
 
 
 
 
327
  global $frm_entries_controller;
328
  extract(shortcode_atts(array('id' => '', 'key' => '', 'title' => false, 'description' => false, 'readonly' => false, 'entry_id' => false, 'fields' => array()), $atts));
329
  do_action('formidable_shortcode_atts', compact('id', 'key', 'title', 'description', 'readonly', 'entry_id', 'fields'));
7
  function FrmAppController(){
8
  add_action('admin_menu', array( &$this, 'menu' ), 1);
9
  add_action('admin_head', array(&$this, 'menu_css'));
 
10
  add_filter('plugin_action_links_formidable/formidable.php', array( &$this, 'settings_link'), 10, 2 );
11
  add_action('after_plugin_row_formidable/formidable.php', array( &$this, 'pro_action_needed'));
12
  add_action('admin_notices', array( &$this, 'pro_get_started_headline'));
42
  unset($frm_role_description);
43
  }
44
 
45
+ $count = count(get_post_types( array( 'show_ui' => true, '_builtin' => false, 'show_in_menu' => true ) ));
46
+ $pos = ((int)$count > 0) ? 22.7 : 29.3;
47
+ $pos = apply_filters('frm_menu_position', $pos);
48
+
49
  if(current_user_can('frm_view_forms')){
50
  global $frm_forms_controller;
51
+ add_menu_page('Formidable', $frm_settings->menu, 'frm_view_forms', 'formidable', array($frm_forms_controller, 'route'), 'div', $pos);
52
  }elseif(current_user_can('frm_view_entries') and $frmpro_is_installed){
53
  global $frmpro_entries_controller;
54
+ add_menu_page('Formidable', $frm_settings->menu, 'frm_view_entries', 'formidable', array($frmpro_entries_controller, 'route'), 'div', $pos);
55
  }
56
  }
57
 
58
  function menu_css(){ ?>
59
+ <style type="text/css">
60
+ #adminmenu .toplevel_page_formidable div.wp-menu-image{background: url(<?php echo FRM_IMAGES_URL ?>/form_16.png) no-repeat center;}
61
+ </style>
62
+ <?php
63
  //#adminmenu .toplevel_page_formidable:hover div.wp-menu-image{background: url(<?php echo FRM_IMAGES_URL /icon_16.png) no-repeat center;}
64
  }
65
 
 
 
 
 
 
 
 
 
66
  function get_form_nav($id, $show_nav=false){
67
+ global $pagenow;
68
+
69
  $show_nav = FrmAppHelper::get_param('show_nav', $show_nav);
70
 
71
  if($show_nav)
108
  global $frmpro_is_installed, $frm_db_version, $frm_ajax_url;
109
  $db_version = get_option('frm_db_version');
110
  $pro_db_version = ($frmpro_is_installed) ? get_option('frmpro_db_version') : false;
111
+ if(((int)$db_version < (int)$frm_db_version) or ($frmpro_is_installed and (int)$pro_db_version < 16)){ //this number should match the db_version in FrmDb.php
112
  ?>
113
+ <div class="error" id="frm_install_message" style="padding:7px;"><?php _e('Your Formidable database needs to be updated.<br/>Please deactivate and reactivate the plugin to fix this or', 'formidable'); ?> <a id="frm_install_link" href="#" onclick="frm_install_now();return false;"><?php _e('Update Now', 'formidable') ?></a></div>
114
  <script type="text/javascript">
115
  function frm_install_now(){
116
  jQuery('#frm_install_link').replaceWith('<img src="<?php echo FRM_IMAGES_URL; ?>/wpspin_light.gif" alt="<?php _e('Loading...', 'formidable'); ?>" />');
133
  }
134
 
135
  function admin_js(){
136
+ global $frm_version, $pagenow;
137
  wp_enqueue_script('jquery');
138
  wp_enqueue_script('jquery-ui-core');
139
+
140
+ if(isset($_GET) and (isset($_GET['page']) and preg_match('/formidable*/', $_GET['page'])) or ($pagenow == 'edit.php' and isset($_GET) and isset($_GET['post_type']) and $_GET['post_type'] == 'frm_display')){
141
+ add_filter('admin_body_class', array(&$this, 'admin_body_class'));
142
  wp_enqueue_script('jquery-ui-sortable');
143
  wp_enqueue_script('jquery-ui-draggable');
144
  wp_enqueue_script('admin-widgets');
145
  wp_enqueue_style('widgets');
146
  wp_enqueue_script('formidable_admin', FRM_URL . '/js/formidable_admin.js', array('jquery', 'jquery-ui-draggable'), $frm_version);
147
  wp_enqueue_script('formidable');
148
+ wp_enqueue_style('formidable-admin', FRM_URL. '/css/frm_admin.css', array(), $frm_version);
149
  wp_enqueue_script('jquery-elastic', FRM_URL.'/js/jquery/jquery.elastic.js', array('jquery'));
150
  add_thickbox();
151
+ }else if($pagenow == 'post.php' or ($pagenow == 'post-new.php' and $_REQUEST['post_type'] == 'frm_display')){
152
+ if(isset($_REQUEST['post_type'])){
153
+ $post_type = $_REQUEST['post_type'];
154
+ }else if(isset($_REQUEST['post'])){
155
+ $post = get_post($_REQUEST['post']);
156
+ $post_type = $post->post_type;
157
+ }else{
158
+ return;
159
+ }
160
+
161
+ if($post_type == 'frm_display'){
162
+ wp_enqueue_script('jquery-ui-draggable');
163
+ wp_enqueue_script('formidable_admin', FRM_URL . '/js/formidable_admin.js', array('jquery', 'jquery-ui-draggable'), $frm_version);
164
+ wp_enqueue_script('jquery-elastic', FRM_URL.'/js/jquery/jquery.elastic.js', array('jquery'));
165
+ wp_enqueue_style('formidable-admin', FRM_URL. '/css/frm_admin.css', array(), $frm_version);
166
+ }
167
  }
168
  }
169
 
170
+ function admin_body_class($classes){
171
+ global $wp_version;
172
+ if(version_compare( $wp_version, '3.4.9', '>'))
173
+ $classes .= ' frm_35_trigger';
174
+
175
+ return $classes;
176
+ }
177
+
178
  function front_head(){
179
  global $frm_settings, $frm_version, $frm_db_version;
180
 
183
  //$frm_db_version is the version of the database we're moving to
184
  $old_db_version = get_option('frm_db_version');
185
  $pro_db_version = ($frmpro_is_installed) ? get_option('frmpro_db_version') : false;
186
+ if(((int)$old_db_version < (int)$frm_db_version) or ($frmpro_is_installed and (int)$pro_db_version < 16))
187
  $this->install($old_db_version);
188
  }
189
 
346
 
347
  //formidable shortcode
348
  function get_form_shortcode($atts){
349
+ global $frm_skip_shortcode;
350
+ if($frm_skip_shortcode){
351
+ $frm_skip_shortcode = false;
352
+ $sc = '[formidable';
353
+ foreach($atts as $k => $v)
354
+ $sc .= ' '. $k .'="'. $v .'"';
355
+ return $sc .']';
356
+ }
357
+
358
  global $frm_entries_controller;
359
  extract(shortcode_atts(array('id' => '', 'key' => '', 'title' => false, 'description' => false, 'readonly' => false, 'entry_id' => false, 'fields' => array()), $atts));
360
  do_action('formidable_shortcode_atts', compact('id', 'key', 'title', 'description', 'readonly', 'entry_id', 'fields'));
classes/controllers/FrmFieldsController.php CHANGED
@@ -359,7 +359,7 @@ class FrmFieldsController{
359
  function input_html($field, $echo=true){
360
  global $frm_settings;
361
 
362
- $class = $field['type'];
363
  $add_html = '';
364
 
365
  if(isset($field['size']) and $field['size'] > 0){
359
  function input_html($field, $echo=true){
360
  global $frm_settings;
361
 
362
+ $class = ''; //$field['type'];
363
  $add_html = '';
364
 
365
  if(isset($field['size']) and $field['size'] > 0){
classes/controllers/FrmFormsController.php CHANGED
@@ -257,7 +257,7 @@ class FrmFormsController{
257
  if(in_array($page, array('post.php', 'page.php', 'page-new.php', 'post-new.php')) or (isset($_GET) and isset($_GET['page']) and $_GET['page'] == 'formidable-entry-templates')){
258
  if(class_exists('FrmProDisplay')){
259
  global $frmpro_display;
260
- $displays = $frmpro_display->getAll('', ' ORDER BY name');
261
  }
262
  require(FRM_VIEWS_PATH.'/frm-forms/insert_form_popup.php');
263
  }
257
  if(in_array($page, array('post.php', 'page.php', 'page-new.php', 'post-new.php')) or (isset($_GET) and isset($_GET['page']) and $_GET['page'] == 'formidable-entry-templates')){
258
  if(class_exists('FrmProDisplay')){
259
  global $frmpro_display;
260
+ $displays = $frmpro_display->getAll('', 'post_title');
261
  }
262
  require(FRM_VIEWS_PATH.'/frm-forms/insert_form_popup.php');
263
  }
classes/controllers/FrmSettingsController.php CHANGED
@@ -6,18 +6,10 @@
6
  class FrmSettingsController{
7
  function FrmSettingsController(){
8
  add_action('admin_menu', array( &$this, 'menu' ), 26);
9
- add_filter('frm_nav_array', array( &$this, 'frm_nav'), 30);
10
  }
11
 
12
  function menu(){
13
- add_submenu_page('formidable', 'Formidable | '. __('Settings', 'formidable'), __('Settings', 'formidable'), 'frm_change_settings', 'formidable-settings', array(&$this, 'route'));
14
- }
15
-
16
- function frm_nav($nav=array()){
17
- if(current_user_can('frm_change_settings'))
18
- $nav['formidable-settings'] = __('Settings', 'formidable');
19
-
20
- return $nav;
21
  }
22
 
23
  function display_form(){
6
  class FrmSettingsController{
7
  function FrmSettingsController(){
8
  add_action('admin_menu', array( &$this, 'menu' ), 26);
 
9
  }
10
 
11
  function menu(){
12
+ add_submenu_page('formidable', 'Formidable | '. __('Global Settings', 'formidable'), __('Global Settings', 'formidable'), 'frm_change_settings', 'formidable-settings', array(&$this, 'route'));
 
 
 
 
 
 
 
13
  }
14
 
15
  function display_form(){
classes/helpers/FrmAppHelper.php CHANGED
@@ -20,7 +20,7 @@ class FrmAppHelper{
20
  }
21
  }
22
 
23
- return $value;
24
  }
25
 
26
  function get_post_param($param, $default=''){
@@ -107,7 +107,7 @@ class FrmAppHelper{
107
  // $current = (isset($current['value'])) ? $current['value'] : $current['label'];
108
 
109
  if(is_array($values))
110
- $values = array_map('trim', $values);
111
  else
112
  $values = trim($values);
113
  $current = trim($current);
@@ -127,6 +127,15 @@ class FrmAppHelper{
127
  return false;
128
  }
129
 
 
 
 
 
 
 
 
 
 
130
  function esc_textarea( $text ) {
131
  $safe_text = str_replace('&quot;', '"', $text);
132
  $safe_text = htmlspecialchars( $safe_text, ENT_NOQUOTES );
@@ -262,7 +271,7 @@ class FrmAppHelper{
262
  foreach ($opt_defaults as $opt => $default_opt){
263
  $field_array[$opt] = ($_POST and isset($_POST['field_options'][$opt.'_'.$field->id]) ) ? $_POST['field_options'][$opt.'_'.$field->id] : (isset($field->field_options[$opt]) ? $field->field_options[$opt] : $default_opt);
264
  if($opt == 'blank' and $field_array[$opt] == ''){
265
- $field_array[$opt] = __('This field cannot be blank', 'formidable');
266
  }else if($opt == 'invalid' and $field_array[$opt] == ''){
267
  if($field_type == 'captcha')
268
  $field_array[$opt] = $frm_settings->re_msg;
@@ -291,20 +300,36 @@ class FrmAppHelper{
291
 
292
  if ($form){
293
  $form->options = maybe_unserialize($form->options);
294
- $values['form_name'] = (isset($record->form_id))?($form->name):('');
295
  if (is_array($form->options)){
296
- foreach ($form->options as $opt => $value)
 
 
 
297
  $values[$opt] = FrmAppHelper::get_param($opt, $value);
 
298
  }
299
  }
300
 
301
  $form_defaults = FrmFormsHelper::get_default_opts();
302
- $form_defaults['email_to'] = ''; //allow blank email address
303
 
304
  //set to posted value or default
305
  foreach ($form_defaults as $opt => $default){
306
- if (!isset($values[$opt]) or $values[$opt] == '')
307
- $values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  unset($opt);
309
  unset($defaut);
310
  }
@@ -316,7 +341,7 @@ class FrmAppHelper{
316
  $values['before_html'] = (isset($_POST['options']['before_html']) ? $_POST['options']['before_html'] : FrmFormsHelper::get_default_html('before'));
317
 
318
  if (!isset($values['after_html']))
319
- $values['after_html'] = (isset($_POST['options']['after_html'])?$_POST['options']['after_html'] : FrmFormsHelper::get_default_html('after'));
320
 
321
  if ($table == 'entries')
322
  $values = FrmEntriesHelper::setup_edit_vars( $values, $record );
@@ -326,6 +351,22 @@ class FrmAppHelper{
326
  return $values;
327
  }
328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  function get_us_states(){
330
  return apply_filters('frm_us_states', array(
331
  'AL' => 'Alabama', 'AK' => 'Alaska', 'AR' => 'Arkansas', 'AZ' => 'Arizona',
@@ -426,10 +467,12 @@ class FrmAppHelper{
426
 
427
  if($frmpro_is_installed)
428
  return $message;
429
-
 
 
430
  include_once(ABSPATH.'/wp-includes/class-IXR.php');
431
 
432
- $url = ($frmpro_is_installed) ? 'http://formidablepro.com/' : 'http://blog.strategy11.com/';
433
  $client = new IXR_Client($url.'xmlrpc.php', false, 80, 5);
434
 
435
  if ($client->query('frm.get_main_message'))
@@ -445,21 +488,27 @@ class FrmAppHelper{
445
  if($length == 0)
446
  return '';
447
  else if($length <= 10)
448
- return substr($str, 0, $length);
449
 
450
  $sub = '';
451
  $len = 0;
452
 
453
- foreach (explode(' ', $str) as $word){
 
 
454
  $part = (($sub != '') ? ' ' : '') . $word;
455
  $sub .= $part;
456
- $len += strlen($part);
457
-
458
- if (strlen($word) > $minword && strlen($sub) >= $length)
 
459
  break;
 
 
460
  }
461
 
462
- return $sub . (($len < strlen($str)) ? $continue : '');
 
463
  }
464
 
465
  function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ){
20
  }
21
  }
22
 
23
+ return stripslashes_deep($value);
24
  }
25
 
26
  function get_post_param($param, $default=''){
107
  // $current = (isset($current['value'])) ? $current['value'] : $current['label'];
108
 
109
  if(is_array($values))
110
+ $values = array_map(array('FrmAppHelper', 'recursive_trim'), $values);
111
  else
112
  $values = trim($values);
113
  $current = trim($current);
127
  return false;
128
  }
129
 
130
+ function recursive_trim(&$value) {
131
+ if (is_array($value))
132
+ $value = array_map(array('FrmAppHelper', 'recursive_trim'), $value);
133
+ else
134
+ $value = trim($value);
135
+
136
+ return $value;
137
+ }
138
+
139
  function esc_textarea( $text ) {
140
  $safe_text = str_replace('&quot;', '"', $text);
141
  $safe_text = htmlspecialchars( $safe_text, ENT_NOQUOTES );
271
  foreach ($opt_defaults as $opt => $default_opt){
272
  $field_array[$opt] = ($_POST and isset($_POST['field_options'][$opt.'_'.$field->id]) ) ? $_POST['field_options'][$opt.'_'.$field->id] : (isset($field->field_options[$opt]) ? $field->field_options[$opt] : $default_opt);
273
  if($opt == 'blank' and $field_array[$opt] == ''){
274
+ $field_array[$opt] = $frm_settings->blank_msg;
275
  }else if($opt == 'invalid' and $field_array[$opt] == ''){
276
  if($field_type == 'captcha')
277
  $field_array[$opt] = $frm_settings->re_msg;
300
 
301
  if ($form){
302
  $form->options = maybe_unserialize($form->options);
303
+ $values['form_name'] = (isset($record->form_id)) ? $form->name : '';
304
  if (is_array($form->options)){
305
+ foreach ($form->options as $opt => $value){
306
+ if(in_array($opt, array('email_to', 'reply_to', 'reply_to_name')))
307
+ $values['notification'][0][$opt] = FrmAppHelper::get_param('notification[0]['. $opt .']', $value);
308
+
309
  $values[$opt] = FrmAppHelper::get_param($opt, $value);
310
+ }
311
  }
312
  }
313
 
314
  $form_defaults = FrmFormsHelper::get_default_opts();
 
315
 
316
  //set to posted value or default
317
  foreach ($form_defaults as $opt => $default){
318
+ if (!isset($values[$opt]) or $values[$opt] == ''){
319
+ if($opt == 'notification'){
320
+ $values[$opt] = ($_POST and isset($_POST[$opt])) ? $_POST[$opt] : $default;
321
+
322
+ foreach($default as $o => $d){
323
+ if($o == 'email_to')
324
+ $d = ''; //allow blank email address
325
+ $values[$opt][0][$o] = ($_POST and isset($_POST[$opt][0][$o])) ? $_POST[$opt][0][$o] : $d;
326
+ unset($o);
327
+ unset($d);
328
+ }
329
+ }else{
330
+ $values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
331
+ }
332
+ }
333
  unset($opt);
334
  unset($defaut);
335
  }
341
  $values['before_html'] = (isset($_POST['options']['before_html']) ? $_POST['options']['before_html'] : FrmFormsHelper::get_default_html('before'));
342
 
343
  if (!isset($values['after_html']))
344
+ $values['after_html'] = (isset($_POST['options']['after_html']) ? $_POST['options']['after_html'] : FrmFormsHelper::get_default_html('after'));
345
 
346
  if ($table == 'entries')
347
  $values = FrmEntriesHelper::setup_edit_vars( $values, $record );
351
  return $values;
352
  }
353
 
354
+ function insert_opt_html($args){
355
+ extract($args);
356
+
357
+ $class = '';
358
+
359
+ if(in_array($type, array('email', 'user_id', 'hidden', 'select', 'radio', 'checkbox')))
360
+ $class .= 'show_frm_not_email_to';
361
+ ?>
362
+ <li>
363
+ <a class="frmids alignright <?php echo $class ?>" onclick="frmInsertFieldCode(jQuery(this),'<?php echo $id ?>');return false;" href="#">[<?php echo $id ?>]</a>
364
+ <a class="frmkeys alignright <?php echo $class ?>" onclick="frmInsertFieldCode(jQuery(this),'<?php echo $key ?>');return false;" href="#">[<?php echo FrmAppHelper::truncate($key, 10) ?>]</a>
365
+ <a class="<?php echo $class ?>" onclick="frmInsertFieldCode(jQuery(this),'<?php echo $id ?>');return false;" href="#"><?php echo FrmAppHelper::truncate($name, 60) ?></a>
366
+ </li>
367
+ <?php
368
+ }
369
+
370
  function get_us_states(){
371
  return apply_filters('frm_us_states', array(
372
  'AL' => 'Alabama', 'AK' => 'Alaska', 'AR' => 'Arkansas', 'AZ' => 'Arizona',
467
 
468
  if($frmpro_is_installed)
469
  return $message;
470
+
471
+ global $frm_update;
472
+
473
  include_once(ABSPATH.'/wp-includes/class-IXR.php');
474
 
475
+ $url = ($frmpro_is_installed or $frm_update->pro_is_authorized()) ? 'http://formidablepro.com/' : 'http://blog.strategy11.com/';
476
  $client = new IXR_Client($url.'xmlrpc.php', false, 80, 5);
477
 
478
  if ($client->query('frm.get_main_message'))
488
  if($length == 0)
489
  return '';
490
  else if($length <= 10)
491
+ return (function_exists('mb_substr')) ? mb_substr($str, 0, $length) : substr($str, 0, $length);
492
 
493
  $sub = '';
494
  $len = 0;
495
 
496
+ $words = (function_exists('mb_split')) ? mb_split(' ', $str) : explode(' ', $str);
497
+
498
+ foreach ($words as $word){
499
  $part = (($sub != '') ? ' ' : '') . $word;
500
  $sub .= $part;
501
+ $len += (function_exists('mb_strlen')) ? mb_strlen($part) : strlen($part);
502
+ $total_len = (function_exists('mb_strlen')) ? mb_strlen($sub) : strlen($sub);
503
+
504
+ if (str_word_count($sub) > $minword && $total_len >= $length)
505
  break;
506
+
507
+ unset($total_len);
508
  }
509
 
510
+ $original_len = (function_exists('mb_strlen')) ? mb_strlen($str) : strlen($str);
511
+ return $sub . (($len < $original_len) ? $continue : '');
512
  }
513
 
514
  function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ){
classes/helpers/FrmEntriesHelper.php CHANGED
@@ -105,7 +105,8 @@ class FrmEntriesHelper{
105
  if (!isset($values['after_html']))
106
  $values['after_html'] = FrmFormsHelper::get_default_html('after');
107
  }
108
- return $values;
 
109
  }
110
 
111
  function setup_edit_vars($values, $record){
105
  if (!isset($values['after_html']))
106
  $values['after_html'] = FrmFormsHelper::get_default_html('after');
107
  }
108
+
109
+ return apply_filters('frm_setup_new_entry', $values);
110
  }
111
 
112
  function setup_edit_vars($values, $record){
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -138,7 +138,7 @@ class FrmFieldsHelper{
138
  'name' => __('Untitled', 'formidable'), 'description' => '',
139
  'field_key' => $key, 'type' => $type, 'options'=>'', 'default_value'=>'',
140
  'field_order' => $field_count+1, 'required' => false,
141
- 'blank' => __('This field cannot be blank', 'formidable'),
142
  'invalid' => __('This field is invalid', 'formidable'), 'form_id' => $form_id,
143
  'field_options' => $field_options
144
  );
@@ -154,9 +154,10 @@ class FrmFieldsHelper{
154
 
155
  function get_default_html($type='text'){
156
  if (apply_filters('frm_normal_field_type_html', true, $type)){
 
157
  $default_html = <<<DEFAULT_HTML
158
  <div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
159
- <label class="frm_primary_label">[field_name]
160
  <span class="frm_required">[required_label]</span>
161
  </label>
162
  [input]
@@ -271,9 +272,11 @@ DEFAULT_HTML;
271
 
272
  if(!function_exists('recaptcha_get_html'))
273
  require_once(FRM_PATH.'/classes/recaptchalib.php');
 
 
274
  ?>
275
- <script type="text/javascript">var RecaptchaOptions={theme:'<?php echo $frm_settings->re_theme ?>',lang:'<?php echo apply_filters('frm_recaptcha_lang', $frm_settings->re_lang, $field) ?>'<?php echo apply_filters('frm_recaptcha_custom', '', $field) ?>};</script>
276
- <?php echo recaptcha_get_html($frm_settings->pubkey, $error, is_ssl()) ?>
277
  <?php
278
  }
279
 
@@ -287,12 +290,17 @@ DEFAULT_HTML;
287
  if(!$name) $name = "item_meta[$field[id]]";
288
  $id = 'field_'. $field['field_key'];
289
  $class = $field['type'];
290
-
291
- $selected = is_array($field['value']) ? reset($field['value']) : $field['value'];
292
 
293
  $exclude = (is_array($field['exclude_cat'])) ? implode(',', $field['exclude_cat']) : $field['exclude_cat'];
294
  $exclude = apply_filters('frm_exclude_cats', $exclude, $field);
295
 
 
 
 
 
 
 
 
296
 
297
  $args = array(
298
  'show_option_all' => ' ', 'hierarchical' => 1, 'name' => $name,
@@ -321,12 +329,12 @@ DEFAULT_HTML;
321
  }
322
 
323
  function show_onfocus_js($field_id, $clear_on_focus){ ?>
324
- <a href="javascript:frm_clear_on_focus(<?php echo $field_id; ?>,<?php echo $clear_on_focus; ?>)" class="<?php echo ($clear_on_focus) ?'':'frm_inactive_icon '; ?>frm_default_val_icons frm_action_icon frm_reload_icon" id="clear_field_<?php echo $field_id; ?>" title="<?php printf(__('Set this field to %1$sclear on click', 'formidable'), ($clear_on_focus) ? __('not', 'formidable').' ' :'' ); ?>"></a>
325
  <?php
326
  }
327
 
328
  function show_default_blank_js($field_id, $default_blank){ ?>
329
- <a href="javascript:frm_default_blank(<?php echo $field_id; ?>,<?php echo $default_blank ?>)" class="<?php echo ($default_blank) ?'':'frm_inactive_icon '; ?>frm_default_val_icons frm_action_icon frm_error_icon" id="default_blank_<?php echo $field_id; ?>" title="<?php printf(__('This default value should %1$sbe considered blank', 'formidable'), ($default_blank) ? __('not', 'formidable').' ' :'' ); ?>"></a>
330
  <?php
331
  }
332
 
138
  'name' => __('Untitled', 'formidable'), 'description' => '',
139
  'field_key' => $key, 'type' => $type, 'options'=>'', 'default_value'=>'',
140
  'field_order' => $field_count+1, 'required' => false,
141
+ 'blank' => $frm_settings->blank_msg,
142
  'invalid' => __('This field is invalid', 'formidable'), 'form_id' => $form_id,
143
  'field_options' => $field_options
144
  );
154
 
155
  function get_default_html($type='text'){
156
  if (apply_filters('frm_normal_field_type_html', true, $type)){
157
+ $for = (in_array($type, array('radio', 'checkbox', 'data'))) ? '' : 'for="field_[key]"';
158
  $default_html = <<<DEFAULT_HTML
159
  <div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
160
+ <label $for class="frm_primary_label">[field_name]
161
  <span class="frm_required">[required_label]</span>
162
  </label>
163
  [input]
272
 
273
  if(!function_exists('recaptcha_get_html'))
274
  require_once(FRM_PATH.'/classes/recaptchalib.php');
275
+
276
+ $lang = apply_filters('frm_recaptcha_lang', $frm_settings->re_lang, $field);
277
  ?>
278
+ <script type="text/javascript">var RecaptchaOptions={theme:'<?php echo $frm_settings->re_theme ?>',lang:'<?php echo $lang ?>'<?php echo apply_filters('frm_recaptcha_custom', '', $field) ?>};</script>
279
+ <?php echo recaptcha_get_html($frm_settings->pubkey .'&hl='. $lang, $error, is_ssl()) ?>
280
  <?php
281
  }
282
 
290
  if(!$name) $name = "item_meta[$field[id]]";
291
  $id = 'field_'. $field['field_key'];
292
  $class = $field['type'];
 
 
293
 
294
  $exclude = (is_array($field['exclude_cat'])) ? implode(',', $field['exclude_cat']) : $field['exclude_cat'];
295
  $exclude = apply_filters('frm_exclude_cats', $exclude, $field);
296
 
297
+ if(is_array($field['value'])){
298
+ if(!empty($exclude))
299
+ $field['value'] = array_diff($field['value'], explode(',', $exclude));
300
+ $selected = reset($field['value']);
301
+ }else{
302
+ $selected = $field['value'];
303
+ }
304
 
305
  $args = array(
306
  'show_option_all' => ' ', 'hierarchical' => 1, 'name' => $name,
329
  }
330
 
331
  function show_onfocus_js($field_id, $clear_on_focus){ ?>
332
+ <a href="javascript:frm_clear_on_focus(<?php echo $field_id; ?>,<?php echo $clear_on_focus; ?>)" class="<?php echo ($clear_on_focus) ?'':'frm_inactive_icon '; ?>frm_default_val_icons frm_action_icon frm_reload_icon" id="clear_field_<?php echo $field_id; ?>" title="<?php printf(__('%1$sclear default value when field is clicked', 'formidable'), ($clear_on_focus) ? '': __('Do not', 'formidable').' ' ); ?>"></a>
333
  <?php
334
  }
335
 
336
  function show_default_blank_js($field_id, $default_blank){ ?>
337
+ <a href="javascript:frm_default_blank(<?php echo $field_id; ?>,<?php echo $default_blank ?>)" class="<?php echo ($default_blank) ?'':'frm_inactive_icon '; ?>frm_default_val_icons frm_action_icon frm_error_icon" id="default_blank_<?php echo $field_id; ?>" title="<?php printf(__('Default value will %1$spass form validation', 'formidable'), ($default_blank) ? __('not', 'formidable').' ' :'' ); ?>"></a>
338
  <?php
339
  }
340
 
classes/helpers/FrmFormsHelper.php CHANGED
@@ -60,10 +60,23 @@ class FrmFormsHelper{
60
  $values['form_key'] = ($_POST and isset($_POST['form_key'])) ? $_POST['form_key'] : (FrmAppHelper::get_unique_key('', $frmdb->forms, 'form_key'));
61
 
62
  $defaults = FrmFormsHelper::get_default_opts();
63
- foreach ($defaults as $var => $default)
64
- $values[$var] = ($_POST and isset($_POST['options'][$var])) ? $_POST['options'][$var] : $default;
 
 
 
 
 
 
 
 
 
65
 
66
- $values['custom_style'] = ($_POST and isset($_POST['options']['custom_style'])) ? $_POST['options']['custom_style'] : ($frm_settings->load_style != 'none');
 
 
 
 
67
  $values['before_html'] = FrmFormsHelper::get_default_html('before');
68
  $values['after_html'] = FrmFormsHelper::get_default_html('after');
69
 
@@ -84,7 +97,10 @@ class FrmFormsHelper{
84
  global $frm_settings;
85
 
86
  return array(
87
- 'email_to' => $frm_settings->email_to, 'reply_to' => '', 'reply_to_name' => '',
 
 
 
88
  'submit_value' => $frm_settings->submit_value, 'success_action' => 'message',
89
  'success_msg' => $frm_settings->success_msg, 'show_form' => 0, 'akismet' => '',
90
  'no_save' => 0
@@ -128,9 +144,6 @@ BEFORE_HTML;
128
  //replace [form_key]
129
  $html = str_replace('[form_key]', $form->form_key, $html);
130
 
131
- if(class_exists('FrmProEntriesController'))
132
- $html = str_replace('[deletelink]', FrmProEntriesController::entry_delete_link(array()), $html);
133
-
134
  return apply_filters('frm_form_replace_shortcodes', stripslashes($html), $form);
135
  }
136
 
60
  $values['form_key'] = ($_POST and isset($_POST['form_key'])) ? $_POST['form_key'] : (FrmAppHelper::get_unique_key('', $frmdb->forms, 'form_key'));
61
 
62
  $defaults = FrmFormsHelper::get_default_opts();
63
+ foreach ($defaults as $var => $default){
64
+ if($var == 'notification'){
65
+ $values[$var] = array();
66
+ foreach($default as $k => $v){
67
+ $values[$var][$k] = (isset($_POST) and $_POST and isset($_POST['notification'][$var])) ? $_POST['notification'][$var] : $v;
68
+ unset($k);
69
+ unset($v);
70
+ }
71
+ }else{
72
+ $values[$var] = (isset($_POST) and $_POST and isset($_POST['options'][$var])) ? $_POST['options'][$var] : $default;
73
+ }
74
 
75
+ unset($var);
76
+ unset($default);
77
+ }
78
+
79
+ $values['custom_style'] = (isset($_POST) and $_POST and isset($_POST['options']['custom_style'])) ? $_POST['options']['custom_style'] : ($frm_settings->load_style != 'none');
80
  $values['before_html'] = FrmFormsHelper::get_default_html('before');
81
  $values['after_html'] = FrmFormsHelper::get_default_html('after');
82
 
97
  global $frm_settings;
98
 
99
  return array(
100
+ 'notification' => array(
101
+ array('email_to' => $frm_settings->email_to, 'reply_to' => '', 'reply_to_name' => '',
102
+ 'cust_reply_to' => '', 'cust_reply_to_name' => '')
103
+ ),
104
  'submit_value' => $frm_settings->submit_value, 'success_action' => 'message',
105
  'success_msg' => $frm_settings->success_msg, 'show_form' => 0, 'akismet' => '',
106
  'no_save' => 0
144
  //replace [form_key]
145
  $html = str_replace('[form_key]', $form->form_key, $html);
146
 
 
 
 
147
  return apply_filters('frm_form_replace_shortcodes', stripslashes($html), $form);
148
  }
149
 
classes/helpers/FrmListHelper.php CHANGED
@@ -205,7 +205,7 @@ class FrmListHelper extends WP_List_Table {
205
  break;
206
  case 'name':
207
  case 'description':
208
- $val = FrmAppHelper::truncate(strip_tags(stripslashes($item->{$column_name})), 100);
209
  break;
210
  case 'created_at':
211
  $format = 'Y/m/d'; //get_option('date_format');
205
  break;
206
  case 'name':
207
  case 'description':
208
+ $val = FrmAppHelper::truncate(strip_tags(stripslashes($item->{$column_name})), 50);
209
  break;
210
  case 'created_at':
211
  $format = 'Y/m/d'; //get_option('date_format');
classes/models/FrmEntry.php CHANGED
@@ -7,6 +7,8 @@ class FrmEntry{
7
  $new_values = array();
8
  $new_values['item_key'] = FrmAppHelper::get_unique_key($values['item_key'], $frmdb->entries, 'item_key');
9
  $new_values['name'] = isset($values['name']) ? $values['name'] : $values['item_key'];
 
 
10
  $new_values['ip'] = $_SERVER['REMOTE_ADDR'];
11
 
12
  if(isset($values['description']) and !empty($values['description'])){
@@ -96,7 +98,7 @@ class FrmEntry{
96
  $new_values['name'] = $values->name;
97
  $new_values['user_id'] = $new_values['updated_by'] = $values->user_id;
98
  $new_values['form_id'] = ($values->form_id)?(int)$values->form_id: null;
99
- $new_values['created_at'] = current_time('mysql', 1);
100
 
101
  $query_results = $wpdb->insert( $frmdb->entries, $new_values );
102
  if($query_results){
@@ -311,7 +313,7 @@ class FrmEntry{
311
  }
312
 
313
  function validate( $values, $exclude=false ){
314
- global $wpdb, $frmdb, $frm_field, $frm_entry_meta;
315
 
316
  $errors = array();
317
  if(!isset($values['form_id']) or !isset($values['item_meta'])){
@@ -335,13 +337,16 @@ class FrmEntry{
335
  $value = $values['item_meta'][$posted_field->id];
336
 
337
  if (isset($posted_field->field_options['default_blank']) and $posted_field->field_options['default_blank'] and $value == $posted_field->default_value)
338
- $_POST['item_meta'][$posted_field->id] = $value = '';
 
 
 
339
 
340
- if($posted_field->type == 'rte' and (trim($value) == '<br>'))
341
  $value = '';
342
 
343
  if ($posted_field->required == '1' and !is_array($value) and trim($value) == ''){
344
- $errors['field'.$posted_field->id] = (!isset($posted_field->field_options['blank']) or $posted_field->field_options['blank'] == '' or $posted_field->field_options['blank'] == 'Untitled cannot be blank') ? (__('This field cannot be blank', 'formidable')) : $posted_field->field_options['blank'];
345
  }else if ($posted_field->type == 'text' and !isset($_POST['name'])){
346
  $_POST['name'] = $value;
347
  }
@@ -365,9 +370,8 @@ class FrmEntry{
365
  }
366
 
367
  $errors = apply_filters('frm_validate_field_entry', $errors, $posted_field, $value);
 
368
  }
369
-
370
-
371
 
372
  global $wpcom_api_key;
373
  if (isset($values['item_meta']) and !empty($values['item_meta']) and empty($errors) and function_exists( 'akismet_http_post' ) and ((get_option('wordpress_api_key') or $wpcom_api_key)) and $this->akismet($values)){
@@ -390,6 +394,8 @@ class FrmEntry{
390
  foreach ( $values['item_meta'] as $val ) {
391
  if ( $content != '' )
392
  $content .= "\n\n";
 
 
393
  $content .= $val;
394
  }
395
 
7
  $new_values = array();
8
  $new_values['item_key'] = FrmAppHelper::get_unique_key($values['item_key'], $frmdb->entries, 'item_key');
9
  $new_values['name'] = isset($values['name']) ? $values['name'] : $values['item_key'];
10
+ if(is_array($new_values['name']))
11
+ $new_values['name'] = reset($new_values['name']);
12
  $new_values['ip'] = $_SERVER['REMOTE_ADDR'];
13
 
14
  if(isset($values['description']) and !empty($values['description'])){
98
  $new_values['name'] = $values->name;
99
  $new_values['user_id'] = $new_values['updated_by'] = $values->user_id;
100
  $new_values['form_id'] = ($values->form_id)?(int)$values->form_id: null;
101
+ $new_values['created_at'] = $new_values['updated_at'] = current_time('mysql', 1);
102
 
103
  $query_results = $wpdb->insert( $frmdb->entries, $new_values );
104
  if($query_results){
313
  }
314
 
315
  function validate( $values, $exclude=false ){
316
+ global $wpdb, $frmdb, $frm_field, $frm_entry_meta, $frm_settings;
317
 
318
  $errors = array();
319
  if(!isset($values['form_id']) or !isset($values['item_meta'])){
337
  $value = $values['item_meta'][$posted_field->id];
338
 
339
  if (isset($posted_field->field_options['default_blank']) and $posted_field->field_options['default_blank'] and $value == $posted_field->default_value)
340
+ $_POST['item_meta'][$posted_field->id] = $value = '';
341
+
342
+ if(is_array($value) and count($value) === 1)
343
+ $_POST['item_meta'][$posted_field->id] = $value = reset($value);
344
 
345
+ if($posted_field->type == 'rte' and !is_array($value) and (trim($value) == '<br>'))
346
  $value = '';
347
 
348
  if ($posted_field->required == '1' and !is_array($value) and trim($value) == ''){
349
+ $errors['field'.$posted_field->id] = (!isset($posted_field->field_options['blank']) or $posted_field->field_options['blank'] == '' or $posted_field->field_options['blank'] == 'Untitled cannot be blank') ? $frm_settings->blank_msg : $posted_field->field_options['blank'];
350
  }else if ($posted_field->type == 'text' and !isset($_POST['name'])){
351
  $_POST['name'] = $value;
352
  }
370
  }
371
 
372
  $errors = apply_filters('frm_validate_field_entry', $errors, $posted_field, $value);
373
+
374
  }
 
 
375
 
376
  global $wpcom_api_key;
377
  if (isset($values['item_meta']) and !empty($values['item_meta']) and empty($errors) and function_exists( 'akismet_http_post' ) and ((get_option('wordpress_api_key') or $wpcom_api_key)) and $this->akismet($values)){
394
  foreach ( $values['item_meta'] as $val ) {
395
  if ( $content != '' )
396
  $content .= "\n\n";
397
+ if(is_array($val))
398
+ $val = implode(',', $val);
399
  $content .= $val;
400
  }
401
 
classes/models/FrmForm.php CHANGED
@@ -16,8 +16,11 @@ class FrmForm{
16
  $options = array();
17
 
18
  $defaults = FrmFormsHelper::get_default_opts();
19
- foreach ($defaults as $var => $default)
20
  $options[$var] = isset($values['options'][$var]) ? $values['options'][$var] : $default;
 
 
 
21
 
22
  $options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
23
  $options['after_html'] = isset($values['options']['after_html']) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html('after');
@@ -92,8 +95,12 @@ class FrmForm{
92
  $options = array();
93
 
94
  $defaults = FrmFormsHelper::get_default_opts();
95
- foreach ($defaults as $var => $default)
96
- $options[$var] = isset($values['options'][$var]) ? $values['options'][$var] : $default;
 
 
 
 
97
 
98
  $options['custom_style'] = isset($values['options']['custom_style']) ? $values['options']['custom_style'] : 0;
99
  $options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
@@ -219,12 +226,6 @@ class FrmForm{
219
  return $wpdb->get_var($query);
220
  }
221
 
222
- function getIdByName( $name ){
223
- global $wpdb, $frmdb;
224
- $query = "SELECT id FROM $frmdb->forms WHERE name='$name';";
225
- return $wpdb->get_var($query);
226
- }
227
-
228
  function getIdByKey( $key ){
229
  global $wpdb, $frmdb;
230
  $query = "SELECT id FROM $frmdb->forms WHERE form_key='$key' LIMIT 1";
@@ -245,8 +246,12 @@ class FrmForm{
245
  }else{
246
  $table_name = $frmdb->forms;
247
  $cache = wp_cache_get($id, 'frm_form');
248
- if($cache)
249
- return $cache;
 
 
 
 
250
  }
251
 
252
  if (is_numeric($id))
@@ -257,8 +262,8 @@ class FrmForm{
257
  $results = $frmdb->get_one_record($table_name, $where);
258
 
259
  if(isset($results->options)){
260
- $results->options = stripslashes_deep(maybe_unserialize($results->options));
261
  wp_cache_set($results->id, $results, 'frm_form');
 
262
  }
263
  return $results;
264
  }
16
  $options = array();
17
 
18
  $defaults = FrmFormsHelper::get_default_opts();
19
+ foreach ($defaults as $var => $default){
20
  $options[$var] = isset($values['options'][$var]) ? $values['options'][$var] : $default;
21
+ unset($var);
22
+ unset($default);
23
+ }
24
 
25
  $options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
26
  $options['after_html'] = isset($values['options']['after_html']) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html('after');
95
  $options = array();
96
 
97
  $defaults = FrmFormsHelper::get_default_opts();
98
+ foreach ($defaults as $var => $default){
99
+ if($var == 'notification')
100
+ $options[$var] = isset($values[$var]) ? $values[$var] : $default;
101
+ else
102
+ $options[$var] = isset($values['options'][$var]) ? $values['options'][$var] : $default;
103
+ }
104
 
105
  $options['custom_style'] = isset($values['options']['custom_style']) ? $values['options']['custom_style'] : 0;
106
  $options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
226
  return $wpdb->get_var($query);
227
  }
228
 
 
 
 
 
 
 
229
  function getIdByKey( $key ){
230
  global $wpdb, $frmdb;
231
  $query = "SELECT id FROM $frmdb->forms WHERE form_key='$key' LIMIT 1";
246
  }else{
247
  $table_name = $frmdb->forms;
248
  $cache = wp_cache_get($id, 'frm_form');
249
+ if($cache){
250
+ if(isset($cache->options))
251
+ $cache->options = stripslashes_deep(maybe_unserialize($cache->options));
252
+
253
+ return $cache;
254
+ }
255
  }
256
 
257
  if (is_numeric($id))
262
  $results = $frmdb->get_one_record($table_name, $where);
263
 
264
  if(isset($results->options)){
 
265
  wp_cache_set($results->id, $results, 'frm_form');
266
+ $results->options = stripslashes_deep(maybe_unserialize($results->options));
267
  }
268
  return $results;
269
  }
classes/models/FrmNotification.php CHANGED
@@ -14,38 +14,55 @@ class FrmNotification{
14
  $form->options = maybe_unserialize($form->options);
15
  $values = $frm_entry_meta->getAll("it.item_id = $entry_id", " ORDER BY fi.field_order");
16
 
17
- $to_email = $form->options['email_to'];
18
- if ($to_email == '')
 
 
 
 
 
 
19
  $to_email = get_option('admin_email');
20
-
21
  $to_emails = explode(',', $to_email);
22
 
23
  $reply_to = $reply_to_name = '';
24
-
25
  $opener = sprintf(__('%1$s form has been submitted on %2$s.', 'formidable'), $form->name, $frm_blogname) ."\r\n\r\n";
26
-
27
  $entry_data = '';
28
  foreach ($values as $value){
29
  $val = apply_filters('frm_email_value', maybe_unserialize($value->meta_value), $value, $entry);
30
  if (is_array($val))
31
  $val = implode(', ', $val);
32
-
33
  if($value->field_type == 'textarea'){
34
  //$val = str_replace(array("\r\n", "\r", "\n"), "\r\n", $val);
35
  $val = "\r\n". $val;
36
  }
37
-
38
  $entry_data .= $value->field_name . ': ' . $val . "\r\n\r\n";
39
-
40
- if(isset($form->options['reply_to']) and (int)$form->options['reply_to'] == $value->field_id and is_email($val))
41
- $reply_to = $val;
42
-
43
- if ($reply_to == '' and is_email($val))
44
  $reply_to = $val;
45
-
46
- if(isset($form->options['reply_to_name']) and (int)$form->options['reply_to_name'] == $value->field_id)
47
  $reply_to_name = $val;
48
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  $data = maybe_unserialize($entry->description);
51
  $user_data = __('User Information', 'formidable') ."\r\n";
@@ -72,7 +89,10 @@ class FrmNotification{
72
  $to_email = get_option('admin_email');
73
 
74
  $recipient = $to_email; //recipient
75
- $header = "From: \"{$reply_to_name}\" <{$reply_to}>\r\n Reply-To: \"{$reply_to_name}\" <{$reply_to}>\r\n Content-Type: {$content_type}; charset=\"" . get_option('blog_charset') . "\"\r\n"; //optional headerfields
 
 
 
76
  $subject = wp_specialchars_decode(strip_tags(stripslashes($subject)), ENT_QUOTES );
77
 
78
  $message = do_shortcode($message);
@@ -86,7 +106,7 @@ class FrmNotification{
86
  remove_filter('wp_mail_from_name', 'bp_core_email_from_name_filter');
87
 
88
  if (!wp_mail($recipient, $subject, $message, $header, $attachments)){
89
- $header = "From: \"{$reply_to_name}\" <{$reply_to}>\r\n";
90
  mail($recipient, $subject, $message, $header);
91
  }
92
 
14
  $form->options = maybe_unserialize($form->options);
15
  $values = $frm_entry_meta->getAll("it.item_id = $entry_id", " ORDER BY fi.field_order");
16
 
17
+
18
+ if(isset($form->options['notification']))
19
+ $notification = reset($form->options['notification']);
20
+ else
21
+ $notification = $form->options;
22
+
23
+ $to_email = $notification['email_to'];
24
+ if($to_email == '')
25
  $to_email = get_option('admin_email');
26
+
27
  $to_emails = explode(',', $to_email);
28
 
29
  $reply_to = $reply_to_name = '';
30
+
31
  $opener = sprintf(__('%1$s form has been submitted on %2$s.', 'formidable'), $form->name, $frm_blogname) ."\r\n\r\n";
32
+
33
  $entry_data = '';
34
  foreach ($values as $value){
35
  $val = apply_filters('frm_email_value', maybe_unserialize($value->meta_value), $value, $entry);
36
  if (is_array($val))
37
  $val = implode(', ', $val);
38
+
39
  if($value->field_type == 'textarea'){
40
  //$val = str_replace(array("\r\n", "\r", "\n"), "\r\n", $val);
41
  $val = "\r\n". $val;
42
  }
43
+
44
  $entry_data .= $value->field_name . ': ' . $val . "\r\n\r\n";
45
+
46
+ if(isset($notification['reply_to']) and (int)$notification['reply_to'] == $value->field_id and is_email($val))
 
 
 
47
  $reply_to = $val;
48
+
49
+ if(isset($notification['reply_to_name']) and (int)$notification['reply_to_name'] == $value->field_id)
50
  $reply_to_name = $val;
51
  }
52
+
53
+
54
+ if(empty($reply_to)){
55
+ if($notification['reply_to'] == 'custom')
56
+ $reply_to = $notification['cust_reply_to'];
57
+
58
+ if(empty($reply_to))
59
+ $reply_to = get_option('admin_email');
60
+ }
61
+
62
+ if(empty($reply_to_name)){
63
+ if($notification['reply_to_name'] == 'custom')
64
+ $reply_to_name = $notification['cust_reply_to_name'];
65
+ }
66
 
67
  $data = maybe_unserialize($entry->description);
68
  $user_data = __('User Information', 'formidable') ."\r\n";
89
  $to_email = get_option('admin_email');
90
 
91
  $recipient = $to_email; //recipient
92
+ $header = array();
93
+ $header[] = 'From: "'. $reply_to_name .'" <'. $reply_to .'>';
94
+ $header[] = 'Reply-To: '. $reply_to;
95
+ $header[] = 'Content-Type: '. $content_type .'; charset="'. get_option('blog_charset') . '"';
96
  $subject = wp_specialchars_decode(strip_tags(stripslashes($subject)), ENT_QUOTES );
97
 
98
  $message = do_shortcode($message);
106
  remove_filter('wp_mail_from_name', 'bp_core_email_from_name_filter');
107
 
108
  if (!wp_mail($recipient, $subject, $message, $header, $attachments)){
109
+ $header = 'From: "'. $reply_to_name .'" <'. $reply_to .'>'. "\r\n";
110
  mail($recipient, $subject, $message, $header);
111
  }
112
 
classes/models/FrmSettings.php CHANGED
@@ -23,6 +23,7 @@ class FrmSettings{
23
 
24
  var $success_msg;
25
  var $failed_msg;
 
26
  var $invalid_msg;
27
  var $submit_value;
28
  var $login_msg;
@@ -114,6 +115,10 @@ class FrmSettings{
114
  $this->success_msg = __('Your responses were successfully submitted. Thank you!', 'formidable');
115
  $this->success_msg = stripslashes($this->success_msg);
116
 
 
 
 
 
117
  if(!isset($this->invalid_msg))
118
  $this->invalid_msg = __('There was a problem with your submission. Errors are marked below.', 'formidable');
119
  $this->invalid_msg = stripslashes($this->invalid_msg);
@@ -163,7 +168,7 @@ class FrmSettings{
163
  $this->lock_keys = isset($params['frm_lock_keys']) ? $params['frm_lock_keys'] : 0;
164
  $this->track = isset($params['frm_track']) ? $params['frm_track'] : 0;
165
 
166
- $this->pubkey = $params['frm_pubkey'];
167
  $this->privkey = $params['frm_privkey'];
168
  $this->re_theme = $params['frm_re_theme'];
169
  $this->re_lang = $params['frm_re_lang'];
@@ -176,6 +181,7 @@ class FrmSettings{
176
  $this->accordion_js = isset($params['frm_accordion_js']) ? $params['frm_accordion_js'] : 0;
177
 
178
  $this->success_msg = $params['frm_success_msg'];
 
179
  $this->invalid_msg = $params['frm_invalid_msg'];
180
  $this->failed_msg = $params['frm_failed_msg'];
181
  $this->submit_value = $params['frm_submit_value'];
23
 
24
  var $success_msg;
25
  var $failed_msg;
26
+ var $blank_msg;
27
  var $invalid_msg;
28
  var $submit_value;
29
  var $login_msg;
115
  $this->success_msg = __('Your responses were successfully submitted. Thank you!', 'formidable');
116
  $this->success_msg = stripslashes($this->success_msg);
117
 
118
+ if(!isset($this->blank_msg))
119
+ $this->blank_msg = __('This field cannot be blank.', 'formidable');
120
+ $this->blank_msg = stripslashes($this->blank_msg);
121
+
122
  if(!isset($this->invalid_msg))
123
  $this->invalid_msg = __('There was a problem with your submission. Errors are marked below.', 'formidable');
124
  $this->invalid_msg = stripslashes($this->invalid_msg);
168
  $this->lock_keys = isset($params['frm_lock_keys']) ? $params['frm_lock_keys'] : 0;
169
  $this->track = isset($params['frm_track']) ? $params['frm_track'] : 0;
170
 
171
+ $this->pubkey = trim($params['frm_pubkey']);
172
  $this->privkey = $params['frm_privkey'];
173
  $this->re_theme = $params['frm_re_theme'];
174
  $this->re_lang = $params['frm_re_lang'];
181
  $this->accordion_js = isset($params['frm_accordion_js']) ? $params['frm_accordion_js'] : 0;
182
 
183
  $this->success_msg = $params['frm_success_msg'];
184
+ $this->blank_msg = $params['frm_blank_msg'];
185
  $this->invalid_msg = $params['frm_invalid_msg'];
186
  $this->failed_msg = $params['frm_failed_msg'];
187
  $this->submit_value = $params['frm_submit_value'];
classes/views/frm-entries/frm-entry.php CHANGED
@@ -20,7 +20,7 @@ if($params['action'] == 'create' and $params['posted_form_id'] == $form->id and
20
  $values = FrmEntriesHelper::setup_new_vars($fields, $form);
21
  require(FRM_VIEWS_PATH .'/frm-entries/new.php');
22
  ?>
23
- <script type="text/javascript">window.onload = function(){var frm_pos=jQuery('#form_<?php echo $form->form_key ?>').offset(); var cOff = document.documentElement.scrollTop || document.body.scrollTop; if(cOff > frm_pos.top) window.scrollTo(frm_pos.left,frm_pos.top);}</script><?php
24
  }else{
25
  $fields = FrmFieldsHelper::get_form_fields($form->id);
26
  do_action('frm_validate_form_creation', $params, $fields, $form, $title, $description);
20
  $values = FrmEntriesHelper::setup_new_vars($fields, $form);
21
  require(FRM_VIEWS_PATH .'/frm-entries/new.php');
22
  ?>
23
+ <script type="text/javascript">jQuery(document).ready(function($){ var frm_pos=jQuery('#form_<?php echo $form->form_key ?>').offset();var cOff=document.documentElement.scrollTop || document.body.scrollTop;if(frm_pos) window.scrollTo(frm_pos.left,frm_pos.top);})</script><?php
24
  }else{
25
  $fields = FrmFieldsHelper::get_form_fields($form->id);
26
  do_action('frm_validate_form_creation', $params, $fields, $form, $title, $description);
classes/views/frm-entries/list.php CHANGED
@@ -3,7 +3,7 @@
3
  <h2><?php echo ($form) ? (FrmAppHelper::truncate(stripslashes($form->name), 25) .' ') : ''; _e('Entries', 'formidable'); ?></h2>
4
 
5
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
6
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
7
  <?php if($form) FrmAppController::get_form_nav($form->id, true); ?>
8
 
9
  <?php FrmAppController::update_message('view, search, export, and bulk delete your saved entries'); ?>
3
  <h2><?php echo ($form) ? (FrmAppHelper::truncate(stripslashes($form->name), 25) .' ') : ''; _e('Entries', 'formidable'); ?></h2>
4
 
5
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
6
+
7
  <?php if($form) FrmAppController::get_form_nav($form->id, true); ?>
8
 
9
  <?php FrmAppController::update_message('view, search, export, and bulk delete your saved entries'); ?>
classes/views/frm-forms/add_field.php CHANGED
@@ -95,8 +95,12 @@
95
  <?php
96
  }else if ($field['type'] == 'captcha'){
97
  global $frm_settings; ?>
98
- <img src="<?php echo FRM_URL ?>/images/<?php echo $frm_settings->re_theme ?>-captcha.png" alt="captcha" />
99
  <span class="howto"><?php printf(__('Hint: Change colors in the %1$sFormidable settings', 'formidable'), '<a href="?page=formidable-settings">') ?></a></span>
 
 
 
 
100
  <input type="hidden" name="<?php echo $field_name ?>" value="1"/>
101
  <?php
102
  }else{
95
  <?php
96
  }else if ($field['type'] == 'captcha'){
97
  global $frm_settings; ?>
98
+ <img src="<?php echo FRM_URL ?>/images/<?php echo $frm_settings->re_theme ?>-captcha.png" alt="captcha" class="alignleft"/>
99
  <span class="howto"><?php printf(__('Hint: Change colors in the %1$sFormidable settings', 'formidable'), '<a href="?page=formidable-settings">') ?></a></span>
100
+ <div style="clear:both"></div>
101
+ <?php if (empty($frm_settings->pubkey)){ ?>
102
+ <div class="howto" style="font-weight:bold;color:red;"><?php printf(__('Your captcha will not appear on your form until you %1$sset up%2$s the Public and Private Keys', 'formidable'), '<a href="?page=formidable-settings">', '</a>') ?></div>
103
+ <?php } ?>
104
  <input type="hidden" name="<?php echo $field_name ?>" value="1"/>
105
  <?php
106
  }else{
classes/views/frm-forms/add_field_links.php CHANGED
@@ -17,87 +17,67 @@
17
  } ?>
18
  <div id="frm_position_ele"></div>
19
 
20
- <div class="frm_field_list">
21
- <div class="widget">
22
- <div class="widget-top">
23
- <div class="widget-title-action"><a class="widget-action"></a></div>
24
- <div class="widget-title"><h4><?php _e('Fields', 'formidable') ?></h4></div>
25
- </div>
26
- <div class="widget-inside" style="display: block;">
27
- <p class="howto" style="margin:0;"><?php _e('Click on or drag a field into your form', 'formidable') ?></p>
28
- <ul class="field_type_list">
29
- <?php
30
- $col_class = 'frm_col_one';
31
- foreach ($frm_field_selection as $field_key => $field_type){ ?>
32
- <li class="frmbutton button <?php echo $col_class ?> frm_t<?php echo $field_key ?>" id="<?php echo $field_key ?>"><a href="javascript:add_frm_field_link(<?php echo $id ?>,'<?php echo $field_key ?>');"><?php echo $field_type ?></a></li>
33
- <?php
34
- $col_class = (empty($col_class)) ? 'frm_col_one' : '';
35
- } ?>
36
- </ul>
37
- <div class="clear"></div>
38
 
39
- <h4 class="title" style="margin-bottom:0;"><?php _e('Pro Fields', 'formidable') ?></h4>
40
- <div class="clearfix">
41
- <ul<?php echo apply_filters('frm_drag_field_class', '') ?>>
42
- <?php $col_class = 'frm_col_one';
43
- foreach (FrmFieldsHelper::pro_field_selection() as $field_key => $field_type){ ?>
44
- <li class="frmbutton button <?php echo $col_class ?> frm_t<?php echo $field_key ?>" id="<?php echo $field_key ?>"><?php echo apply_filters('frmpro_field_links',$field_type, $id, $field_key) ?></li>
45
- <?php
46
- $col_class = (empty($col_class)) ? 'frm_col_one' : '';
47
- } ?>
48
- </ul>
49
- <div class="clear"></div>
50
- </div>
51
- </div>
52
- </div>
53
-
54
- <?php do_action('frm_extra_form_instructions'); ?>
55
- <div class="widget">
56
- <div class="widget-top">
57
- <div class="widget-title-action"><a class="widget-action"></a></div>
58
- <div class="widget-title"><h4><?php _e('Key and Form Actions', 'formidable') ?></h4></div>
59
- </div>
60
- <div class="widget-inside submitbox">
61
- <div id="misc-publishing-actions">
62
-
63
- <ul class="frm_key_icons">
64
- <li><span class="frm_action_icon frm_required_icon"></span>
65
- = <?php _e('required field', 'formidable') ?></li>
66
- <li><span class="frm_inactive_icon frm_action_icon frm_required_icon"></span>
67
- = <?php _e('not required', 'formidable') ?></li>
68
- <li><span class="frm_action_icon frm_reload_icon"></span>
69
- = <?php _e('clear default text on click', 'formidable') ?></li>
70
- <li><span class="frm_inactive_icon frm_action_icon frm_reload_icon"></span>
71
- = <?php _e('do not clear default text on click', 'formidable') ?></li>
72
- <li><span class="frm_action_icon frm_error_icon"></span>
73
- = <?php _e('default value will NOT pass validation', 'formidable') ?></li>
74
- <li><span class="frm_inactive_icon frm_action_icon frm_error_icon"></span>
75
- = <?php _e('default value will pass validation', 'formidable') ?></li>
76
- <li><span><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="<?php echo esc_attr(__('Delete', 'formidable')) ?>" /></span>
77
- = <?php _e('delete field and all inputed data', 'formidable') ?></li>
78
- <li><span><img src="<?php echo FRM_IMAGES_URL ?>/duplicate.png" alt="<?php echo esc_attr(__('Move', 'formidable')) ?>" /></span>
79
- = <?php _e('duplicate field', 'formidable') ?></li>
80
- <li><span><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="<?php echo esc_attr(__('Move', 'formidable')) ?>" /></span>
81
- = <?php _e('move field', 'formidable') ?></li>
82
- </ul>
83
-
84
- <div class="misc-pub-section " style="border-top:none;">
85
-
86
- </div>
87
- </div>
88
- <div id="major-publishing-actions">
89
- <div id="delete-action">
90
- <a href="<?php echo wp_nonce_url( '?page=formidable&frm_action=destroy&id='. $id ) ?>" onclick="return confirm('<?php _e('Are you sure you want to delete that?', 'formidable') ?>')" class="submitdelete deletion"><?php _e( 'Delete', 'formidable' ) ?></a>
91
- </div>
92
- &nbsp;
93
- <!--
94
- <?php if($frmpro_is_installed){ ?>
95
- <a href="<?php echo wp_nonce_url( FRM_SCRIPT_URL .'&controller=forms&frm_action=export&id='. $id ) ?>" title="<?php _e('Export Template', 'formidable') ?>" class="alignright"><?php _e('Export Template', 'formidable') ?></a>
96
- <?php } ?>
97
- -->
98
- </div>
99
- </div>
100
- </div>
101
 
 
 
 
 
 
 
 
 
 
 
102
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  </div>
17
  } ?>
18
  <div id="frm_position_ele"></div>
19
 
20
+ <div class="postbox frm_field_list">
21
+ <div class="inside">
22
+ <div id="taxonomy-linkcategory" class="categorydiv">
23
+ <ul id="category-tabs" class="category-tabs frm-category-tabs">
24
+ <li class="tabs" ><a href="#frm-insert-fields"><?php _e( 'Fields', 'formidable' ); ?></a></li>
25
+ <li class="hide-if-no-js"><a href="#frm-keys-and-actions"><?php _e( 'Key', 'formidable' ); ?></a></li>
26
+ <?php do_action('frm_extra_form_instruction_tabs'); ?>
27
+ </ul>
 
 
 
 
 
 
 
 
 
 
28
 
29
+ <div id="frm-insert-fields" class="tabs-panel" style="max-height:none;overflow:visible;">
30
+ <p class="howto"><?php _e('Click on or drag a field into your form', 'formidable') ?></p>
31
+ <ul class="field_type_list">
32
+ <?php
33
+ $col_class = 'frm_col_one';
34
+ foreach ($frm_field_selection as $field_key => $field_type){ ?>
35
+ <li class="frmbutton button <?php echo $col_class ?> frm_t<?php echo $field_key ?>" id="<?php echo $field_key ?>"><a href="javascript:add_frm_field_link(<?php echo $id ?>,'<?php echo $field_key ?>');"><?php echo $field_type ?></a></li>
36
+ <?php
37
+ $col_class = (empty($col_class)) ? 'frm_col_one' : '';
38
+ } ?>
39
+ </ul>
40
+ <div class="clear"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
+ <h4 class="title" style="margin-bottom:0;margin-top:4px;"><?php _e('Pro Fields', 'formidable') ?></h4>
43
+ <ul<?php echo apply_filters('frm_drag_field_class', '') ?> style="margin-top:2px;">
44
+ <?php $col_class = 'frm_col_one';
45
+ foreach (FrmFieldsHelper::pro_field_selection() as $field_key => $field_type){ ?>
46
+ <li class="frmbutton button <?php echo $col_class ?> frm_t<?php echo $field_key ?>" id="<?php echo $field_key ?>"><?php echo apply_filters('frmpro_field_links',$field_type, $id, $field_key) ?></li>
47
+ <?php
48
+ $col_class = (empty($col_class)) ? 'frm_col_one' : '';
49
+ } ?>
50
+ </ul>
51
+ <div class="clear"></div>
52
  </div>
53
+
54
+ <div id="frm-keys-and-actions" class="tabs-panel" style="display:none;max-height:none;">
55
+
56
+ <ul class="frm_key_icons">
57
+ <li><span class="frm_action_icon frm_required_icon"></span>
58
+ = <?php _e('required field', 'formidable') ?></li>
59
+ <li><span class="frm_inactive_icon frm_action_icon frm_required_icon"></span>
60
+ = <?php _e('not required', 'formidable') ?></li>
61
+ <li><span class="frm_action_icon frm_reload_icon"></span>
62
+ = <?php _e('clear default text on click', 'formidable') ?></li>
63
+ <li><span class="frm_inactive_icon frm_action_icon frm_reload_icon"></span>
64
+ = <?php _e('do not clear default text on click', 'formidable') ?></li>
65
+ <li><span class="frm_action_icon frm_error_icon"></span>
66
+ = <?php _e('default value will NOT pass validation', 'formidable') ?></li>
67
+ <li><span class="frm_inactive_icon frm_action_icon frm_error_icon"></span>
68
+ = <?php _e('default value will pass validation', 'formidable') ?></li>
69
+ <li><span><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="<?php echo esc_attr(__('Delete', 'formidable')) ?>" /></span>
70
+ = <?php _e('delete field and all inputed data', 'formidable') ?></li>
71
+ <li><span><img src="<?php echo FRM_IMAGES_URL ?>/duplicate.png" alt="<?php echo esc_attr(__('Move', 'formidable')) ?>" /></span>
72
+ = <?php _e('duplicate field', 'formidable') ?></li>
73
+ <li><span><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="<?php echo esc_attr(__('Move', 'formidable')) ?>" /></span>
74
+ = <?php _e('move field', 'formidable') ?></li>
75
+ </ul>
76
+
77
+ </div>
78
+
79
+ <?php do_action('frm_extra_form_instructions'); ?>
80
+ </div>
81
+ </div>
82
+ </div>
83
  </div>
classes/views/frm-forms/edit.php CHANGED
@@ -4,7 +4,7 @@
4
  <a href="?page=formidable-new" class="button add-new-h2"><?php _e('Add New', 'formidable'); ?></a>
5
  </h2>
6
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
7
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
8
  <?php if (!$values['is_template']){ ?>
9
  <div class="alignleft">
10
  <?php FrmAppController::get_form_nav($id, true); ?>
4
  <a href="?page=formidable-new" class="button add-new-h2"><?php _e('Add New', 'formidable'); ?></a>
5
  </h2>
6
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
7
+
8
  <?php if (!$values['is_template']){ ?>
9
  <div class="alignleft">
10
  <?php FrmAppController::get_form_nav($id, true); ?>
classes/views/frm-forms/insert_form_popup.php CHANGED
@@ -50,7 +50,7 @@
50
  <select name="frm_add_display_id" id="frm_add_display_id" class="frm-dropdown">
51
  <option value=""></option>
52
  <?php foreach ($displays as $display){ ?>
53
- <option value="<?php echo $display->id ?>"><?php echo $display->name ?></option>
54
  <?php } ?>
55
  </select>
56
  </p>
50
  <select name="frm_add_display_id" id="frm_add_display_id" class="frm-dropdown">
51
  <option value=""></option>
52
  <?php foreach ($displays as $display){ ?>
53
+ <option value="<?php echo $display->ID ?>"><?php echo $display->post_title ?></option>
54
  <?php } ?>
55
  </select>
56
  </p>
classes/views/frm-forms/list.php CHANGED
@@ -16,8 +16,6 @@ if(class_exists('WP_List_Table')){
16
  <input type="hidden" name="frm_action" value="list" />
17
  <?php $wp_list_table->search_box( __( 'Search', 'formidable' ), 'entry' );
18
 
19
- require(FRM_VIEWS_PATH.'/shared/nav.php');
20
-
21
  if ($params['template']) require(FRM_VIEWS_PATH .'/frm-forms/default-templates.php');
22
 
23
  $wp_list_table->display(); ?>
@@ -26,7 +24,6 @@ $wp_list_table->display(); ?>
26
  <?php }else{
27
 
28
  do_action('frm_before_item_nav',$sort_str, $sdir_str, $search_str, false);
29
- require(FRM_VIEWS_PATH.'/shared/nav.php');
30
 
31
  if ($params['template']) require(FRM_VIEWS_PATH .'/frm-forms/default-templates.php'); ?>
32
 
16
  <input type="hidden" name="frm_action" value="list" />
17
  <?php $wp_list_table->search_box( __( 'Search', 'formidable' ), 'entry' );
18
 
 
 
19
  if ($params['template']) require(FRM_VIEWS_PATH .'/frm-forms/default-templates.php');
20
 
21
  $wp_list_table->display(); ?>
24
  <?php }else{
25
 
26
  do_action('frm_before_item_nav',$sort_str, $sdir_str, $search_str, false);
 
27
 
28
  if ($params['template']) require(FRM_VIEWS_PATH .'/frm-forms/default-templates.php'); ?>
29
 
classes/views/frm-forms/mb_insert_fields.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="frm_adv_info" class="postbox">
2
+ <div class="handlediv" title="Click to toggle"><br></div><h3 class="hndle"><span><?php _e('Content Customization', 'formidable') ?></span></h3>
3
+ <div class="inside">
4
+ <div id="taxonomy-linkcategory" class="categorydiv">
5
+ <ul id="category-tabs" class="category-tabs frm-category-tabs">
6
+ <li class="tabs" ><a href="#frm-insert-fields" id="frm_insert_fields_tab" ><?php _e( 'Insert Fields', 'formidable' ); ?></a></li>
7
+ <li class="hide-if-no-js"><a href="#frm-html-tags" id="frm_html_tags_tab" ><?php _e( 'HTML Tags', 'formidable' ); ?></a></li>
8
+ </ul>
9
+
10
+ <div id="frm-insert-fields" class="tabs-panel" style="max-height:none;padding-right:0;">
11
+ <?php
12
+ $settings_tab = true;
13
+ include(FRM_VIEWS_PATH .'/shared/mb_insert_fields.php');
14
+ unset($settings_tab); ?>
15
+ </div>
16
+
17
+ <div id="frm-html-tags" class="tabs-panel" style="display:none;max-height:none;padding-right:0;">
18
+ <ul class="frm_code_list">
19
+ <?php
20
+ $col = 'one';
21
+ $entry_shortcodes = array(
22
+ 'id' => __('Field ID', 'formidable'),
23
+ 'key' => __('Field Key', 'formidable'),
24
+ 'field_name' => __('Field Name', 'formidable'),
25
+ 'description' => __('Field Description', 'formidable'),
26
+ 'label_position' => __('Label Position', 'formidable'),
27
+ 'required_label' => __('Required Label', 'formidable'),
28
+ 'input' => __('Input Field', 'formidable'),
29
+ 'input opt=1' => array('label' => __('Single Option', 'formidable'), 'title' => __('Show a single radio or checkbox option by replacing "1" with the order of the option', 'formidable')),
30
+ 'input label=0' => __('Hide Option Label', 'formidable'),
31
+ 'required_class' => array('label' => __('Required Class', 'formidable'), 'title' => __('Add class name if field is required', 'formidable')),
32
+ 'error_class' => array('label' => __('Error Class', 'formidable'), 'title' => __('Add class name if field has an error on form submit', 'formidable'))
33
+ );
34
+
35
+ foreach($entry_shortcodes as $skey => $sname){
36
+ ?>
37
+ <li class="frm_col_<?php echo $col ?>">
38
+ <a class="show_field_custom_html frmbutton button <?php echo is_array($sname) ? 'frm_help' : ''; ?>" onclick="frmInsertFieldCode(jQuery(this),'<?php echo $skey ?>');return false;" href="#" <?php echo is_array($sname) ? 'title="'. $sname['title'] .'"' : ''; ?>><?php echo is_array($sname) ? $sname['label'] : $sname; ?></a>
39
+ </li>
40
+ <?php
41
+ $col = ($col == 'one') ? 'two' : 'one';
42
+ unset($skey);
43
+ unset($sname);
44
+ }
45
+ ?>
46
+ </ul>
47
+
48
+ <ul class="frm_code_list clear">
49
+ <?php
50
+ $col = 'one';
51
+ foreach(array(
52
+ 'form_name' => __('Form Name', 'formidable'), 'form_description' => __('Form Description', 'formidable'),
53
+ 'form_key' => __('Form Key', 'formidable'), 'deletelink' => __('Delete Entry Link', 'formidable')) as $skey => $sname){ ?>
54
+ <li class="frm_col_<?php echo $col ?>">
55
+ <a class="show_before_html show_after_html frmbutton button" onclick="frmInsertFieldCode(jQuery(this),'<?php echo $skey ?>');return false;" href="#"><?php echo $sname; ?></a>
56
+ </li>
57
+ <?php
58
+ $col = ($col == 'one') ? 'two' : 'one';
59
+ } ?>
60
+ </ul>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
classes/views/frm-forms/new-selection.php CHANGED
@@ -2,9 +2,6 @@
2
  <div class="frmicon icon32"><br/></div>
3
  <h2><?php _e('Add New Form', 'formidable') ?></h2>
4
 
5
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
6
-
7
-
8
  <div id="menu-management" class="clear nav-menus-php" style="margin-top:30px;">
9
  <div class="menu-edit" style="width:300px;float:left;margin-right:30px;">
10
  <div id="nav-menu-header"><div class="major-publishing-actions" style="padding:8px 0;">
2
  <div class="frmicon icon32"><br/></div>
3
  <h2><?php _e('Add New Form', 'formidable') ?></h2>
4
 
 
 
 
5
  <div id="menu-management" class="clear nav-menus-php" style="margin-top:30px;">
6
  <div class="menu-edit" style="width:300px;float:left;margin-right:30px;">
7
  <div id="nav-menu-header"><div class="major-publishing-actions" style="padding:8px 0;">
classes/views/frm-forms/new.php CHANGED
@@ -2,7 +2,7 @@
2
  <div class="frmicon icon32"><br/></div>
3
  <h2><?php _e('Add New Form', 'formidable') ?></h2>
4
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
5
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
6
  <?php if (!$values['is_template']){ ?>
7
  <div class="alignleft">
8
  <?php FrmAppController::get_form_nav($id, true); ?>
2
  <div class="frmicon icon32"><br/></div>
3
  <h2><?php _e('Add New Form', 'formidable') ?></h2>
4
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
5
+
6
  <?php if (!$values['is_template']){ ?>
7
  <div class="alignleft">
8
  <?php FrmAppController::get_form_nav($id, true); ?>
classes/views/frm-forms/notification.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="frm_notification_<?php echo $email_key ?>" class="tabs-panel notification_settings <?php if(!$first_email) echo 'panel_secondary' ?>" style="display:none;">
2
+ <table class="form-table">
3
+ <tr valign="top">
4
+ <td width="100px"><label><?php _e('From/Reply to', 'formidable') ?></label> <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('Usually the name and email of the person filling out the form. Select from Text, Email, User ID, or hidden fields for the name. &lt;br/&gt;Defaults to your site name and admin email found on the WordPress General Settings page.', 'formidable') ?>" /></td>
5
+ <td class="frm_email_reply_container"><span class="howto"><?php _e('Name', 'formidable') ?></span>
6
+
7
+ <select name="notification[<?php echo $email_key ?>][reply_to_name]" id="reply_to_name_<?php echo $email_key ?>" onchange="frmCheckCustomEmail(this.value,'reply_to_name')">
8
+ <option value=""><?php echo FrmAppHelper::truncate(get_option('blogname'), 80); ?></option>
9
+ <option value="custom" <?php selected($notification['reply_to_name'], 'custom'); ?>><?php _e('Custom Name', 'formidable') ?></option>
10
+ <?php
11
+ if(!empty($values['fields'])){ ?>
12
+ <optgroup label="<?php _e('Fields', 'formidable') ?>">
13
+ <?php
14
+ $field_select = array('text', 'email', 'user_id', 'hidden');
15
+ foreach($values['fields'] as $val_key => $fo){
16
+ if(in_array($fo['type'], $field_select)){ ?>
17
+ <option value="<?php echo $fo['id'] ?>" <?php selected($notification['reply_to_name'], $fo['id']); ?>><?php echo FrmAppHelper::truncate($fo['name'], 40) ?></option>
18
+ <?php }else if($fo['type'] == 'data' and $fo['data_type'] != 'data'){
19
+ if(isset($values['fields'][$val_key]['linked'])){
20
+ foreach($values['fields'][$val_key]['linked'] as $linked_field){
21
+ if(!in_array($linked_field->type, $field_select)) continue; ?>
22
+ <option value="<?php echo $fo['id'] ?>|<?php echo $linked_field->id ?>" <?php selected($notification['reply_to_name'], $fo['id'] .'|'. $linked_field->id); ?>><?php echo $fo['name'] .': '. FrmAppHelper::truncate($linked_field->name, 40) ?></option>
23
+ <?php }
24
+ }
25
+ }
26
+ }
27
+ } ?>
28
+ </select>
29
+
30
+ <span class="howto" ><?php _e('Email', 'formidable') ?></span>
31
+ <select name="notification[<?php echo $email_key ?>][reply_to]" id="reply_to_<?php echo $email_key ?>" onchange="frmCheckCustomEmail(this.value,'reply_to')">
32
+ <option value=""><?php echo get_option('admin_email') ?></option>
33
+ <option value="custom" <?php selected($notification['reply_to'], 'custom'); ?>><?php _e('Custom Address', 'formidable') ?></option>
34
+ <?php
35
+ if(!empty($values['fields'])){ ?>
36
+ <optgroup label="<?php _e('Fields', 'formidable') ?>">
37
+ <?php
38
+ foreach($values['fields'] as $val_key => $fo){
39
+ if(in_array($fo['type'], $field_select)){ ?>
40
+ <option value="<?php echo $fo['id'] ?>" <?php selected($notification['reply_to'], $fo['id']); ?>><?php echo FrmAppHelper::truncate($fo['name'], 40) ?></option>
41
+ <?php }else if($fo['type'] == 'data' and $fo['data_type'] != 'data'){
42
+ if(isset($values['fields'][$val_key]['linked'])){ ?>
43
+ <?php foreach($values['fields'][$val_key]['linked'] as $linked_field){
44
+ if(!in_array($linked_field->type, $field_select)) continue; ?>
45
+ <option value="<?php echo $fo['id'] ?>|<?php echo $linked_field->id ?>" <?php selected($notification['reply_to'], $fo['id'] .'|'. $linked_field->id); ?>><?php echo $fo['name'] .': '. FrmAppHelper::truncate($linked_field->name, 40) ?></option>
46
+ <?php }
47
+ }
48
+ }
49
+ }
50
+ } ?>
51
+ </select>
52
+
53
+ <div id="frm_cust_reply_container" <?php echo ($notification['reply_to_name'] == 'custom' or $notification['reply_to_name'] == 'custom') ? '' : 'style="display:none"'; ?>>
54
+ <span class="howto" style="visibility:hidden;"><?php _e('Name', 'formidable') ?></span>
55
+ <input type="text" name="notification[<?php echo $email_key ?>][cust_reply_to_name]" value="<?php echo esc_attr($notification['cust_reply_to_name']) ?>" id="cust_reply_to_name" title="<?php _e('Name', 'formidable') ?>" <?php echo ($notification['reply_to_name'] == 'custom') ? '' : 'style="visibility:hidden;"'; ?> />
56
+ <span class="howto" style="visibility:hidden;"><?php _e('Email', 'formidable') ?></span>
57
+ <input type="text" name="notification[<?php echo $email_key ?>][cust_reply_to]" value="<?php echo esc_attr($notification['cust_reply_to']) ?>" id="cust_reply_to" title="<?php _e('Email Address', 'formidable') ?>" <?php echo ($notification['reply_to'] == 'custom') ? '' : 'style="visibility:hidden;"'; ?> />
58
+ </div>
59
+ </td>
60
+ </tr>
61
+
62
+ <tr>
63
+ <td colspan="2"><label><?php _e('Email Recipients', 'formidable') ?></label> <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('To send to multiple addresses, separate each address with a comma. You can use [admin_email] to dynamically use the address on your WordPress General Settings page. &lt;br/&gt;PRO only: Leave blank if you do not want email notifications for this form.', 'formidable') ?>" />
64
+ <input type="text" name="notification[<?php echo $email_key ?>][email_to]" value="<?php echo esc_attr($notification['email_to']); ?>" class="frm_not_email_to frm_long_input" id="email_to_<?php echo $email_key ?>" /></td>
65
+ </tr>
66
+ <?php if(!$frmpro_is_installed){ ?>
67
+ <tr><td colspan="2">
68
+ <?php FrmAppController::update_message('customize your email notifications and send auto responders'); ?>
69
+ </td></tr>
70
+ <?php } ?>
71
+ <?php do_action('frm_additional_form_notification_options', $values, compact('notification', 'email_key')); ?>
72
+ </table>
73
+ </div>
classes/views/frm-forms/settings.php CHANGED
@@ -4,31 +4,15 @@
4
  <a href="?page=formidable-new" class="button add-new-h2"><?php _e('Add New', 'formidable'); ?></a>
5
  </h2>
6
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
7
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
8
- <div class="alignright">
9
- <div id="postbox-container-1">
10
- <?php if(!isset($hide_preview) or !$hide_preview){
11
- if (!$values['is_template']){ ?>
12
- <p class="howto" style="margin-top:0;"><?php _e('Insert into a post, page or text widget', 'formidable') ?>
13
- <input type="text" style="text-align:center;font-weight:bold;width:100%;" readonly="true" onclick="this.select();" onfocus="this.select();" value="[formidable id=<?php echo $id; ?>]" /></p>
14
- <?php } ?>
15
 
16
- <p class="frm_orange"><a href="<?php echo FrmFormsHelper::get_direct_link($values['form_key']); ?>" target="_blank"><?php _e('Preview', 'formidable') ?></a>
17
- <?php global $frm_settings;
18
- if ($frm_settings->preview_page_id > 0){ ?>
19
- <?php _e('or', 'formidable') ?>
20
- <a href="<?php echo add_query_arg('form', $values['form_key'], get_permalink($frm_settings->preview_page_id)) ?>" target="_blank"><?php _e('Preview in Current Theme', 'formidable') ?></a>
21
- <?php } ?>
22
- </p>
23
- <?php
24
- } ?>
25
- </div>
26
- </div>
27
- <div class="alignleft">
28
- <?php FrmAppController::get_form_nav($id, true); ?>
29
- </div>
30
 
31
-
 
 
 
 
 
 
32
  <form method="post">
33
  <p style="clear:left;">
34
  <input type="submit" value="<?php _e('Update', 'formidable') ?>" class="button-primary" />
@@ -53,11 +37,11 @@
53
  <h3 class="hndle"><span><?php echo FrmAppHelper::truncate(stripslashes($values['name']), 40) .' '. __('Settings', 'formidable') ?></span></h3>
54
  <div class="inside">
55
  <div class="contextual-help-tabs">
56
- <ul <?php if(version_compare( $GLOBALS['wp_version'], '3.3.0', '<')) echo 'id="category-tabs" class="category-tabs"'; ?>>
57
  <li class="tabs active"><a onclick="frmSettingsTab(jQuery(this),'advanced');"><?php _e('General', 'formidable') ?></a></li>
58
- <li><a onclick="frmSettingsTab(jQuery(this),'notification');"><?php _e('Emails', 'formidable') ?></a></li>
59
- <li><a onclick="frmSettingsTab(jQuery(this),'html');"><?php _e('Customize HTML', 'formidable') ?></a></li>
60
- <li><a onclick="frmSettingsTab(jQuery(this),'post');"><?php _e('Create Posts', 'formidable') ?></a></li>
61
  <?php foreach($sections as $sec_name => $section){ ?>
62
  <li><a onclick="frmSettingsTab(jQuery(this),'<?php echo $sec_name ?>');"><?php echo ucfirst($sec_name) ?></a></li>
63
  <?php } ?>
@@ -67,7 +51,7 @@
67
  <table class="form-table">
68
  <tr>
69
  <td width="200px"><label><?php _e('Form ShortCodes', 'formidable') ?></label> <a href="http://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank"><img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('Key and id are generally synonymous. For more information on using this shortcode, click now.', 'formidable') ?>" /></a></td>
70
- <td><input type="text" style="width:250px; border:none; background:transparent;" readonly="true" onclick="this.select();" onfocus="this.select();" value="[formidable id=<?php echo $id; ?> title=true description=true]" /> <?php _e('or', 'formidable') ?>
71
  <input type="text" style="width:200px; border:none; background:transparent;" readonly="true" onclick="this.select();" onfocus="this.select();" value="[formidable key=<?php echo $values['form_key']; ?>]" />
72
  </td>
73
  </tr>
@@ -86,26 +70,23 @@
86
  <td><input type="text" name="options[submit_value]" value="<?php echo esc_attr($values['submit_value']); ?>" /></td>
87
  </tr>
88
 
89
- <tr><td valign="top"><label><?php _e('Action After Form Submission', 'formidable') ?></label>
90
  <?php if(!$frmpro_is_installed){ ?>
91
  <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('You must upgrade to Formidable Pro to get access to the second two options.', 'formidable') ?>" />
92
  <?php } ?>
93
- </td>
94
- <td>
95
  <input type="radio" name="options[success_action]" id="success_action_message" value="message" <?php checked($values['success_action'], 'message') ?> /> <label for="success_action_message"><?php _e('Display a Message', 'formidable') ?></label>
96
  <input type="radio" name="options[success_action]" id="success_action_page" value="page" <?php checked($values['success_action'], 'page') ?> <?php if(!$frmpro_is_installed) echo 'disabled="disabled" '; ?>/> <label for="success_action_page" <?php echo $pro_feature ?>><?php _e('Display content from another page', 'formidable') ?></label>
97
  <input type="radio" name="options[success_action]" id="success_action_redirect" value="redirect" <?php checked($values['success_action'], 'redirect') ?> <?php if(!$frmpro_is_installed) echo 'disabled="disabled" '; ?>/> <label for="success_action_redirect" <?php echo $pro_feature ?>><?php _e('Redirect to URL', 'formidable') ?></label>
98
  </td>
99
  </tr>
100
 
101
- <tr class="success_action_redirect_box success_action_box" <?php echo ($values['success_action'] == 'redirect') ? '' : 'style="display:none;"'; ?>><td valign="top"><label><?php _e('Redirect to URL', 'formidable') ?></label></td>
102
- <td><?php if(isset($values['id']) and $frmpro_is_installed) FrmProFieldsHelper::get_shortcode_select($values['id'], 'success_url'); ?><br/>
103
- <input type="text" name="options[success_url]" id="success_url" value="<?php echo esc_attr($values['success_url']); ?>" size="55"></td>
104
  </tr>
105
 
106
- <tr class="success_action_message_box success_action_box" <?php echo ($values['success_action'] == 'message') ? '' : 'style="display:none;"'; ?>><td valign="top"><label><?php _e('Confirmation Message', 'formidable') ?></label></td>
107
- <td><?php if($frmpro_is_installed and isset($values['id'])){ FrmProFieldsHelper::get_shortcode_select($values['id'], 'success_msg'); echo '<br/>'; } ?>
108
- <textarea id="success_msg" name="options[success_msg]" cols="50" rows="4" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['success_msg']); ?></textarea> <br/>
109
  <div class="frm_show_form_opt">
110
  <input type="checkbox" name="options[show_form]" id="show_form" value="1" <?php checked($values['show_form'], 1) ?> /> <label for="show_form"><?php _e('Show the form with the success message.', 'formidable')?></label>
111
  </div>
@@ -129,75 +110,25 @@
129
  </table>
130
  </div>
131
 
132
- <div class="notification_settings tabs-panel" style="display:none;">
133
- <table class="form-table">
134
-
135
- <tr valign="top">
136
- <td width="200px"><label><?php _e('From/Reply to', 'formidable') ?></label> <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('Usually the name and email of the person filling out the form. Select from Text, Email, User ID, or hidden fields for the name. &lt;br/&gt;Defaults to your site name and admin email found on the WordPress General Settings page.', 'formidable') ?>" /></td>
137
- <td><span class="howto"><?php _e('Name', 'formidable') ?></span>
138
- <select name="options[reply_to_name]">
139
- <option value=""><?php echo FrmAppHelper::truncate(get_option('blogname'), 80); ?></option>
140
- <?php
141
- if(!empty($values['fields'])){
142
- $field_select = array('text', 'email', 'user_id', 'hidden');
143
- foreach($values['fields'] as $val_key => $fo){
144
- if(in_array($fo['type'], $field_select)){ ?>
145
- <option value="<?php echo $fo['id'] ?>" <?php selected($values['reply_to_name'], $fo['id']); ?>><?php echo FrmAppHelper::truncate($fo['name'], 40) ?></option>
146
- <?php }else if($fo['type'] == 'data' and $fo['data_type'] != 'show'){
147
- if(isset($values['fields'][$val_key]['linked'])){
148
- foreach($values['fields'][$val_key]['linked'] as $linked_field){
149
- if(!in_array($linked_field->type, $field_select)) continue; ?>
150
- <option value="<?php echo $fo['id'] ?>|<?php echo $linked_field->id ?>" <?php selected($values['reply_to_name'], $fo['id'] .'|'. $linked_field->id); ?>><?php echo $fo['name'] .': '. FrmAppHelper::truncate($linked_field->name, 40) ?></option>
151
- <?php }
152
- }
153
- }
154
- }
155
- } ?>
156
- </select>
157
-
158
- <span class="howto" style="margin-left:10px;"><?php _e('Email', 'formidable') ?></span>
159
- &lt;<select name="options[reply_to]">
160
- <option value=""><?php echo get_option('admin_email') ?></option>
161
- <?php
162
- if(!empty($values['fields'])){
163
- foreach($values['fields'] as $val_key => $fo){
164
- if(in_array($fo['type'], $field_select)){ ?>
165
- <option value="<?php echo $fo['id'] ?>" <?php selected($values['reply_to'], $fo['id']); ?>><?php echo FrmAppHelper::truncate($fo['name'], 40) ?></option>
166
- <?php }else if($fo['type'] == 'data' and $fo['data_type'] != 'show'){
167
- if(isset($values['fields'][$val_key]['linked'])){ ?>
168
- <?php foreach($values['fields'][$val_key]['linked'] as $linked_field){
169
- if(!in_array($linked_field->type, $field_select)) continue; ?>
170
- <option value="<?php echo $fo['id'] ?>|<?php echo $linked_field->id ?>" <?php selected($values['reply_to'], $fo['id'] .'|'. $linked_field->id); ?>><?php echo $fo['name'] .': '. FrmAppHelper::truncate($linked_field->name, 40) ?></option>
171
- <?php }
172
- }
173
- }
174
- }
175
- } ?>
176
- </select>&gt;</td>
177
- </tr>
178
-
179
- <tr>
180
- <td><label><?php _e('Email Recipients', 'formidable') ?></label> <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('To send to multiple addresses, separate each address with a comma. You can use [admin_email] to dynamically use the address on your WordPress General Settings page. &lt;br/&gt;PRO only: Leave blank if you do not want email notifications for this form.', 'formidable') ?>" /></td>
181
- <td><input type="text" name="options[email_to]" value="<?php echo esc_attr($values['email_to']); ?>" class="frm_long_input" /></td>
182
- </tr>
183
- <?php if(!$frmpro_is_installed){ ?>
184
- <tr><td colspan="2">
185
- <?php FrmAppController::update_message('customize your email notifications and send auto responders'); ?>
186
- </td></tr>
187
- <?php } ?>
188
- <?php do_action('frm_additional_form_notification_options', $values); ?>
189
- </table>
190
  </div>
 
191
 
192
- <div class="html_settings tabs-panel has-right-sidebar columns-2" style="display:none;">
193
- <?php
194
- if(version_compare( $GLOBALS['wp_version'], '3.3.3', '<'))
195
- require(FRM_VIEWS_PATH .'/frm-forms/sidebar-html.php');
196
- ?>
197
 
198
  <div id="post-body-content" class="frm_top_container" style="margin-right:260px;">
199
  <p><label class="frm_primary_label"><?php _e('Before Fields', 'formidable') ?></label>
200
- <textarea name="options[before_html]" rows="4" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['before_html']) ?></textarea></p>
201
 
202
  <div id="add_html_fields">
203
  <?php
@@ -205,7 +136,7 @@
205
  foreach($values['fields'] as $field){
206
  if (apply_filters('frm_show_custom_html', true, $field['type'])){ ?>
207
  <p><label class="frm_primary_label"><?php echo $field['name'] ?></label>
208
- <textarea name="field_options[custom_html_<?php echo $field['id'] ?>]" rows="7" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($field['custom_html']) ?></textarea></p>
209
  <?php }
210
  unset($field);
211
  }
@@ -213,14 +144,10 @@
213
  </div>
214
 
215
  <p><label class="frm_primary_label"><?php _e('After Fields', 'formidable') ?></label>
216
- <textarea name="options[after_html]" rows="3" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['after_html']) ?></textarea></p>
217
  </div>
218
- <?php
219
- if(version_compare( $GLOBALS['wp_version'], '3.3.2', '>'))
220
- require(FRM_VIEWS_PATH .'/frm-forms/sidebar-html.php');
221
- ?>
222
  </div>
223
- <div id="post_settings" class="post_settings tabs-panel" style="display:none;">
224
  <?php if($frmpro_is_installed)
225
  FrmProFormsController::post_options($values);
226
  else
@@ -251,4 +178,31 @@
251
  <a class="button-secondary cancel" href="<?php echo admin_url('admin.php?page=formidable') ?>&amp;frm_action=edit&amp;id=<?php echo $id ?>"><?php _e('Cancel', 'formidable') ?></a>
252
  </p>
253
  </form>
254
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  <a href="?page=formidable-new" class="button add-new-h2"><?php _e('Add New', 'formidable'); ?></a>
5
  </h2>
6
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
 
 
 
 
 
 
 
 
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ <div id="poststuff">
10
+ <div id="post-body" class="metabox-holder columns-2">
11
+ <div id="post-body-content">
12
+ <div class="alignleft">
13
+ <?php FrmAppController::get_form_nav($id, true); ?>
14
+ </div>
15
+
16
  <form method="post">
17
  <p style="clear:left;">
18
  <input type="submit" value="<?php _e('Update', 'formidable') ?>" class="button-primary" />
37
  <h3 class="hndle"><span><?php echo FrmAppHelper::truncate(stripslashes($values['name']), 40) .' '. __('Settings', 'formidable') ?></span></h3>
38
  <div class="inside">
39
  <div class="contextual-help-tabs">
40
+ <ul class="frm-category-tabs<?php if(version_compare( $GLOBALS['wp_version'], '3.3.0', '<')) echo 'category-tabs" id="category-tabs'; ?>">
41
  <li class="tabs active"><a onclick="frmSettingsTab(jQuery(this),'advanced');"><?php _e('General', 'formidable') ?></a></li>
42
+ <li><a href="#notification_settings"><?php _e('Emails', 'formidable') ?></a></li>
43
+ <li><a href="#html_settings"><?php _e('Customize HTML', 'formidable') ?></a></li>
44
+ <li><a href="#post_settings"><?php _e('Create Posts', 'formidable') ?></a></li>
45
  <?php foreach($sections as $sec_name => $section){ ?>
46
  <li><a onclick="frmSettingsTab(jQuery(this),'<?php echo $sec_name ?>');"><?php echo ucfirst($sec_name) ?></a></li>
47
  <?php } ?>
51
  <table class="form-table">
52
  <tr>
53
  <td width="200px"><label><?php _e('Form ShortCodes', 'formidable') ?></label> <a href="http://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank"><img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('Key and id are generally synonymous. For more information on using this shortcode, click now.', 'formidable') ?>" /></a></td>
54
+ <td><input type="text" style="width:255px; border:none; background:transparent;" readonly="true" onclick="this.select();" onfocus="this.select();" value="[formidable id=<?php echo $id; ?> title=true description=true]" /> <?php _e('or', 'formidable') ?>
55
  <input type="text" style="width:200px; border:none; background:transparent;" readonly="true" onclick="this.select();" onfocus="this.select();" value="[formidable key=<?php echo $values['form_key']; ?>]" />
56
  </td>
57
  </tr>
70
  <td><input type="text" name="options[submit_value]" value="<?php echo esc_attr($values['submit_value']); ?>" /></td>
71
  </tr>
72
 
73
+ <tr><td valign="top" colspan="2"><label><?php _e('Action After Form Submission', 'formidable') ?></label><br/>
74
  <?php if(!$frmpro_is_installed){ ?>
75
  <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('You must upgrade to Formidable Pro to get access to the second two options.', 'formidable') ?>" />
76
  <?php } ?>
77
+
 
78
  <input type="radio" name="options[success_action]" id="success_action_message" value="message" <?php checked($values['success_action'], 'message') ?> /> <label for="success_action_message"><?php _e('Display a Message', 'formidable') ?></label>
79
  <input type="radio" name="options[success_action]" id="success_action_page" value="page" <?php checked($values['success_action'], 'page') ?> <?php if(!$frmpro_is_installed) echo 'disabled="disabled" '; ?>/> <label for="success_action_page" <?php echo $pro_feature ?>><?php _e('Display content from another page', 'formidable') ?></label>
80
  <input type="radio" name="options[success_action]" id="success_action_redirect" value="redirect" <?php checked($values['success_action'], 'redirect') ?> <?php if(!$frmpro_is_installed) echo 'disabled="disabled" '; ?>/> <label for="success_action_redirect" <?php echo $pro_feature ?>><?php _e('Redirect to URL', 'formidable') ?></label>
81
  </td>
82
  </tr>
83
 
84
+ <tr class="success_action_redirect_box success_action_box" <?php echo ($values['success_action'] == 'redirect') ? '' : 'style="display:none;"'; ?>><td valign="top" colspan="2"><label><?php _e('Redirect to URL', 'formidable') ?></label>
85
+ <input type="text" name="options[success_url]" id="success_url" value="<?php if(isset($values['success_url'])) echo esc_attr($values['success_url']); ?>" size="55"></td>
 
86
  </tr>
87
 
88
+ <tr class="success_action_message_box success_action_box" <?php echo ($values['success_action'] == 'message') ? '' : 'style="display:none;"'; ?>><td valign="top" colspan="2"><label><?php _e('Confirmation Message', 'formidable') ?></label>
89
+ <textarea id="success_msg" name="options[success_msg]" cols="50" rows="4" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea($values['success_msg']); ?></textarea> <br/>
 
90
  <div class="frm_show_form_opt">
91
  <input type="checkbox" name="options[show_form]" id="show_form" value="1" <?php checked($values['show_form'], 1) ?> /> <label for="show_form"><?php _e('Show the form with the success message.', 'formidable')?></label>
92
  </div>
110
  </table>
111
  </div>
112
 
113
+ <?php
114
+ $first_email = true;
115
+ foreach($values['notification'] as $email_key => $notification){
116
+ include(FRM_VIEWS_PATH .'/frm-forms/notification.php');
117
+ unset($email_key);
118
+ unset($notification);
119
+ $first_email = false;
120
+ }
121
+ if($frmpro_is_installed){ ?>
122
+ <div id="frm_email_add_button" class="notification_settings hide_with_tabs" style="display:none;margin-top:10px;margin-left:150px;">
123
+ <a href="javascript:frmAddEmailList(<?php echo $values['id'] ?>)" class="button-secondary">+ <?php _e('Add Notification', 'formidable') ?></a></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  </div>
125
+ <?php } ?>
126
 
127
+ <div id="html_settings" class="tabs-panel" style="display:none;">
 
 
 
 
128
 
129
  <div id="post-body-content" class="frm_top_container" style="margin-right:260px;">
130
  <p><label class="frm_primary_label"><?php _e('Before Fields', 'formidable') ?></label>
131
+ <textarea name="options[before_html]" rows="4" id="before_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea(stripslashes($values['before_html'])) ?></textarea></p>
132
 
133
  <div id="add_html_fields">
134
  <?php
136
  foreach($values['fields'] as $field){
137
  if (apply_filters('frm_show_custom_html', true, $field['type'])){ ?>
138
  <p><label class="frm_primary_label"><?php echo $field['name'] ?></label>
139
+ <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>
140
  <?php }
141
  unset($field);
142
  }
144
  </div>
145
 
146
  <p><label class="frm_primary_label"><?php _e('After Fields', 'formidable') ?></label>
147
+ <textarea name="options[after_html]" rows="3" id="after_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea(stripslashes($values['after_html'])) ?></textarea></p>
148
  </div>
 
 
 
 
149
  </div>
150
+ <div id="post_settings" class="tabs-panel" style="display:none;">
151
  <?php if($frmpro_is_installed)
152
  FrmProFormsController::post_options($values);
153
  else
178
  <a class="button-secondary cancel" href="<?php echo admin_url('admin.php?page=formidable') ?>&amp;frm_action=edit&amp;id=<?php echo $id ?>"><?php _e('Cancel', 'formidable') ?></a>
179
  </p>
180
  </form>
181
+
182
+
183
+ </div>
184
+ <div id="postbox-container-1">
185
+ <?php if(!isset($hide_preview) or !$hide_preview){
186
+ if (!$values['is_template']){ ?>
187
+ <p class="howto" style="margin-top:0;"><?php _e('Insert into a post, page or text widget', 'formidable') ?>
188
+ <input type="text" style="text-align:center;font-weight:bold;width:100%;" readonly="true" onclick="this.select();" onfocus="this.select();" value="[formidable id=<?php echo $id; ?>]" /></p>
189
+ <?php } ?>
190
+
191
+ <p class="frm_orange"><a href="<?php echo FrmFormsHelper::get_direct_link($values['form_key']); ?>" target="_blank"><?php _e('Preview', 'formidable') ?></a>
192
+ <?php global $frm_settings;
193
+ if ($frm_settings->preview_page_id > 0){ ?>
194
+ <?php _e('or', 'formidable') ?>
195
+ <a href="<?php echo add_query_arg('form', $values['form_key'], get_permalink($frm_settings->preview_page_id)) ?>" target="_blank"><?php _e('Preview in Current Theme', 'formidable') ?></a>
196
+ <?php } ?>
197
+ </p>
198
+ <?php
199
+ } ?>
200
+
201
+ <?php include(FRM_VIEWS_PATH .'/frm-forms/mb_insert_fields.php') ?>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ <script type="text/javascript">
207
+ __FRMURL='<?php echo $frm_ajax_url ?>';
208
+ </script>
classes/views/frm-forms/sidebar-html.php DELETED
@@ -1,25 +0,0 @@
1
- <div id="postbox-container-1" class="<?php echo FrmAppController::get_postbox_class(); ?> frm_html_legend postbox" style="width:240px;min-width:100px;">
2
- <h3><?php _e('Key', 'formidable') ?></h3>
3
- <div class="inside">
4
- <ul>
5
- <li><b><?php _e('Form Name', 'formidable') ?>:</b> <pre>[form_name]</pre></li>
6
- <li><b><?php _e('Form Description', 'formidable') ?>:</b> <pre>[form_description]</pre></li>
7
- <li><b><?php _e('Form Key', 'formidable') ?>:</b> <pre>[form_key]</pre></li>
8
- <li><b><?php _e('Delete Entry Link', 'formidable') ?>:</b> <pre>[deletelink]</pre></li>
9
- </ul>
10
- <ul>
11
- <li><b><?php _e('Field Id', 'formidable') ?>:</b> <pre>[id]</pre></li>
12
- <li><b><?php _e('Field Key', 'formidable') ?>:</b> <pre>[key]</pre></li>
13
- <li><b><?php _e('Field Name', 'formidable') ?>:</b> <pre>[field_name]</pre></li>
14
- <li><b><?php _e('Field Description', 'formidable') ?>:</b> <pre>[description]</pre></li>
15
- <li><b><?php _e('Label Position', 'formidable') ?>:</b> <pre>[label_position]</pre></li>
16
- <li><b><?php _e('Required label', 'formidable') ?>:</b> <pre>[required_label]</pre></li>
17
- <li><b><?php _e('Input Field', 'formidable') ?>:</b> <pre>[input]</pre><br/>
18
- <?php _e('Show a single radio or checkbox option by replacing "1" with the order of the option', 'formidable') ?>: <pre>[input opt=1]</pre><br/>
19
- <?php _e('Hide the option labels', 'formidable') ?>: <pre>[input label=0]</pre>
20
- </li>
21
- <li><b><?php _e('Add class name if field is required', 'formidable') ?>:</b> <pre>[required_class]</pre></li>
22
- <li><b><?php _e('Add class name if field has an error on form submit', 'formidable') ?>:</b> <pre>[error_class]</pre></li>
23
- </ul>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/views/frm-forms/translate.php CHANGED
@@ -4,7 +4,6 @@
4
  <a href="?page=formidable-new" class="button add-new-h2"><?php _e('Add New', 'formidable'); ?></a>
5
  </h2>
6
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
7
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
8
  <div class="alignright">
9
  <div id="postbox-container-1">
10
  <?php if(!isset($hide_preview) or !$hide_preview){
4
  <a href="?page=formidable-new" class="button add-new-h2"><?php _e('Add New', 'formidable'); ?></a>
5
  </h2>
6
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
 
7
  <div class="alignright">
8
  <div id="postbox-container-1">
9
  <?php if(!isset($hide_preview) or !$hide_preview){
classes/views/frm-settings/form.php CHANGED
@@ -3,20 +3,19 @@
3
  <h2><?php _e('Form Settings', 'formidable'); ?></h2>
4
 
5
  <?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
6
- <?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
7
 
8
  <div id="poststuff" class="metabox-holder">
9
  <div id="post-body">
10
  <div class="meta-box-sortables">
11
  <div class="categorydiv postbox">
12
- <h3 class="hndle"><span><?php _e('Settings', 'formidable') ?></span></h3>
13
  <div class="inside">
14
  <div class="contextual-help-tabs">
15
- <ul <?php if(version_compare( $GLOBALS['wp_version'], '3.3.0', '<')) echo 'id="category-tabs" class="category-tabs"'; ?>>
16
- <li class="tabs active"><a onclick="frmSettingsTab(jQuery(this),'general');" style="cursor:pointer"><?php _e('General', 'formidable') ?></a></li>
17
- <li><a onclick="frmSettingsTab(jQuery(this),'styling');" style="cursor:pointer"><?php _e('Form Styling', 'formidable') ?></a></li>
18
  <?php foreach($sections as $sec_name => $section){ ?>
19
- <li><a onclick="frmSettingsTab(jQuery(this),'<?php echo $sec_name ?>');"><?php echo ucfirst($sec_name) ?></a></li>
20
  <?php } ?>
21
  </ul>
22
  </div>
@@ -142,6 +141,14 @@
142
 
143
  <tr class="form-field">
144
  <td valign="top"><?php _e('Default Messages', 'formidable'); ?> <img src="<?php echo FRM_IMAGES_URL ?>/tooltip.png" alt="?" class="frm_help" title="<?php _e('You can override the success message and submit button settings on individual forms.', 'formidable') ?>" /></td>
 
 
 
 
 
 
 
 
145
  <td>