Version Description
- Emailer now works for everyone! (hopefully)
- Optionally Reset HTML. Just clear out the box for the HTML for that field and hit update.
- PRO: Fixed collapsable section to use correct default HTML.
- PRO: Only call rich text javascript on entries pages
- PRO: A few small reports modifications. Report for the User ID field will show the percentage of your users who have submitted the form if you are allowing edits with only one submission per user.
Download this release
Release Info
Developer | sswells |
Plugin | Formidable Forms – Form Builder for WordPress |
Version | 1.02.01 |
Comparing to | |
See all releases |
Code changes from version 1.01.04 to 1.02.01
- classes/controllers/FrmAppController.php +7 -15
- classes/controllers/FrmEntriesController.php +25 -68
- classes/controllers/FrmFieldsController.php +4 -6
- classes/controllers/FrmFormsController.php +24 -23
- classes/controllers/FrmSettingsController.php +2 -2
- classes/helpers/FrmAppHelper.php +13 -9
- classes/helpers/FrmEntriesHelper.php +17 -10
- classes/helpers/FrmFieldsHelper.php +55 -11
- classes/helpers/FrmFormsHelper.php +10 -8
- classes/models/FrmEntry.php +22 -26
- classes/models/FrmEntryMeta.php +7 -2
- classes/models/FrmField.php +26 -52
- classes/models/FrmForm.php +7 -6
- classes/models/FrmNotification.php +32 -31
- classes/models/FrmSettings.php +12 -0
- classes/models/FrmUpdate.php +3 -4
- classes/templates/contact.php +15 -15
- classes/views/frm-entries/direct.php +2 -1
- classes/views/frm-entries/form.php +2 -2
- classes/views/frm-entries/frm-entry.php +13 -13
- classes/views/frm-entries/list.php +2 -2
- classes/views/frm-entries/new.php +2 -2
- classes/views/frm-fields/input.php +3 -4
- classes/views/frm-fields/single-option.php +1 -1
- classes/views/frm-forms/add_field.php +24 -25
- classes/views/frm-forms/add_field_links.php +36 -30
- classes/views/frm-forms/default-templates.php +10 -10
- classes/views/frm-forms/edit.php +5 -5
- classes/views/frm-forms/footer.php +9 -2
- classes/views/frm-forms/form.php +27 -27
- classes/views/frm-forms/list.php +43 -34
- classes/views/frm-forms/new-field-js.php +2 -8
- classes/views/frm-forms/new-option-js.php +1 -1
- classes/views/frm-forms/new-selection.php +3 -3
- classes/views/frm-forms/new.php +3 -3
- classes/views/frm-settings/form.php +2 -2
- classes/views/frm-statistics/list.php +2 -2
- classes/views/shared/errors.php +1 -1
- classes/views/shared/head.php +2 -2
- classes/views/shared/item-table-nav.php +3 -55
- classes/views/shared/nav.php +3 -3
- classes/views/shared/pagination.php +43 -0
- css/frm_admin.css +20 -6
- css/frm_display.css +2 -1
- formidable.php +1 -45
- images/rte.gif +0 -0
- js/formidable.js +61 -0
- js/jquery/jquery.editinplace.js +2 -2
- js/jquery/jquery.editinplace.packed.js +2 -2
- js/list-items.js +0 -51
- readme.txt +40 -6
classes/controllers/FrmAppController.php
CHANGED
@@ -27,7 +27,7 @@ class FrmAppController{
|
|
27 |
|
28 |
// Adds a settings link to the plugins page
|
29 |
function settings_link($links, $file){
|
30 |
-
$settings = '<a href="'.admin_url('admin.php?page='.FRM_PLUGIN_NAME).'">' . __('Settings') . '</a>';
|
31 |
array_unshift($links, $settings);
|
32 |
return $links;
|
33 |
}
|
@@ -66,26 +66,20 @@ class FrmAppController{
|
|
66 |
}
|
67 |
|
68 |
function head(){
|
69 |
-
$css_file =
|
70 |
-
$
|
71 |
-
|
72 |
-
require_once(FRM_VIEWS_PATH . '/shared/head.php');
|
73 |
}
|
74 |
|
75 |
function admin_js(){
|
76 |
wp_enqueue_script('jQuery');
|
77 |
-
wp_enqueue_script('jQuery-ui
|
78 |
-
wp_enqueue_script('jQuery-in-place-edit-patched', FRM_URL.'/js/jquery/jquery.editinplace.packed.js');
|
79 |
-
|
80 |
-
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
|
81 |
-
if ( user_can_richedit() )
|
82 |
-
wp_enqueue_script('editor');
|
83 |
add_thickbox();
|
84 |
}
|
85 |
|
86 |
function front_head(){
|
87 |
if (IS_WPMU){
|
88 |
-
$db_version = 1.
|
89 |
$old_db_version = get_option('frm_db_version');
|
90 |
if ($db_version != $old_db_version)
|
91 |
$this->install();
|
@@ -163,11 +157,9 @@ class FrmAppController{
|
|
163 |
name varchar(255) default NULL,
|
164 |
description text default NULL,
|
165 |
form_id int(11) default NULL,
|
166 |
-
parent_item_id int(11) default NULL,
|
167 |
created_at datetime NOT NULL,
|
168 |
PRIMARY KEY (id),
|
169 |
-
KEY form_id (form_id)
|
170 |
-
KEY parent_item_id (parent_item_id)
|
171 |
) {$charset_collate};";
|
172 |
|
173 |
dbDelta($sql);
|
27 |
|
28 |
// Adds a settings link to the plugins page
|
29 |
function settings_link($links, $file){
|
30 |
+
$settings = '<a href="'.admin_url('admin.php?page='.FRM_PLUGIN_NAME).'">' . __('Settings', FRM_PLUGIN_NAME) . '</a>';
|
31 |
array_unshift($links, $settings);
|
32 |
return $links;
|
33 |
}
|
66 |
}
|
67 |
|
68 |
function head(){
|
69 |
+
$css_file = FRM_URL. '/css/frm_admin.css';
|
70 |
+
$js_file = FRM_URL . '/js/formidable.js';
|
71 |
+
require(FRM_VIEWS_PATH . '/shared/head.php');
|
|
|
72 |
}
|
73 |
|
74 |
function admin_js(){
|
75 |
wp_enqueue_script('jQuery');
|
76 |
+
wp_enqueue_script('jQuery-ui', FRM_URL.'/js/jquery/jquery-ui-1.7.2.min.js', '', '1.7.2');
|
|
|
|
|
|
|
|
|
|
|
77 |
add_thickbox();
|
78 |
}
|
79 |
|
80 |
function front_head(){
|
81 |
if (IS_WPMU){
|
82 |
+
$db_version = 1.01; // this is the version of the database we're moving to
|
83 |
$old_db_version = get_option('frm_db_version');
|
84 |
if ($db_version != $old_db_version)
|
85 |
$this->install();
|
157 |
name varchar(255) default NULL,
|
158 |
description text default NULL,
|
159 |
form_id int(11) default NULL,
|
|
|
160 |
created_at datetime NOT NULL,
|
161 |
PRIMARY KEY (id),
|
162 |
+
KEY form_id (form_id)
|
|
|
163 |
) {$charset_collate};";
|
164 |
|
165 |
dbDelta($sql);
|
classes/controllers/FrmEntriesController.php
CHANGED
@@ -4,13 +4,20 @@ class FrmEntriesController{
|
|
4 |
var $views;
|
5 |
|
6 |
function FrmEntriesController(){
|
7 |
-
|
8 |
}
|
9 |
|
10 |
function menu(){
|
11 |
global $frmpro_is_installed;
|
12 |
-
if(!$frmpro_is_installed)
|
13 |
-
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Pro Entries', 'Pro Entries', 8, FRM_PLUGIN_NAME.'-entries',array($this,'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
function list_entries(){
|
@@ -22,62 +29,13 @@ class FrmEntriesController{
|
|
22 |
if ($id) $form = $frm_form->getOne($id);
|
23 |
else if ($key) $form = $frm_form->getOne($key);
|
24 |
if (!$form or $form->is_template or $form->status == 'draft')
|
25 |
-
return 'Please select a valid form';
|
26 |
else if ($form->logged_in and !$user_ID)
|
27 |
-
return 'You must log in';
|
28 |
else
|
29 |
return FrmEntriesController::get_form(FRM_VIEWS_PATH.'/frm-entries/frm-entry.php', $form, $title, $description);
|
30 |
}
|
31 |
|
32 |
-
function new_entry($form){
|
33 |
-
global $frm_form, $frm_field, $frm_entry, $frm_entry_meta, $frm_recaptcha_enabled, $user_ID;
|
34 |
-
$fields = $frm_field->getAll("fi.form_id='$form->id'", ' ORDER BY field_order');
|
35 |
-
$values = FrmEntriesHelper::setup_new_vars($fields);
|
36 |
-
$form_name = $form->name;
|
37 |
-
$form_options = stripslashes_deep(unserialize($form->options));
|
38 |
-
$submit = isset($form_options['submit_value'])?$form_options['submit_value']:'Submit';
|
39 |
-
|
40 |
-
$params = $this->get_params($form);
|
41 |
-
$message = '';
|
42 |
-
$errors = '';
|
43 |
-
|
44 |
-
do_action('frm_display_form_action', $params, $fields, $form, $title, $description);
|
45 |
-
if (apply_filters('frm_continue_to_new', true)){
|
46 |
-
$values = FrmEntriesHelper::setup_new_vars($fields);
|
47 |
-
require_once(FRM_VIEWS_PATH.'/frm-entries/new.php');
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
function create($form){
|
52 |
-
global $frm_form, $frm_field, $frm_entry, $frm_entry_meta, $frm_recaptcha_enabled, $user_ID;
|
53 |
-
$fields = $frm_field->getAll("fi.form_id='$form->id'", ' ORDER BY field_order');
|
54 |
-
$values = FrmEntriesHelper::setup_new_vars($fields);
|
55 |
-
$form_name = $form->name;
|
56 |
-
$form_options = stripslashes_deep(unserialize($form->options));
|
57 |
-
|
58 |
-
$submit = isset($form_options['submit_value'])?$form_options['submit_value']:'Submit';
|
59 |
-
$failed_message = "We're sorry. There was an error processing your responses.";
|
60 |
-
$saved_message = (isset($form_options['success_msg']) && $form_options['success_msg'] != '') ? $form_options['success_msg'] :"Your responses were successfully submitted. Thank you!";
|
61 |
-
|
62 |
-
$params = $this->get_params($form);
|
63 |
-
$message = '';
|
64 |
-
|
65 |
-
$errors = $frm_entry->validate($_POST);
|
66 |
-
|
67 |
-
if( count($errors) > 0 ){
|
68 |
-
$values = FrmEntriesHelper::setup_new_vars($fields);
|
69 |
-
require_once(FRM_VIEWS_PATH.'/frm-entries/new.php');
|
70 |
-
}else{
|
71 |
-
do_action('frm_validate_form_creation', $params, $fields, $form, $title, $description);
|
72 |
-
if (apply_filters('frm_continue_to_create', true)){
|
73 |
-
if ($frm_entry->create( $_POST )){
|
74 |
-
echo $saved_message;
|
75 |
-
}else
|
76 |
-
echo $failed_message;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
function get_form($filename, $form, $title, $description) {
|
82 |
if (is_file($filename)) {
|
83 |
ob_start();
|
@@ -94,25 +52,24 @@ class FrmEntriesController{
|
|
94 |
|
95 |
if(!$form)
|
96 |
$form = $frm_form->getAll('',' ORDER BY name',' LIMIT 1');
|
|
|
97 |
$action = apply_filters('frm_show_new_entry_page','new',$form);
|
98 |
-
$
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
$values[$var] = $frm_app_controller->get_param($var, $default);
|
|
|
|
|
|
|
|
|
101 |
|
102 |
return $values;
|
103 |
}
|
104 |
-
|
105 |
-
function route($form=false){
|
106 |
-
global $frm_app_controller;
|
107 |
-
$action = $frm_app_controller->get_param('action');
|
108 |
-
if (!$form)
|
109 |
-
$form = $frm_app_controller->get_param('form');
|
110 |
-
$action = apply_filters('frm_show_new_entry_page', $action, $form);
|
111 |
-
if($action=='create')
|
112 |
-
return $this->create($form);
|
113 |
-
else
|
114 |
-
return $this->new_entry($form);
|
115 |
-
}
|
116 |
|
117 |
}
|
118 |
?>
|
4 |
var $views;
|
5 |
|
6 |
function FrmEntriesController(){
|
7 |
+
add_action('admin_menu', array( $this, 'menu' ), 20);
|
8 |
}
|
9 |
|
10 |
function menu(){
|
11 |
global $frmpro_is_installed;
|
12 |
+
if(!$frmpro_is_installed){
|
13 |
+
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' |'. __('Pro Entries', FRM_PLUGIN_NAME), __('Pro Entries', FRM_PLUGIN_NAME), 8, FRM_PLUGIN_NAME.'-entries',array($this,'list_entries'));
|
14 |
+
add_action('admin_head-'.FRM_PLUGIN_NAME.'_page_'.FRM_PLUGIN_NAME.'-entries', array($this,'head'));
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
function head(){
|
19 |
+
$css_file = FRM_URL. '/css/frm_admin.css';
|
20 |
+
include(FRM_VIEWS_PATH . '/shared/head.php');
|
21 |
}
|
22 |
|
23 |
function list_entries(){
|
29 |
if ($id) $form = $frm_form->getOne($id);
|
30 |
else if ($key) $form = $frm_form->getOne($key);
|
31 |
if (!$form or $form->is_template or $form->status == 'draft')
|
32 |
+
return __('Please select a valid form', FRM_PLUGIN_NAME);
|
33 |
else if ($form->logged_in and !$user_ID)
|
34 |
+
return __('You must log in', FRM_PLUGIN_NAME);
|
35 |
else
|
36 |
return FrmEntriesController::get_form(FRM_VIEWS_PATH.'/frm-entries/frm-entry.php', $form, $title, $description);
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
function get_form($filename, $form, $title, $description) {
|
40 |
if (is_file($filename)) {
|
41 |
ob_start();
|
52 |
|
53 |
if(!$form)
|
54 |
$form = $frm_form->getAll('',' ORDER BY name',' LIMIT 1');
|
55 |
+
|
56 |
$action = apply_filters('frm_show_new_entry_page','new',$form);
|
57 |
+
$default_values = array('id' => '', 'form_name' => '', 'paged' => 1, 'form' => $form->id, 'form_id' => $form->id, 'field_id' => '', 'search' => '', 'sort' => '', 'sdir' => '', 'action' => $action);
|
58 |
+
|
59 |
+
$posted_form_id = $frm_app_controller->get_param('form_id');
|
60 |
+
if ($posted_form_id == '')
|
61 |
+
$posted_form_id = $frm_app_controller->get_param('form');
|
62 |
+
|
63 |
+
if ($form->id == $posted_form_id){
|
64 |
+
foreach ($default_values as $var => $default)
|
65 |
$values[$var] = $frm_app_controller->get_param($var, $default);
|
66 |
+
}else{
|
67 |
+
foreach ($default_values as $var => $default)
|
68 |
+
$values[$var] = $default;
|
69 |
+
}
|
70 |
|
71 |
return $values;
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
}
|
75 |
?>
|
classes/controllers/FrmFieldsController.php
CHANGED
@@ -18,13 +18,11 @@ class FrmFieldsController{
|
|
18 |
}
|
19 |
|
20 |
function create(){
|
21 |
-
global $frm_field
|
22 |
$field_data = $_POST['field'];
|
23 |
$form_id = $_POST['form_id'];
|
24 |
|
25 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars($field_data, $form_id));
|
26 |
-
if (isset($_POST['position']))
|
27 |
-
$field_values['field_order'] = $_POST['position'];
|
28 |
|
29 |
$field_id = $frm_field->create( $field_values );
|
30 |
|
@@ -142,12 +140,12 @@ class FrmFieldsController{
|
|
142 |
die();
|
143 |
}
|
144 |
|
145 |
-
|
146 |
function change_type($type){
|
147 |
-
global $
|
148 |
|
149 |
if ($frmpro_is_installed) return $type;
|
150 |
-
|
|
|
151 |
$types = array_keys($frm_field_selection);
|
152 |
if (!in_array($type, $types) && $type != 'captcha')
|
153 |
$type = 'text';
|
18 |
}
|
19 |
|
20 |
function create(){
|
21 |
+
global $frm_field;
|
22 |
$field_data = $_POST['field'];
|
23 |
$form_id = $_POST['form_id'];
|
24 |
|
25 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars($field_data, $form_id));
|
|
|
|
|
26 |
|
27 |
$field_id = $frm_field->create( $field_values );
|
28 |
|
140 |
die();
|
141 |
}
|
142 |
|
|
|
143 |
function change_type($type){
|
144 |
+
global $frmpro_is_installed;
|
145 |
|
146 |
if ($frmpro_is_installed) return $type;
|
147 |
+
|
148 |
+
$frm_field_selection = FrmFieldsHelper::field_selection();
|
149 |
$types = array_keys($frm_field_selection);
|
150 |
if (!in_array($type, $types) && $type != 'captcha')
|
151 |
$type = 'text';
|
classes/controllers/FrmFormsController.php
CHANGED
@@ -12,15 +12,15 @@ class FrmFormsController{
|
|
12 |
}
|
13 |
|
14 |
function menu(){
|
15 |
-
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Forms', 'Forms', 8, FRM_PLUGIN_NAME, array($this,'route'));
|
16 |
-
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Create a Form', 'Create a Form', 8, FRM_PLUGIN_NAME.'-new', array($this,'new_form'));
|
17 |
-
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Templates', 'Templates', 8, FRM_PLUGIN_NAME.'-templates', array($this, 'template_list'));
|
18 |
}
|
19 |
|
20 |
function head(){
|
21 |
-
$css_file = array(
|
22 |
-
$js_file = array(FRM_URL . '/js/
|
23 |
-
|
24 |
}
|
25 |
|
26 |
function list_form(){
|
@@ -35,12 +35,13 @@ class FrmFormsController{
|
|
35 |
}
|
36 |
|
37 |
function new_form(){
|
38 |
-
global $frm_app_controller, $frm_form, $
|
39 |
|
40 |
$action = $frm_app_controller->get_param('action');
|
41 |
if ($action == 'create')
|
42 |
return $this->create();
|
43 |
-
else if ($action == 'new'){
|
|
|
44 |
$values = FrmFormsHelper::setup_new_vars();
|
45 |
$id = $frm_form->create( $values );
|
46 |
require_once(FRM_VIEWS_PATH.'/frm-forms/new.php');
|
@@ -51,19 +52,20 @@ class FrmFormsController{
|
|
51 |
}
|
52 |
|
53 |
function create(){
|
54 |
-
global $frm_app_controller, $frm_app_helper, $
|
55 |
$errors = $frm_form->validate($_POST);
|
56 |
$id = $frm_app_controller->get_param('id');
|
57 |
|
58 |
if( count($errors) > 0 ){
|
|
|
59 |
$record = $frm_form->getOne( $id );
|
60 |
$fields = $frm_field->getAll("fi.form_id=$id", ' ORDER BY field_order');
|
61 |
-
$values =
|
62 |
require_once(FRM_VIEWS_PATH.'/frm-forms/new.php');
|
63 |
}else{
|
64 |
$items = $frm_entry->getAll('',' ORDER BY it.name');
|
65 |
$record = $frm_form->update( $id, $_POST, true );
|
66 |
-
$message =
|
67 |
$params = $this->get_params();
|
68 |
return $this->display_forms_list($params, $message);
|
69 |
}
|
@@ -99,7 +101,7 @@ class FrmFormsController{
|
|
99 |
return $this->get_edit_vars($id, $errors);
|
100 |
}else{
|
101 |
$record = $frm_form->update( $_POST['id'], $_POST );
|
102 |
-
$message =
|
103 |
return $this->get_edit_vars($id, '', $message);
|
104 |
}
|
105 |
}
|
@@ -109,11 +111,11 @@ class FrmFormsController{
|
|
109 |
|
110 |
$params = $this->get_params();
|
111 |
$record = $frm_form->duplicate( $params['id'], $params['template'] );
|
112 |
-
$message = ($params['template'])?('Form template was Successfully Created'):('Form was Successfully Copied');
|
113 |
if ($record)
|
114 |
return $this->get_edit_vars($record, '', $message, true);
|
115 |
else
|
116 |
-
return $this->display_forms_list($params, 'There was a problem creating new template.');
|
117 |
}
|
118 |
|
119 |
function page_preview(){
|
@@ -122,7 +124,7 @@ class FrmFormsController{
|
|
122 |
$params = $this->get_params();
|
123 |
if (!$params['form']) return;
|
124 |
$form = $frm_form->getOne($params['form']);
|
125 |
-
|
126 |
}
|
127 |
|
128 |
function preview(){
|
@@ -138,7 +140,7 @@ class FrmFormsController{
|
|
138 |
|
139 |
$plugin = FrmAppController::get_param('plugin');
|
140 |
$controller = FrmAppController::get_param('controller');
|
141 |
-
$key = (isset($_GET['form'])
|
142 |
$form = $frm_form->getAll("form_key='$key'",'',' LIMIT 1');
|
143 |
if (!$form) $form = $frm_form->getAll('','',' LIMIT 1');
|
144 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
@@ -153,7 +155,7 @@ class FrmFormsController{
|
|
153 |
$params = $this->get_params();
|
154 |
$message = '';
|
155 |
if ($frm_form->destroy( $params['id'] ))
|
156 |
-
$message =
|
157 |
$this->display_forms_list($params, $message, '', 1);
|
158 |
}
|
159 |
|
@@ -267,14 +269,14 @@ class FrmFormsController{
|
|
267 |
}
|
268 |
|
269 |
function get_edit_vars($id, $errors = '', $message='', $create_link=false){
|
270 |
-
global $frm_app_helper, $
|
271 |
$record = $frm_form->getOne( $id );
|
272 |
$items = $frm_entry->getAll('',' ORDER BY it.name');
|
273 |
-
|
274 |
$fields = $frm_field->getAll("fi.form_id=$id", ' ORDER BY field_order');
|
275 |
-
$values =
|
276 |
if (isset($values['default_template']) && $values['default_template'])
|
277 |
-
wp_die('That template cannot be edited');
|
278 |
else if($create_link)
|
279 |
require_once(FRM_VIEWS_PATH.'/frm-forms/new.php');
|
280 |
else
|
@@ -291,8 +293,7 @@ class FrmFormsController{
|
|
291 |
}
|
292 |
|
293 |
function route(){
|
294 |
-
|
295 |
-
$action = $frm_app_controller->get_param('action');
|
296 |
if($action=='new')
|
297 |
return $this->new_form();
|
298 |
else if($action=='create')
|
12 |
}
|
13 |
|
14 |
function menu(){
|
15 |
+
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | '. __('Forms', FRM_PLUGIN_NAME), __('Forms', FRM_PLUGIN_NAME), 8, FRM_PLUGIN_NAME, array($this,'route'));
|
16 |
+
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | '. __('Create a Form', FRM_PLUGIN_NAME), __('Create a Form', FRM_PLUGIN_NAME), 8, FRM_PLUGIN_NAME.'-new', array($this,'new_form'));
|
17 |
+
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | '. __('Templates', FRM_PLUGIN_NAME), __('Templates', FRM_PLUGIN_NAME), 8, FRM_PLUGIN_NAME.'-templates', array($this, 'template_list'));
|
18 |
}
|
19 |
|
20 |
function head(){
|
21 |
+
$css_file = array(FRM_URL.'/css/ui-lightness/jquery-ui-1.7.2.custom.css', FRM_URL. '/css/frm_admin.css');
|
22 |
+
$js_file = array(FRM_URL . '/js/formidable.js', FRM_URL . '/js/jquery/jquery-ui-themepicker.js', FRM_URL.'/js/jquery/jquery.editinplace.packed.js');
|
23 |
+
require(FRM_VIEWS_PATH . '/shared/head.php');
|
24 |
}
|
25 |
|
26 |
function list_form(){
|
35 |
}
|
36 |
|
37 |
function new_form(){
|
38 |
+
global $frm_app_controller, $frm_form, $frmpro_is_installed;
|
39 |
|
40 |
$action = $frm_app_controller->get_param('action');
|
41 |
if ($action == 'create')
|
42 |
return $this->create();
|
43 |
+
else if ($action == 'new'){
|
44 |
+
$frm_field_selection = FrmFieldsHelper::field_selection();
|
45 |
$values = FrmFormsHelper::setup_new_vars();
|
46 |
$id = $frm_form->create( $values );
|
47 |
require_once(FRM_VIEWS_PATH.'/frm-forms/new.php');
|
52 |
}
|
53 |
|
54 |
function create(){
|
55 |
+
global $frm_app_controller, $frm_app_helper, $frm_entry, $frm_form, $frm_field, $frmpro_is_installed;
|
56 |
$errors = $frm_form->validate($_POST);
|
57 |
$id = $frm_app_controller->get_param('id');
|
58 |
|
59 |
if( count($errors) > 0 ){
|
60 |
+
$frm_field_selection = FrmFieldsHelper::field_selection();
|
61 |
$record = $frm_form->getOne( $id );
|
62 |
$fields = $frm_field->getAll("fi.form_id=$id", ' ORDER BY field_order');
|
63 |
+
$values = FrmAppHelper::setup_edit_vars($record,'forms',$fields,true);
|
64 |
require_once(FRM_VIEWS_PATH.'/frm-forms/new.php');
|
65 |
}else{
|
66 |
$items = $frm_entry->getAll('',' ORDER BY it.name');
|
67 |
$record = $frm_form->update( $id, $_POST, true );
|
68 |
+
$message = __('Form was Successfully Created', FRM_PLUGIN_NAME);
|
69 |
$params = $this->get_params();
|
70 |
return $this->display_forms_list($params, $message);
|
71 |
}
|
101 |
return $this->get_edit_vars($id, $errors);
|
102 |
}else{
|
103 |
$record = $frm_form->update( $_POST['id'], $_POST );
|
104 |
+
$message = __('Form was Successfully Updated', FRM_PLUGIN_NAME);
|
105 |
return $this->get_edit_vars($id, '', $message);
|
106 |
}
|
107 |
}
|
111 |
|
112 |
$params = $this->get_params();
|
113 |
$record = $frm_form->duplicate( $params['id'], $params['template'] );
|
114 |
+
$message = ($params['template']) ? __('Form template was Successfully Created', FRM_PLUGIN_NAME) : __('Form was Successfully Copied', FRM_PLUGIN_NAME);
|
115 |
if ($record)
|
116 |
return $this->get_edit_vars($record, '', $message, true);
|
117 |
else
|
118 |
+
return $this->display_forms_list($params, __('There was a problem creating new template.', FRM_PLUGIN_NAME));
|
119 |
}
|
120 |
|
121 |
function page_preview(){
|
124 |
$params = $this->get_params();
|
125 |
if (!$params['form']) return;
|
126 |
$form = $frm_form->getOne($params['form']);
|
127 |
+
require(FRM_VIEWS_PATH.'/frm-entries/frm-entry.php');
|
128 |
}
|
129 |
|
130 |
function preview(){
|
140 |
|
141 |
$plugin = FrmAppController::get_param('plugin');
|
142 |
$controller = FrmAppController::get_param('controller');
|
143 |
+
$key = (isset($_GET['form']) ? $_GET['form'] : (isset($_POST['form']) ? $_POST['form'] : ''));
|
144 |
$form = $frm_form->getAll("form_key='$key'",'',' LIMIT 1');
|
145 |
if (!$form) $form = $frm_form->getAll('','',' LIMIT 1');
|
146 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
155 |
$params = $this->get_params();
|
156 |
$message = '';
|
157 |
if ($frm_form->destroy( $params['id'] ))
|
158 |
+
$message = __('Form was Successfully Deleted', FRM_PLUGIN_NAME);
|
159 |
$this->display_forms_list($params, $message, '', 1);
|
160 |
}
|
161 |
|
269 |
}
|
270 |
|
271 |
function get_edit_vars($id, $errors = '', $message='', $create_link=false){
|
272 |
+
global $frm_app_helper, $frm_entry, $frm_form, $frm_field, $frmpro_is_installed;
|
273 |
$record = $frm_form->getOne( $id );
|
274 |
$items = $frm_entry->getAll('',' ORDER BY it.name');
|
275 |
+
$frm_field_selection = FrmFieldsHelper::field_selection();
|
276 |
$fields = $frm_field->getAll("fi.form_id=$id", ' ORDER BY field_order');
|
277 |
+
$values = FrmAppHelper::setup_edit_vars($record,'forms',$fields,true);
|
278 |
if (isset($values['default_template']) && $values['default_template'])
|
279 |
+
wp_die(__('That template cannot be edited', FRM_PLUGIN_NAME));
|
280 |
else if($create_link)
|
281 |
require_once(FRM_VIEWS_PATH.'/frm-forms/new.php');
|
282 |
else
|
293 |
}
|
294 |
|
295 |
function route(){
|
296 |
+
$action = FrmAppController::get_param('action');
|
|
|
297 |
if($action=='new')
|
298 |
return $this->new_form();
|
299 |
else if($action=='create')
|
classes/controllers/FrmSettingsController.php
CHANGED
@@ -8,7 +8,7 @@ class FrmSettingsController{
|
|
8 |
}
|
9 |
|
10 |
function menu(){
|
11 |
-
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Settings', 'Settings', 8, FRM_PLUGIN_NAME.'-settings', array($this,'route'));
|
12 |
}
|
13 |
|
14 |
function pro_menu(){
|
@@ -38,7 +38,7 @@ class FrmSettingsController{
|
|
38 |
|
39 |
if( empty($errors) ){
|
40 |
$frm_settings->store();
|
41 |
-
$message = 'Settings Saved';
|
42 |
}
|
43 |
|
44 |
require_once(FRM_VIEWS_PATH . '/frm-settings/form.php');
|
8 |
}
|
9 |
|
10 |
function menu(){
|
11 |
+
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | '. __('Settings', FRM_PLUGIN_NAME), __('Settings', FRM_PLUGIN_NAME), 8, FRM_PLUGIN_NAME.'-settings', array($this,'route'));
|
12 |
}
|
13 |
|
14 |
function pro_menu(){
|
38 |
|
39 |
if( empty($errors) ){
|
40 |
$frm_settings->store();
|
41 |
+
$message = __('Settings Saved', FRM_PLUGIN_NAME);
|
42 |
}
|
43 |
|
44 |
require_once(FRM_VIEWS_PATH . '/frm-settings/form.php');
|
classes/helpers/FrmAppHelper.php
CHANGED
@@ -54,6 +54,7 @@ class FrmAppHelper{
|
|
54 |
return $key;
|
55 |
}
|
56 |
|
|
|
57 |
function setup_edit_vars($record, $table, $fields='', $default=false){
|
58 |
if(!$record) return false;
|
59 |
global $frm_entry_meta, $frm_form, $frm_app_controller, $frm_settings;
|
@@ -63,7 +64,7 @@ class FrmAppHelper{
|
|
63 |
|
64 |
foreach (array('name' => $record->name, 'description' => $record->description) as $var => $default_val)
|
65 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default_val));
|
66 |
-
|
67 |
$values['fields'] = array();
|
68 |
if ($fields){
|
69 |
foreach($fields as $field){
|
@@ -79,19 +80,22 @@ class FrmAppHelper{
|
|
79 |
$new_value = stripslashes_deep(maybe_unserialize($new_value));
|
80 |
|
81 |
$field_array = array('id' => $field->id,
|
82 |
-
'value' => $new_value,
|
83 |
-
'default_value' => stripslashes($field->default_value),
|
84 |
'name' => stripslashes($field->name),
|
85 |
'description' => stripslashes($field->description),
|
86 |
'type' => apply_filters('frm_field_type',$field_type, $field),
|
87 |
-
'options' => stripslashes_deep(unserialize($field->options)),
|
88 |
'required' => $field->required,
|
89 |
'field_key' => $field->field_key,
|
90 |
'field_order' => $field->field_order,
|
91 |
'form_id' => $field->form_id);
|
92 |
|
93 |
-
foreach (array('size' => '','max' => '','label' => 'top','invalid' => '','required_indicator' => '*','blank' => '', 'clear_on_focus' => 0, 'custom_html' =>
|
94 |
-
$field_array[$opt] = ($_POST and isset($_POST['field_options'][$opt.'_'.$field->id]) ) ? $_POST['field_options'][$opt.'_'.$field->id] : (isset($field_options[$opt]) ? $field_options[$opt]: $default_opt);
|
|
|
|
|
|
|
95 |
|
96 |
$values['fields'][] = apply_filters('frm_setup_edit_fields_vars', stripslashes_deep($field_array), $field, $values['id']);
|
97 |
}
|
@@ -112,7 +116,7 @@ class FrmAppHelper{
|
|
112 |
}
|
113 |
|
114 |
$email = get_option('admin_email');
|
115 |
-
foreach (array('custom_style' => $frm_settings->custom_style, 'email_to' => $email, 'submit_value' =>
|
116 |
if (!isset($values[$opt]))
|
117 |
$values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
|
118 |
}
|
@@ -150,7 +154,7 @@ class FrmAppHelper{
|
|
150 |
return $message;
|
151 |
}
|
152 |
|
153 |
-
function display_recaptcha(
|
154 |
global $recaptcha_opt;
|
155 |
|
156 |
$format = <<<END
|
@@ -182,7 +186,7 @@ COMMENT_FORM;
|
|
182 |
return $sub . (($len < strlen($str)) ? $continue : '');
|
183 |
}
|
184 |
|
185 |
-
function prepend_and_or_where( $starts_with = ' WHERE', $where = '' ){
|
186 |
return (( $where == '' )?'':$starts_with . $where);
|
187 |
}
|
188 |
|
54 |
return $key;
|
55 |
}
|
56 |
|
57 |
+
//Editing a Form or Entry
|
58 |
function setup_edit_vars($record, $table, $fields='', $default=false){
|
59 |
if(!$record) return false;
|
60 |
global $frm_entry_meta, $frm_form, $frm_app_controller, $frm_settings;
|
64 |
|
65 |
foreach (array('name' => $record->name, 'description' => $record->description) as $var => $default_val)
|
66 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default_val));
|
67 |
+
$values['description'] = wpautop($values['description']);
|
68 |
$values['fields'] = array();
|
69 |
if ($fields){
|
70 |
foreach($fields as $field){
|
80 |
$new_value = stripslashes_deep(maybe_unserialize($new_value));
|
81 |
|
82 |
$field_array = array('id' => $field->id,
|
83 |
+
'value' => str_replace('"', '"', $new_value),
|
84 |
+
'default_value' => str_replace('"', '"', stripslashes($field->default_value)),
|
85 |
'name' => stripslashes($field->name),
|
86 |
'description' => stripslashes($field->description),
|
87 |
'type' => apply_filters('frm_field_type',$field_type, $field),
|
88 |
+
'options' => str_replace('"', '"', stripslashes_deep(unserialize($field->options))),
|
89 |
'required' => $field->required,
|
90 |
'field_key' => $field->field_key,
|
91 |
'field_order' => $field->field_order,
|
92 |
'form_id' => $field->form_id);
|
93 |
|
94 |
+
foreach (array('size' => '', 'max' => '', 'label' => 'top', 'invalid' => '', 'required_indicator' => '*', 'blank' => '', 'clear_on_focus' => 0, 'custom_html' => '', 'default_blank' => 0) as $opt => $default_opt)
|
95 |
+
$field_array[$opt] = ($_POST and isset($_POST['field_options'][$opt.'_'.$field->id]) ) ? $_POST['field_options'][$opt.'_'.$field->id] : (isset($field_options[$opt]) ? $field_options[$opt] : $default_opt);
|
96 |
+
|
97 |
+
if ($field_array['custom_html'] == '')
|
98 |
+
$field_array['custom_html'] = FrmFieldsHelper::get_default_html($field_type);
|
99 |
|
100 |
$values['fields'][] = apply_filters('frm_setup_edit_fields_vars', stripslashes_deep($field_array), $field, $values['id']);
|
101 |
}
|
116 |
}
|
117 |
|
118 |
$email = get_option('admin_email');
|
119 |
+
foreach (array('custom_style' => $frm_settings->custom_style, 'email_to' => $email, 'submit_value' => $frm_settings->submit_value, 'success_msg' => $frm_settings->success_msg) as $opt => $default){
|
120 |
if (!isset($values[$opt]))
|
121 |
$values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
|
122 |
}
|
154 |
return $message;
|
155 |
}
|
156 |
|
157 |
+
function display_recaptcha() {
|
158 |
global $recaptcha_opt;
|
159 |
|
160 |
$format = <<<END
|
186 |
return $sub . (($len < strlen($str)) ? $continue : '');
|
187 |
}
|
188 |
|
189 |
+
function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ){
|
190 |
return (( $where == '' )?'':$starts_with . $where);
|
191 |
}
|
192 |
|
classes/helpers/FrmEntriesHelper.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
class FrmEntriesHelper{
|
4 |
|
5 |
-
function setup_new_vars($fields){
|
6 |
global $frm_app_controller, $frm_form, $frm_settings;
|
7 |
$values = array();
|
8 |
foreach (array('name' => '', 'description' => '', 'item_key' => '') as $var => $default)
|
@@ -14,11 +14,15 @@ class FrmEntriesHelper{
|
|
14 |
$default = $field->default_value;
|
15 |
|
16 |
$field_options = unserialize($field->field_options);
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
if ($field->type != 'checkbox')
|
19 |
-
$new_value = apply_filters('frm_get_default_value',
|
20 |
|
21 |
-
$new_value = stripslashes_deep(maybe_unserialize($new_value));
|
22 |
|
23 |
$field_array = array('id' => $field->id,
|
24 |
'value' => $new_value,
|
@@ -26,18 +30,21 @@ class FrmEntriesHelper{
|
|
26 |
'name' => stripslashes($field->name),
|
27 |
'description' => stripslashes($field->description),
|
28 |
'type' => apply_filters('frm_field_type',$field->type, $field),
|
29 |
-
'options' => stripslashes_deep(unserialize($field->options)),
|
30 |
'required' => $field->required,
|
31 |
'field_key' => $field->field_key,
|
32 |
'field_order' => $field->field_order,
|
33 |
'form_id' => $field->form_id);
|
34 |
|
35 |
-
foreach (array('size' => '','max' => '','label' => 'top','invalid' => '','required_indicator' => '','blank' => '', 'clear_on_focus' => 0, 'custom_html' =>
|
36 |
$field_array[$opt] = (isset($field_options[$opt]) && $field_options[$opt] != '') ? $field_options[$opt] : $default_opt;
|
|
|
|
|
|
|
37 |
|
38 |
$values['fields'][] = apply_filters('frm_setup_new_fields_vars', stripslashes_deep($field_array), $field);
|
39 |
|
40 |
-
if (!isset($form))
|
41 |
$form = $frm_form->getOne($field->form_id);
|
42 |
}
|
43 |
|
@@ -55,10 +62,10 @@ class FrmEntriesHelper{
|
|
55 |
$values['email_to'] = '';
|
56 |
|
57 |
if (!isset($values['submit_value']))
|
58 |
-
$values['submit_value'] =
|
59 |
|
60 |
if (!isset($values['success_msg']))
|
61 |
-
$values['success_msg'] =
|
62 |
|
63 |
if (!isset($values['akismet']))
|
64 |
$values['akismet'] = 0;
|
@@ -89,7 +96,7 @@ class FrmEntriesHelper{
|
|
89 |
<option value=""><?php echo $blank_label; ?></option>
|
90 |
<?php } ?>
|
91 |
<?php foreach($entries as $entry){ ?>
|
92 |
-
<option value="<?php echo $entry->id; ?>" <?php selected($field_value, $entry->id); ?>><?php echo (!empty($entry->name)) ? $entry->name : $entry->item_key; ?></option>
|
93 |
<?php } ?>
|
94 |
</select>
|
95 |
<?php
|
2 |
|
3 |
class FrmEntriesHelper{
|
4 |
|
5 |
+
function setup_new_vars($fields, $form='', $reset=false){
|
6 |
global $frm_app_controller, $frm_form, $frm_settings;
|
7 |
$values = array();
|
8 |
foreach (array('name' => '', 'description' => '', 'item_key' => '') as $var => $default)
|
14 |
$default = $field->default_value;
|
15 |
|
16 |
$field_options = unserialize($field->field_options);
|
17 |
+
if ($reset)
|
18 |
+
$new_value = $default;
|
19 |
+
else
|
20 |
+
$new_value = ($_POST and isset($_POST['item_meta'][$field->id])) ? $_POST['item_meta'][$field->id] : $default;
|
21 |
+
|
22 |
if ($field->type != 'checkbox')
|
23 |
+
$new_value = apply_filters('frm_get_default_value', stripslashes_deep($new_value));
|
24 |
|
25 |
+
$new_value = str_replace('"', '"', stripslashes_deep(maybe_unserialize($new_value)));
|
26 |
|
27 |
$field_array = array('id' => $field->id,
|
28 |
'value' => $new_value,
|
30 |
'name' => stripslashes($field->name),
|
31 |
'description' => stripslashes($field->description),
|
32 |
'type' => apply_filters('frm_field_type',$field->type, $field),
|
33 |
+
'options' => str_replace('"', '"', stripslashes_deep(unserialize($field->options))),
|
34 |
'required' => $field->required,
|
35 |
'field_key' => $field->field_key,
|
36 |
'field_order' => $field->field_order,
|
37 |
'form_id' => $field->form_id);
|
38 |
|
39 |
+
foreach (array('size' => '','max' => '','label' => 'top','invalid' => '','required_indicator' => '','blank' => '', 'clear_on_focus' => 0, 'custom_html' => '', 'default_blank' => 0) as $opt => $default_opt)
|
40 |
$field_array[$opt] = (isset($field_options[$opt]) && $field_options[$opt] != '') ? $field_options[$opt] : $default_opt;
|
41 |
+
|
42 |
+
if ($field_array['custom_html'] == '')
|
43 |
+
$field_array['custom_html'] = FrmFieldsHelper::get_default_html($field->type);
|
44 |
|
45 |
$values['fields'][] = apply_filters('frm_setup_new_fields_vars', stripslashes_deep($field_array), $field);
|
46 |
|
47 |
+
if (!$form or !isset($form->id))
|
48 |
$form = $frm_form->getOne($field->form_id);
|
49 |
}
|
50 |
|
62 |
$values['email_to'] = '';
|
63 |
|
64 |
if (!isset($values['submit_value']))
|
65 |
+
$values['submit_value'] = $frm_settings->submit_value;
|
66 |
|
67 |
if (!isset($values['success_msg']))
|
68 |
+
$values['success_msg'] = $frm_settings->success_msg;
|
69 |
|
70 |
if (!isset($values['akismet']))
|
71 |
$values['akismet'] = 0;
|
96 |
<option value=""><?php echo $blank_label; ?></option>
|
97 |
<?php } ?>
|
98 |
<?php foreach($entries as $entry){ ?>
|
99 |
+
<option value="<?php echo $entry->id; ?>" <?php selected($field_value, $entry->id); ?>><?php echo (!empty($entry->name)) ? stripslashes($entry->name) : $entry->item_key; ?></option>
|
100 |
<?php } ?>
|
101 |
</select>
|
102 |
<?php
|
classes/helpers/FrmFieldsHelper.php
CHANGED
@@ -2,6 +2,45 @@
|
|
2 |
|
3 |
class FrmFieldsHelper{
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
function setup_new_vars($type='',$form_id=''){
|
6 |
global $frm_field, $frm_app_helper;
|
7 |
|
@@ -9,7 +48,7 @@ class FrmFieldsHelper{
|
|
9 |
$key = FrmAppHelper::get_unique_key('', $frm_field->table_name, 'field_key');
|
10 |
|
11 |
$values = array();
|
12 |
-
foreach (array('name' => 'Untitled', 'description' => '', 'field_key' => $key, 'type' => $type, 'options'=>'', 'default_value'=>'', 'field_order' => $field_count+1, 'required' => false, 'blank' => 'Untitled can\'t be blank', 'invalid' => 'Untitled is an invalid format', 'form_id' => $form_id) as $var => $default)
|
13 |
$values[$var] = $default;
|
14 |
|
15 |
$values['field_options'] = array();
|
@@ -20,10 +59,8 @@ class FrmFieldsHelper{
|
|
20 |
$values['options'] = serialize(array(1 => 'Option 1', 2 => 'Option 2'));
|
21 |
else if ( $type == 'select')
|
22 |
$values['options'] = serialize(array(1 => '', 2 => 'Option 1'));
|
23 |
-
else if ($type == 'textarea')
|
24 |
-
$values['field_options']['size'] = '45';
|
25 |
$values['field_options']['max'] = '5';
|
26 |
-
}
|
27 |
|
28 |
return $values;
|
29 |
}
|
@@ -45,7 +82,7 @@ class FrmFieldsHelper{
|
|
45 |
$values['options'] = unserialize($record->options);
|
46 |
$field_options = unserialize($record->field_options);
|
47 |
$values['field_options'] = $field_options;
|
48 |
-
$values['size'] = (isset($field_options['size']))?($field_options['size']):('
|
49 |
$values['max'] = (isset($field_options['max']))?($field_options['max']):('');
|
50 |
$values['label'] = (isset($field_options['label']))?($field_options['label']):('top');
|
51 |
$values['blank'] = (isset($field_options['blank']))?($field_options['blank']):('');
|
@@ -58,8 +95,16 @@ class FrmFieldsHelper{
|
|
58 |
return $values;
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
function get_default_html($type){
|
62 |
-
if (apply_filters('
|
63 |
$default_html = <<<DEFAULT_HTML
|
64 |
<div id="frm_field_[id]_container" class="form-field [required_class] [error_class]">
|
65 |
<label class="frm_pos_[label_position]">[field_name]
|
@@ -69,9 +114,8 @@ class FrmFieldsHelper{
|
|
69 |
[if description]<p class="description">[description]</p>[/if description]
|
70 |
</div>
|
71 |
DEFAULT_HTML;
|
72 |
-
}else
|
73 |
$default_html = apply_filters('frm_other_custom_html', '', $type);
|
74 |
-
}
|
75 |
|
76 |
return apply_filters('frm_custom_html', $default_html, $type);
|
77 |
}
|
@@ -114,16 +158,16 @@ DEFAULT_HTML;
|
|
114 |
ob_end_clean();
|
115 |
$html = str_replace('[input]', $contents, $html);
|
116 |
|
117 |
-
return $html;
|
118 |
}
|
119 |
|
120 |
function show_onfocus_js($field_id, $clear_on_focus){ ?>
|
121 |
-
<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'; ?>
|
122 |
<?php
|
123 |
}
|
124 |
|
125 |
function show_default_blank_js($field_id, $default_blank){ ?>
|
126 |
-
<a href="javascript:frm_default_blank(<?php echo $field_id; ?>,<?php echo $default_blank ?>)" class="<?php echo ($default_blank) ?'':'frm_inactive_icon'; ?>
|
127 |
<?php
|
128 |
}
|
129 |
|
2 |
|
3 |
class FrmFieldsHelper{
|
4 |
|
5 |
+
function field_selection(){
|
6 |
+
$fields = apply_filters('frm_available_fields', array(
|
7 |
+
'text' => __('Text Input (One Line)', FRM_PLUGIN_NAME),
|
8 |
+
'textarea' => __('Paragraph Input (Multiple Lines)', FRM_PLUGIN_NAME),
|
9 |
+
'checkbox' => __('Multiple Selection (Check Boxes)', FRM_PLUGIN_NAME),
|
10 |
+
'radio' => __('Select One (Radio)', FRM_PLUGIN_NAME),
|
11 |
+
'select' => __('Drop-Down (Select)', FRM_PLUGIN_NAME)
|
12 |
+
));
|
13 |
+
|
14 |
+
if ( in_array('wp-recaptcha/wp-recaptcha.php', get_option('active_plugins')) )
|
15 |
+
$fields['captcha'] = 'reCAPTCHA Field';
|
16 |
+
return $fields;
|
17 |
+
}
|
18 |
+
|
19 |
+
function pro_field_selection(){
|
20 |
+
return apply_filters('frm_pro_available_fields', array(
|
21 |
+
'divider' => __('Section Divider/Heading', FRM_PLUGIN_NAME),
|
22 |
+
'break' => __('Page Break', FRM_PLUGIN_NAME),
|
23 |
+
'file' => __('File Upload', FRM_PLUGIN_NAME),
|
24 |
+
'rte' => __('Rich Text Editor', FRM_PLUGIN_NAME),
|
25 |
+
'phone' => __('Phone', FRM_PLUGIN_NAME),
|
26 |
+
'email' => __('Email', FRM_PLUGIN_NAME),
|
27 |
+
'date' => __('Date', FRM_PLUGIN_NAME),
|
28 |
+
//'time' => 'Time',
|
29 |
+
'hidden' => __('Hidden Field', FRM_PLUGIN_NAME),
|
30 |
+
'user_id' => __('Hidden User Id', FRM_PLUGIN_NAME),
|
31 |
+
'website' => __('Website/URL', FRM_PLUGIN_NAME),
|
32 |
+
'image' => __('Image URL', FRM_PLUGIN_NAME),
|
33 |
+
'10radio' => __('Scale', FRM_PLUGIN_NAME),
|
34 |
+
'data' => __('Data from Entries', FRM_PLUGIN_NAME)
|
35 |
+
//'multiple' => 'Multiple Select Box', //http://code.google.com/p/jquery-asmselect/
|
36 |
+
//'address' => 'Address' //Address line 1, Address line 2, City, State/Providence, Postal Code, Select Country
|
37 |
+
//'city_selector' => 'US State/County/City selector',
|
38 |
+
//'full_name' => 'First and Last Name',
|
39 |
+
//'terms' => 'Terms of Use',// checkbox or show terms (integrate with Terms of use plugin)
|
40 |
+
//'quiz' => 'Question and Answer' // for captcha alternative
|
41 |
+
));
|
42 |
+
}
|
43 |
+
|
44 |
function setup_new_vars($type='',$form_id=''){
|
45 |
global $frm_field, $frm_app_helper;
|
46 |
|
48 |
$key = FrmAppHelper::get_unique_key('', $frm_field->table_name, 'field_key');
|
49 |
|
50 |
$values = array();
|
51 |
+
foreach (array('name' => __('Untitled', FRM_PLUGIN_NAME), 'description' => '', 'field_key' => $key, 'type' => $type, 'options'=>'', 'default_value'=>'', 'field_order' => $field_count+1, 'required' => false, 'blank' => __('Untitled can\'t be blank', FRM_PLUGIN_NAME), 'invalid' => __('Untitled is an invalid format', FRM_PLUGIN_NAME), 'form_id' => $form_id) as $var => $default)
|
52 |
$values[$var] = $default;
|
53 |
|
54 |
$values['field_options'] = array();
|
59 |
$values['options'] = serialize(array(1 => 'Option 1', 2 => 'Option 2'));
|
60 |
else if ( $type == 'select')
|
61 |
$values['options'] = serialize(array(1 => '', 2 => 'Option 1'));
|
62 |
+
else if ($type == 'textarea')
|
|
|
63 |
$values['field_options']['max'] = '5';
|
|
|
64 |
|
65 |
return $values;
|
66 |
}
|
82 |
$values['options'] = unserialize($record->options);
|
83 |
$field_options = unserialize($record->field_options);
|
84 |
$values['field_options'] = $field_options;
|
85 |
+
$values['size'] = (isset($field_options['size']))?($field_options['size']):('');
|
86 |
$values['max'] = (isset($field_options['max']))?($field_options['max']):('');
|
87 |
$values['label'] = (isset($field_options['label']))?($field_options['label']):('top');
|
88 |
$values['blank'] = (isset($field_options['blank']))?($field_options['blank']):('');
|
95 |
return $values;
|
96 |
}
|
97 |
|
98 |
+
function get_form_fields($form_id, $error=false){
|
99 |
+
global $frm_field;
|
100 |
+
$fields = apply_filters('frm_get_paged_fields', false, $form_id, $error);
|
101 |
+
if (!$fields)
|
102 |
+
$fields = $frm_field->getAll("fi.form_id='$form_id'", ' ORDER BY field_order');
|
103 |
+
return $fields;
|
104 |
+
}
|
105 |
+
|
106 |
function get_default_html($type){
|
107 |
+
if (apply_filters('frm_normal_field_type_html', true, $type)){
|
108 |
$default_html = <<<DEFAULT_HTML
|
109 |
<div id="frm_field_[id]_container" class="form-field [required_class] [error_class]">
|
110 |
<label class="frm_pos_[label_position]">[field_name]
|
114 |
[if description]<p class="description">[description]</p>[/if description]
|
115 |
</div>
|
116 |
DEFAULT_HTML;
|
117 |
+
}else
|
118 |
$default_html = apply_filters('frm_other_custom_html', '', $type);
|
|
|
119 |
|
120 |
return apply_filters('frm_custom_html', $default_html, $type);
|
121 |
}
|
158 |
ob_end_clean();
|
159 |
$html = str_replace('[input]', $contents, $html);
|
160 |
|
161 |
+
return apply_filters('frm_replace_shortcodes', $html, $field);
|
162 |
}
|
163 |
|
164 |
function show_onfocus_js($field_id, $clear_on_focus){ ?>
|
165 |
+
<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-show-hover" id="clear_field_<?php echo $field_id; ?>" title="<?php printf(__('Set this field to %1$sclear on click', FRM_PLUGIN_NAME), ($clear_on_focus) ? __('not ', FRM_PLUGIN_NAME) :'' ); ?>"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></a>
|
166 |
<?php
|
167 |
}
|
168 |
|
169 |
function show_default_blank_js($field_id, $default_blank){ ?>
|
170 |
+
<a href="javascript:frm_default_blank(<?php echo $field_id; ?>,<?php echo $default_blank ?>)" class="<?php echo ($default_blank) ?'':'frm_inactive_icon '; ?>frm-show-hover" id="default_blank_<?php echo $field_id; ?>" title="<?php printf(__('This default value should %1$sbe considered blank', FRM_PLUGIN_NAME), ($default_blank) ? __('not ', FRM_PLUGIN_NAME) :'' ); ?>"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></a>
|
171 |
<?php
|
172 |
}
|
173 |
|
classes/helpers/FrmFormsHelper.php
CHANGED
@@ -13,7 +13,7 @@ class FrmFormsHelper{
|
|
13 |
|
14 |
function get_template_dropdown($templates){ ?>
|
15 |
<select id="select_form" name="select_form" onChange='createFromFrmTemplate(this.value)'>
|
16 |
-
<option value=""
|
17 |
<?php foreach ($templates as $temp){ ?>
|
18 |
<option value="<?php echo $temp->id ?>"><?php echo $temp->name ?></option>
|
19 |
<?php }?>
|
@@ -45,17 +45,19 @@ class FrmFormsHelper{
|
|
45 |
function setup_new_vars(){
|
46 |
global $frm_app_controller, $frm_form, $frm_settings;
|
47 |
$values = array();
|
48 |
-
foreach (array('name' => 'Untitled Form', 'description' => '') as $var => $default)
|
49 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
50 |
|
|
|
|
|
51 |
foreach (array('form_id' => '', 'logged_in' => '', 'editable' => '', 'default_template' => 0, 'is_template' => 0) as $var => $default)
|
52 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
53 |
|
54 |
$values['form_key'] = ($_POST and isset($_POST['form_key']))?$_POST['form_key']:(FrmAppHelper::get_unique_key('', $frm_form->table_name, 'form_key'));
|
55 |
-
$values['email_to'] = ($_POST and isset($_POST['options']['email_to'])) ? $_POST['options']['email_to'] :
|
56 |
$values['custom_style'] = ($_POST and isset($_POST['options']['custom_style'])) ? $_POST['options']['custom_style'] : $frm_settings->custom_style;
|
57 |
-
$values['submit_value'] = ($_POST and isset($_POST['options']['submit_value'])) ? $_POST['options']['submit_value'] :
|
58 |
-
$values['success_msg'] = ($_POST and isset($_POST['options']['success_msg'])) ? $_POST['options']['success_msg'] :
|
59 |
$values['akismet'] = ($_POST and isset($_POST['options']['akismet'])) ? 1 : 0;
|
60 |
$values['before_html'] = FrmFormsHelper::get_default_html('before');
|
61 |
$values['after_html'] = FrmFormsHelper::get_default_html('after');
|
@@ -77,7 +79,7 @@ class FrmFormsHelper{
|
|
77 |
if ($loc == 'before'){
|
78 |
$default_html = <<<BEFORE_HTML
|
79 |
[if form_name]<h3>[form_name]</h3>[/if form_name]
|
80 |
-
[if form_description]<
|
81 |
BEFORE_HTML;
|
82 |
}else{
|
83 |
$default_html = '';
|
@@ -88,9 +90,9 @@ BEFORE_HTML;
|
|
88 |
function replace_shortcodes($html, $form, $title=false, $description=false){
|
89 |
foreach (array('form_name' => $title,'form_description' => $description) as $code => $show){
|
90 |
if ($code == 'form_name')
|
91 |
-
$replace_with = $form->name;
|
92 |
else if ($code == 'form_description')
|
93 |
-
$replace_with = $form->description;
|
94 |
|
95 |
if (($show == true || $show == 'true') && $replace_with != '' ){
|
96 |
$html = str_replace('[if '.$code.']','',$html);
|
13 |
|
14 |
function get_template_dropdown($templates){ ?>
|
15 |
<select id="select_form" name="select_form" onChange='createFromFrmTemplate(this.value)'>
|
16 |
+
<option value=""><?php _e('Create Form from Template', FRM_PLUGIN_NAME) ?>: </option>
|
17 |
<?php foreach ($templates as $temp){ ?>
|
18 |
<option value="<?php echo $temp->id ?>"><?php echo $temp->name ?></option>
|
19 |
<?php }?>
|
45 |
function setup_new_vars(){
|
46 |
global $frm_app_controller, $frm_form, $frm_settings;
|
47 |
$values = array();
|
48 |
+
foreach (array('name' => __('Untitled Form', FRM_PLUGIN_NAME), 'description' => '') as $var => $default)
|
49 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
50 |
|
51 |
+
$values['description'] = wpautop($values['description']);
|
52 |
+
|
53 |
foreach (array('form_id' => '', 'logged_in' => '', 'editable' => '', 'default_template' => 0, 'is_template' => 0) as $var => $default)
|
54 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
55 |
|
56 |
$values['form_key'] = ($_POST and isset($_POST['form_key']))?$_POST['form_key']:(FrmAppHelper::get_unique_key('', $frm_form->table_name, 'form_key'));
|
57 |
+
$values['email_to'] = ($_POST and isset($_POST['options']['email_to'])) ? $_POST['options']['email_to'] : $frm_settings->email_to;
|
58 |
$values['custom_style'] = ($_POST and isset($_POST['options']['custom_style'])) ? $_POST['options']['custom_style'] : $frm_settings->custom_style;
|
59 |
+
$values['submit_value'] = ($_POST and isset($_POST['options']['submit_value'])) ? $_POST['options']['submit_value'] : $frm_settings->submit_value;
|
60 |
+
$values['success_msg'] = ($_POST and isset($_POST['options']['success_msg'])) ? $_POST['options']['success_msg'] : $frm_settings->success_msg;
|
61 |
$values['akismet'] = ($_POST and isset($_POST['options']['akismet'])) ? 1 : 0;
|
62 |
$values['before_html'] = FrmFormsHelper::get_default_html('before');
|
63 |
$values['after_html'] = FrmFormsHelper::get_default_html('after');
|
79 |
if ($loc == 'before'){
|
80 |
$default_html = <<<BEFORE_HTML
|
81 |
[if form_name]<h3>[form_name]</h3>[/if form_name]
|
82 |
+
[if form_description]<div class="frm_description">[form_description]</div>[/if form_description]
|
83 |
BEFORE_HTML;
|
84 |
}else{
|
85 |
$default_html = '';
|
90 |
function replace_shortcodes($html, $form, $title=false, $description=false){
|
91 |
foreach (array('form_name' => $title,'form_description' => $description) as $code => $show){
|
92 |
if ($code == 'form_name')
|
93 |
+
$replace_with = stripslashes($form->name);
|
94 |
else if ($code == 'form_description')
|
95 |
+
$replace_with = wpautop(stripslashes($form->description));
|
96 |
|
97 |
if (($show == true || $show == 'true') && $replace_with != '' ){
|
98 |
$html = str_replace('[if '.$code.']','',$html);
|
classes/models/FrmEntry.php
CHANGED
@@ -17,7 +17,6 @@ class FrmEntry{
|
|
17 |
'browser' => $_SERVER['HTTP_USER_AGENT'],
|
18 |
'referrer' => $_SERVER['HTTP_REFERER']));
|
19 |
$new_values['form_id'] = isset($values['form_id']) ? (int)$values['form_id']: null;
|
20 |
-
//$new_values['parent_item_id'] = isset($values['parent_item_id'])?(int)$values['parent_item_id']: null;
|
21 |
$new_values['created_at'] = current_time('mysql', 1);
|
22 |
|
23 |
$query_results = $wpdb->insert( $this->table_name, $new_values );
|
@@ -26,7 +25,7 @@ class FrmEntry{
|
|
26 |
$entry_id = $wpdb->insert_id;
|
27 |
if (isset($values['item_meta']))
|
28 |
$frm_entry_meta->update_entry_metas($entry_id, $values['item_meta']);
|
29 |
-
do_action('frm_after_create_entry', $entry_id);
|
30 |
return $entry_id;
|
31 |
}else
|
32 |
return false;
|
@@ -41,7 +40,6 @@ class FrmEntry{
|
|
41 |
$new_values['item_key'] = FrmAppHelper::get_unique_key('', $this->table_name, 'item_key');
|
42 |
$new_values['name'] = $values->name;
|
43 |
$new_values['form_id'] = ($values->form_id)?(int)$values->form_id: null;
|
44 |
-
//$new_values['parent_item_id'] = ($values->parent_item_id)?(int)$values->parent_item_id: null;
|
45 |
$new_values['created_at'] = current_time('mysql', 1);
|
46 |
|
47 |
$query_results = $wpdb->insert( $this->table_name, $new_values );
|
@@ -151,7 +149,7 @@ class FrmEntry{
|
|
151 |
'fr.name as form_name ' .
|
152 |
'FROM ' . $this->table_name . ' it ' .
|
153 |
'LEFT OUTER JOIN ' . $frm_form->table_name . ' fr ON it.form_id=fr.id' .
|
154 |
-
$frm_app_helper->prepend_and_or_where(' WHERE', $where) . $order_by . ' ' .
|
155 |
'LIMIT ' . $start_index . ',' . $p_size . ';';
|
156 |
$results = $wpdb->get_results($query);
|
157 |
return $results;
|
@@ -160,31 +158,29 @@ class FrmEntry{
|
|
160 |
function validate( $values ){
|
161 |
global $wpdb, $frm_field, $frm_entry_meta;
|
162 |
|
163 |
-
$errors = array();
|
164 |
-
|
165 |
-
if (!isset($values['name']) and isset($values['item_meta'])){
|
166 |
-
foreach($values['item_meta'] as $key => $value){
|
167 |
-
$field = $frm_field->getOne($key);
|
168 |
-
if ($field->required == '1' and $field->type == 'text' and !isset($_POST['name']))
|
169 |
-
$_POST['name'] = $value;
|
170 |
-
}
|
171 |
-
}
|
172 |
|
173 |
if( !isset($values['item_key']) or $values['item_key'] == '' )
|
174 |
-
$_POST['item_key'] = FrmAppHelper::get_unique_key('', $this->table_name, 'item_key');
|
175 |
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
187 |
|
|
|
188 |
}
|
189 |
|
190 |
if (isset($_POST['recaptcha_challenge_field']) and $_POST['action'] == 'create'){
|
@@ -208,7 +204,7 @@ class FrmEntry{
|
|
208 |
$form_options = stripslashes_deep(unserialize($form->options));
|
209 |
|
210 |
if (isset($form_options['akismet']) && $form_options['akismet'])
|
211 |
-
$errors['spam'] = 'Your entry appears to be spam!';
|
212 |
}
|
213 |
|
214 |
return $errors;
|
17 |
'browser' => $_SERVER['HTTP_USER_AGENT'],
|
18 |
'referrer' => $_SERVER['HTTP_REFERER']));
|
19 |
$new_values['form_id'] = isset($values['form_id']) ? (int)$values['form_id']: null;
|
|
|
20 |
$new_values['created_at'] = current_time('mysql', 1);
|
21 |
|
22 |
$query_results = $wpdb->insert( $this->table_name, $new_values );
|
25 |
$entry_id = $wpdb->insert_id;
|
26 |
if (isset($values['item_meta']))
|
27 |
$frm_entry_meta->update_entry_metas($entry_id, $values['item_meta']);
|
28 |
+
do_action('frm_after_create_entry', $entry_id, $new_values['form_id']);
|
29 |
return $entry_id;
|
30 |
}else
|
31 |
return false;
|
40 |
$new_values['item_key'] = FrmAppHelper::get_unique_key('', $this->table_name, 'item_key');
|
41 |
$new_values['name'] = $values->name;
|
42 |
$new_values['form_id'] = ($values->form_id)?(int)$values->form_id: null;
|
|
|
43 |
$new_values['created_at'] = current_time('mysql', 1);
|
44 |
|
45 |
$query_results = $wpdb->insert( $this->table_name, $new_values );
|
149 |
'fr.name as form_name ' .
|
150 |
'FROM ' . $this->table_name . ' it ' .
|
151 |
'LEFT OUTER JOIN ' . $frm_form->table_name . ' fr ON it.form_id=fr.id' .
|
152 |
+
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . ' ' .
|
153 |
'LIMIT ' . $start_index . ',' . $p_size . ';';
|
154 |
$results = $wpdb->get_results($query);
|
155 |
return $results;
|
158 |
function validate( $values ){
|
159 |
global $wpdb, $frm_field, $frm_entry_meta;
|
160 |
|
161 |
+
$errors = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
if( !isset($values['item_key']) or $values['item_key'] == '' )
|
164 |
+
$_POST['item_key'] = $values['item_key'] = FrmAppHelper::get_unique_key('', $this->table_name, 'item_key');
|
165 |
|
166 |
+
$where = apply_filters('frm_posted_field_ids', 'fi.form_id='.$values['form_id']);
|
167 |
+
$posted_fields = $frm_field->getAll($where, ' ORDER BY fi.field_order');
|
168 |
+
|
169 |
+
foreach($posted_fields as $posted_field){
|
170 |
+
$value = '';
|
171 |
+
$field_options = unserialize($posted_field->field_options);
|
172 |
+
if (isset($values['item_meta'][$posted_field->id]))
|
173 |
+
$value = $values['item_meta'][$posted_field->id];
|
174 |
+
|
175 |
+
if (isset($field_options['default_blank']) and $field_options['default_blank'] and $value == $posted_field->default_value)
|
176 |
+
$value = '';
|
177 |
+
|
178 |
+
if ($posted_field->required == '1' and $value == ''){
|
179 |
+
$errors['field'.$posted_field->id] = (!isset($field_options['blank']) or $field_options['blank'] == __('Untitled cannot be blank', FRM_PLUGIN_NAME) or $field_options['blank'] == '') ? ($posted_field->name . ' '. __('can\'t be blank', FRM_PLUGIN_NAME)) : $field_options['blank'];
|
180 |
+
}else if ($posted_field->type == 'text' and !isset($_POST['name']))
|
181 |
+
$_POST['name'] = $value;
|
182 |
|
183 |
+
$errors = apply_filters('frm_validate_field_entry', $errors, $posted_field, $value);
|
184 |
}
|
185 |
|
186 |
if (isset($_POST['recaptcha_challenge_field']) and $_POST['action'] == 'create'){
|
204 |
$form_options = stripslashes_deep(unserialize($form->options));
|
205 |
|
206 |
if (isset($form_options['akismet']) && $form_options['akismet'])
|
207 |
+
$errors['spam'] = __('Your entry appears to be spam!', FRM_PLUGIN_NAME);
|
208 |
}
|
209 |
|
210 |
return $errors;
|
classes/models/FrmEntryMeta.php
CHANGED
@@ -56,7 +56,10 @@ class FrmEntryMeta{
|
|
56 |
|
57 |
function get_entry_meta_by_field($item_id, $field_id, $return_var=false){
|
58 |
global $wpdb;
|
59 |
-
|
|
|
|
|
|
|
60 |
if($return_var)
|
61 |
return $wpdb->get_var("{$query} LIMIT 1");
|
62 |
else
|
@@ -101,9 +104,11 @@ class FrmEntryMeta{
|
|
101 |
global $wpdb, $frm_field, $frm_app_helper;
|
102 |
$query = 'SELECT it.*, ' .
|
103 |
'fi.type as field_type, ' .
|
|
|
104 |
'fi.required as required, ' .
|
105 |
'fi.form_id as field_form_id, ' .
|
106 |
-
'fi.name as field_name ' .
|
|
|
107 |
'FROM '. $this->table_name . ' it ' .
|
108 |
'LEFT OUTER JOIN ' . $frm_field->table_name . ' fi ON it.field_id=fi.id' .
|
109 |
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
|
56 |
|
57 |
function get_entry_meta_by_field($item_id, $field_id, $return_var=false){
|
58 |
global $wpdb;
|
59 |
+
if (is_numeric($field_id))
|
60 |
+
$query = "SELECT meta_value FROM {$this->table_name} WHERE field_id='{$field_id}' and item_id='{$item_id}'";
|
61 |
+
else
|
62 |
+
$query = "SELECT meta_value FROM {$this->table_name} it LEFT OUTER JOIN $frm_field->table_name fi ON it.field_id=fi.id WHERE fi.field_key='{$field_id}' and item_id='{$item_id}'";
|
63 |
if($return_var)
|
64 |
return $wpdb->get_var("{$query} LIMIT 1");
|
65 |
else
|
104 |
global $wpdb, $frm_field, $frm_app_helper;
|
105 |
$query = 'SELECT it.*, ' .
|
106 |
'fi.type as field_type, ' .
|
107 |
+
'fi.field_key as field_key, ' .
|
108 |
'fi.required as required, ' .
|
109 |
'fi.form_id as field_form_id, ' .
|
110 |
+
'fi.name as field_name, ' .
|
111 |
+
'fi.options as fi_options '.
|
112 |
'FROM '. $this->table_name . ' it ' .
|
113 |
'LEFT OUTER JOIN ' . $frm_field->table_name . ' fi ON it.field_id=fi.id' .
|
114 |
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
|
classes/models/FrmField.php
CHANGED
@@ -3,33 +3,33 @@ class FrmField{
|
|
3 |
var $table_name;
|
4 |
|
5 |
function FrmField(){
|
6 |
-
|
7 |
-
|
8 |
}
|
9 |
|
10 |
function create( $values, $return=true ){
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
|
35 |
function duplicate($old_form_id, $form_id, $copy_keys=false, $blog_id=false){
|
@@ -42,7 +42,7 @@ class FrmField{
|
|
42 |
foreach (array('name','description','type','default_value','options','field_order','required') as $col)
|
43 |
$values[$col] = $field->$col;
|
44 |
$this->create($values, false);
|
45 |
-
|
46 |
}
|
47 |
|
48 |
function update( $id, $values ){
|
@@ -102,8 +102,7 @@ class FrmField{
|
|
102 |
|
103 |
function getIds($where = '', $order_by = '', $limit = ''){
|
104 |
global $wpdb, $frm_form, $frm_app_helper;
|
105 |
-
$query =
|
106 |
-
'FROM '. $this->table_name . ' fi ' .
|
107 |
'LEFT OUTER JOIN ' . $frm_form->table_name . ' fr ON fi.form_id=fr.id' .
|
108 |
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
|
109 |
if ($limit == ' LIMIT 1')
|
@@ -112,30 +111,5 @@ class FrmField{
|
|
112 |
$results = $wpdb->get_results($query);
|
113 |
return $results;
|
114 |
}
|
115 |
-
|
116 |
-
function validate( $values ){
|
117 |
-
global $wpdb, $frm_blogurl;
|
118 |
-
|
119 |
-
$errors = array();
|
120 |
-
|
121 |
-
if( $values['field_key'] == null or $values['field_key'] == '' ){
|
122 |
-
if( $values['name'] == null or $values['name'] == '' )
|
123 |
-
$errors[] = "Key can't be blank";
|
124 |
-
else
|
125 |
-
$_POST['field_key'] = $values['name'];
|
126 |
-
}
|
127 |
-
|
128 |
-
if( $values['name'] == null or $values['name'] == '' )
|
129 |
-
$errors[] = "Label can't be blank";
|
130 |
-
|
131 |
-
if( $values['type'] == null or $values['type'] == '' ){
|
132 |
-
$errors[] = "Type can't be blank";
|
133 |
-
}else{
|
134 |
-
if(($values['type'] == 'select' or $values['type'] == 'radio') and ($values['options'] == null or $values['options'] == ''))
|
135 |
-
$errors[] = "Options cannot be blank for that field type";
|
136 |
-
}
|
137 |
-
|
138 |
-
return $errors;
|
139 |
-
}
|
140 |
}
|
141 |
?>
|
3 |
var $table_name;
|
4 |
|
5 |
function FrmField(){
|
6 |
+
global $wpdb;
|
7 |
+
$this->table_name = "{$wpdb->prefix}frm_fields";
|
8 |
}
|
9 |
|
10 |
function create( $values, $return=true ){
|
11 |
+
global $wpdb;
|
12 |
+
|
13 |
+
$new_values = array();
|
14 |
+
$key = isset($values['field_key']) ? $values['field_key'] : $values['name'];
|
15 |
+
$new_values['field_key'] = FrmAppHelper::get_unique_key($key, $this->table_name, 'field_key');
|
16 |
+
|
17 |
+
foreach (array('name','description','type','default_value','options') as $col)
|
18 |
+
$new_values[$col] = stripslashes($values[$col]);
|
19 |
+
|
20 |
+
$new_values['field_order'] = isset($values['field_order'])?(int)$values['field_order']:NULL;
|
21 |
+
$new_values['required'] = isset($values['required'])?(int)$values['required']:NULL;
|
22 |
+
$new_values['form_id'] = isset($values['form_id'])?(int)$values['form_id']:NULL;
|
23 |
+
$new_values['field_options'] = serialize($values['field_options']);
|
24 |
+
$new_values['created_at'] = current_time('mysql', 1);
|
25 |
+
|
26 |
+
$query_results = $wpdb->insert( $this->table_name, $new_values );
|
27 |
+
if($return){
|
28 |
+
if($query_results)
|
29 |
+
return $wpdb->insert_id;
|
30 |
+
else
|
31 |
+
return false;
|
32 |
+
}
|
33 |
}
|
34 |
|
35 |
function duplicate($old_form_id, $form_id, $copy_keys=false, $blog_id=false){
|
42 |
foreach (array('name','description','type','default_value','options','field_order','required') as $col)
|
43 |
$values[$col] = $field->$col;
|
44 |
$this->create($values, false);
|
45 |
+
}
|
46 |
}
|
47 |
|
48 |
function update( $id, $values ){
|
102 |
|
103 |
function getIds($where = '', $order_by = '', $limit = ''){
|
104 |
global $wpdb, $frm_form, $frm_app_helper;
|
105 |
+
$query = "SELECT fi.id FROM $this->table_name fi " .
|
|
|
106 |
'LEFT OUTER JOIN ' . $frm_form->table_name . ' fr ON fi.form_id=fr.id' .
|
107 |
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
|
108 |
if ($limit == ' LIMIT 1')
|
111 |
$results = $wpdb->get_results($query);
|
112 |
return $results;
|
113 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
?>
|
classes/models/FrmForm.php
CHANGED
@@ -8,7 +8,7 @@ class FrmForm{
|
|
8 |
}
|
9 |
|
10 |
function create( $values ){
|
11 |
-
global $wpdb;
|
12 |
|
13 |
$new_values = array();
|
14 |
$new_values['form_key'] = FrmAppHelper::get_unique_key($values['form_key'], $this->table_name, 'form_key');
|
@@ -20,8 +20,8 @@ class FrmForm{
|
|
20 |
$new_values['prli_link_id'] = isset($link_id)?(int)$link_id:0;
|
21 |
$options = array();
|
22 |
$options['email_to'] = isset($values['options']['email_to']) ? $values['options']['email_to'] : '';
|
23 |
-
$options['submit_value'] = isset($values['options']['submit_value']) ? $values['options']['submit_value'] :
|
24 |
-
$options['success_msg'] = isset($values['options']['success_msg']) ? $values['options']['success_msg'] :
|
25 |
$options['akismet'] = isset($values['options']['akismet']) ? 1 : 0;
|
26 |
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
27 |
$options['after_html'] = isset($values['options']['after_html']) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html('after');
|
@@ -70,7 +70,7 @@ class FrmForm{
|
|
70 |
}
|
71 |
|
72 |
function update( $id, $values, $create_link = false ){
|
73 |
-
global $wpdb, $frm_field;
|
74 |
|
75 |
if ($create_link)
|
76 |
$values['status'] = 'published';
|
@@ -85,8 +85,8 @@ class FrmForm{
|
|
85 |
if (isset($values['options'])){
|
86 |
$options = array();
|
87 |
$options['email_to'] = isset($values['options']['email_to']) ? $values['options']['email_to'] : '';
|
88 |
-
$options['submit_value'] = isset($values['options']['submit_value']) ? $values['options']['submit_value'] :
|
89 |
-
$options['success_msg'] = isset($values['options']['success_msg']) ? $values['options']['success_msg'] :
|
90 |
$options['akismet'] = isset($values['options']['akismet']) ? 1 : 0;
|
91 |
$options['custom_style'] = isset($values['options']['custom_style']) ? 1 : 0;
|
92 |
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
@@ -111,6 +111,7 @@ class FrmForm{
|
|
111 |
}
|
112 |
foreach ($values['item_meta'] as $field_id => $default_value){
|
113 |
$field = $frm_field->getOne($field_id);
|
|
|
114 |
$field_options = unserialize($field->field_options);
|
115 |
foreach (array('size','max','label','invalid','required_indicator','blank') as $opt)
|
116 |
$field_options[$opt] = isset($values['field_options'][$opt.'_'.$field_id]) ? trim($values['field_options'][$opt.'_'.$field_id]) : '';
|
8 |
}
|
9 |
|
10 |
function create( $values ){
|
11 |
+
global $wpdb, $frm_settings;
|
12 |
|
13 |
$new_values = array();
|
14 |
$new_values['form_key'] = FrmAppHelper::get_unique_key($values['form_key'], $this->table_name, 'form_key');
|
20 |
$new_values['prli_link_id'] = isset($link_id)?(int)$link_id:0;
|
21 |
$options = array();
|
22 |
$options['email_to'] = isset($values['options']['email_to']) ? $values['options']['email_to'] : '';
|
23 |
+
$options['submit_value'] = isset($values['options']['submit_value']) ? $values['options']['submit_value'] : $frm_settings->submit_value;
|
24 |
+
$options['success_msg'] = isset($values['options']['success_msg']) ? $values['options']['success_msg'] : $frm_settings->success_msg;
|
25 |
$options['akismet'] = isset($values['options']['akismet']) ? 1 : 0;
|
26 |
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
27 |
$options['after_html'] = isset($values['options']['after_html']) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html('after');
|
70 |
}
|
71 |
|
72 |
function update( $id, $values, $create_link = false ){
|
73 |
+
global $wpdb, $frm_field, $frm_settings;
|
74 |
|
75 |
if ($create_link)
|
76 |
$values['status'] = 'published';
|
85 |
if (isset($values['options'])){
|
86 |
$options = array();
|
87 |
$options['email_to'] = isset($values['options']['email_to']) ? $values['options']['email_to'] : '';
|
88 |
+
$options['submit_value'] = isset($values['options']['submit_value']) ? $values['options']['submit_value'] : $frm_settings->submit_value;
|
89 |
+
$options['success_msg'] = isset($values['options']['success_msg']) ? $values['options']['success_msg'] : $frm_settings->success_msg;
|
90 |
$options['akismet'] = isset($values['options']['akismet']) ? 1 : 0;
|
91 |
$options['custom_style'] = isset($values['options']['custom_style']) ? 1 : 0;
|
92 |
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
111 |
}
|
112 |
foreach ($values['item_meta'] as $field_id => $default_value){
|
113 |
$field = $frm_field->getOne($field_id);
|
114 |
+
if (!$field) continue;
|
115 |
$field_options = unserialize($field->field_options);
|
116 |
foreach (array('size','max','label','invalid','required_indicator','blank') as $opt)
|
117 |
$field_options[$opt] = isset($values['field_options'][$opt.'_'.$field_id]) ? trim($values['field_options'][$opt.'_'.$field_id]) : '';
|
classes/models/FrmNotification.php
CHANGED
@@ -5,8 +5,9 @@ class FrmNotification{
|
|
5 |
}
|
6 |
|
7 |
function entry_created($entry_id){
|
8 |
-
global $
|
9 |
|
|
|
10 |
$entry = $frm_entry->getOne($entry_id);
|
11 |
$form = $frm_form->getOne($entry->form_id);
|
12 |
$values = $frm_entry_meta->getAll("it.item_id = $entry->id", " ORDER BY fi.field_order");
|
@@ -15,45 +16,44 @@ class FrmNotification{
|
|
15 |
$to_email = $form_options['email_to'];
|
16 |
if ($to_email == '')
|
17 |
return;
|
|
|
|
|
|
|
18 |
|
19 |
-
$opener = sprintf(__('%1$s form has been submitted on %2$s.', FRM_PLUGIN_NAME), $form->name, $frm_blogname);
|
20 |
|
21 |
$entry_data = '';
|
22 |
foreach ($values as $value){
|
23 |
-
$val = maybe_unserialize($value->meta_value);
|
24 |
if (is_array($val))
|
25 |
$val = implode(', ', $val);
|
26 |
-
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
$data = unserialize($entry->description);
|
30 |
-
$user_data =
|
31 |
-
$user_data .=
|
32 |
-
$user_data .=
|
33 |
-
$user_data .= "
|
34 |
-
|
35 |
-
$mail_body =<<<MAIL_BODY
|
36 |
-
{$opener}
|
37 |
-
|
38 |
-
{$entry_data}
|
39 |
|
40 |
-
|
41 |
-
MAIL_BODY;
|
42 |
$subject = sprintf(__('%1$s Form submitted on %2$s', FRM_PLUGIN_NAME), $form->name, $frm_blogname); //subject
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
-
function send_notification_email($to_email, $subject, $message, $
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
$from_name = $frm_blogname; //senders name
|
54 |
-
$from_email = get_option('admin_email'); //senders e-mail address
|
55 |
-
$recipient = "<{$to_email}>"; //recipient
|
56 |
-
$header = "From: {$from_name} <{$from_email}>\r\n"; //optional headerfields
|
57 |
$subject = html_entity_decode(strip_tags(stripslashes($subject)));
|
58 |
$message = html_entity_decode(strip_tags(stripslashes($message)));
|
59 |
$signature = '';//$this->get_mail_signature();
|
@@ -62,16 +62,17 @@ MAIL_BODY;
|
|
62 |
//$to_name = $user->full_name;
|
63 |
//$full_to_email = "{$to_name} <{$to_email}>";
|
64 |
|
65 |
-
wp_mail($
|
|
|
|
|
|
|
66 |
|
67 |
-
do_action('frm_notification', $
|
68 |
}
|
69 |
|
70 |
function get_mail_signature(){
|
71 |
-
global $frm_blogname;
|
72 |
-
|
73 |
$thanks = __('Thanks!', FRM_PLUGIN_NAME);
|
74 |
-
$team = sprintf(__('%s Team', FRM_PLUGIN_NAME),
|
75 |
//$manage_subscription = sprintf(__('If you want to stop future emails like this from coming to you, please modify your form settings.', FRM_PLUGIN_NAME));
|
76 |
|
77 |
$signature =<<<MAIL_SIGNATURE
|
5 |
}
|
6 |
|
7 |
function entry_created($entry_id){
|
8 |
+
global $frm_blogurl, $frm_form, $frm_entry, $frm_entry_meta;
|
9 |
|
10 |
+
$frm_blogname = get_option('blogname');
|
11 |
$entry = $frm_entry->getOne($entry_id);
|
12 |
$form = $frm_form->getOne($entry->form_id);
|
13 |
$values = $frm_entry_meta->getAll("it.item_id = $entry->id", " ORDER BY fi.field_order");
|
16 |
$to_email = $form_options['email_to'];
|
17 |
if ($to_email == '')
|
18 |
return;
|
19 |
+
$to_emails = explode(',', $to_email);
|
20 |
+
|
21 |
+
$from_email = '';
|
22 |
|
23 |
+
$opener = sprintf(__('%1$s form has been submitted on %2$s.', FRM_PLUGIN_NAME), $form->name, $frm_blogname) ."\r\n\r\n";
|
24 |
|
25 |
$entry_data = '';
|
26 |
foreach ($values as $value){
|
27 |
+
$val = apply_filters('frm_email_value', maybe_unserialize($value->meta_value), $value);
|
28 |
if (is_array($val))
|
29 |
$val = implode(', ', $val);
|
30 |
+
|
31 |
+
$entry_data .= $value->field_name . ': ' . $val . "\r\n\r\n";
|
32 |
+
if ($from_email == '' and is_email($val))
|
33 |
+
$from_email = $val;
|
34 |
}
|
35 |
|
36 |
$data = unserialize($entry->description);
|
37 |
+
$user_data = __('User Information', FRM_PLUGIN_NAME) ."\r\n";
|
38 |
+
$user_data .= __('IP Address', FRM_PLUGIN_NAME) . ": ". $data['ip'] ."\r\n";
|
39 |
+
$user_data .= __('User-Agent (Browser/OS)', FRM_PLUGIN_NAME) . ": ". $data['browser']."\r\n";
|
40 |
+
$user_data .= __('Referrer', FRM_PLUGIN_NAME) . ": ". $data['referrer']."\r\n";
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
$mail_body = $opener . $entry_data ."\r\n". $user_data;
|
|
|
43 |
$subject = sprintf(__('%1$s Form submitted on %2$s', FRM_PLUGIN_NAME), $form->name, $frm_blogname); //subject
|
44 |
|
45 |
+
if(is_array($to_emails)){
|
46 |
+
foreach($to_emails as $to_email)
|
47 |
+
$this->send_notification_email(trim($to_email), $subject, $mail_body, $from_email);
|
48 |
+
}else
|
49 |
+
$this->send_notification_email($to_email, $subject, $mail_body, $from_email);
|
50 |
}
|
51 |
|
52 |
+
function send_notification_email($to_email, $subject, $message, $from_email=''){
|
53 |
+
$from_name = get_option('blogname'); //senders name
|
54 |
+
$from_email = ($from_email == '') ? get_option('admin_email') : $from_email; //senders e-mail address
|
55 |
+
$recipient = $to_email; //recipient
|
56 |
+
$header = "From: {$from_email}\r\n"; //optional headerfields
|
|
|
|
|
|
|
|
|
|
|
57 |
$subject = html_entity_decode(strip_tags(stripslashes($subject)));
|
58 |
$message = html_entity_decode(strip_tags(stripslashes($message)));
|
59 |
$signature = '';//$this->get_mail_signature();
|
62 |
//$to_name = $user->full_name;
|
63 |
//$full_to_email = "{$to_name} <{$to_email}>";
|
64 |
|
65 |
+
if (!wp_mail($recipient, $subject, $message.$signature, $header)){
|
66 |
+
$header .= "Reply-To: {$from_email}\r\n Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\r\n";
|
67 |
+
mail($recipient, $subject, $message, $header);
|
68 |
+
}
|
69 |
|
70 |
+
do_action('frm_notification', $recipient, $subject, $message.$signature);
|
71 |
}
|
72 |
|
73 |
function get_mail_signature(){
|
|
|
|
|
74 |
$thanks = __('Thanks!', FRM_PLUGIN_NAME);
|
75 |
+
$team = sprintf(__('%s Team', FRM_PLUGIN_NAME), get_option('blogname'));
|
76 |
//$manage_subscription = sprintf(__('If you want to stop future emails like this from coming to you, please modify your form settings.', FRM_PLUGIN_NAME));
|
77 |
|
78 |
$signature =<<<MAIL_SIGNATURE
|
classes/models/FrmSettings.php
CHANGED
@@ -6,6 +6,12 @@ class FrmSettings{
|
|
6 |
var $lock_keys;
|
7 |
|
8 |
var $custom_style;
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
function FrmSettings(){
|
11 |
$this->set_default_options();
|
@@ -22,6 +28,12 @@ class FrmSettings{
|
|
22 |
|
23 |
if(!isset($this->custom_style))
|
24 |
$this->custom_style = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
function validate($params,$errors){
|
6 |
var $lock_keys;
|
7 |
|
8 |
var $custom_style;
|
9 |
+
|
10 |
+
var $success_msg;
|
11 |
+
var $failed_msg;
|
12 |
+
var $submit_value;
|
13 |
+
|
14 |
+
var $email_to;
|
15 |
|
16 |
function FrmSettings(){
|
17 |
$this->set_default_options();
|
28 |
|
29 |
if(!isset($this->custom_style))
|
30 |
$this->custom_style = true;
|
31 |
+
|
32 |
+
$this->success_msg = __('Your responses were successfully submitted. Thank you!', FRM_PLUGIN_NAME);
|
33 |
+
$this->failed_msg = __('We\'re sorry. There was an error processing your responses.', FRM_PLUGIN_NAME);
|
34 |
+
$this->submit_value = __('Submit', FRM_PLUGIN_NAME);
|
35 |
+
|
36 |
+
$this->email_to = get_option('admin_email');
|
37 |
}
|
38 |
|
39 |
function validate($params,$errors){
|
classes/models/FrmUpdate.php
CHANGED
@@ -126,7 +126,7 @@ class FrmUpdate{
|
|
126 |
function pro_cred_form(){ ?>
|
127 |
<div class="wrap">
|
128 |
<div id="icon-options-general" class="icon32"><br></div>
|
129 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Pro Account Information
|
130 |
<?php
|
131 |
if(isset($_POST) and isset($_POST['process_cred_form']) and $_POST['process_cred_form'] == 'Y'){
|
132 |
if($this->process_pro_cred_form()){
|
@@ -152,10 +152,9 @@ class FrmUpdate{
|
|
152 |
|
153 |
$this->display_pro_cred_form(); ?>
|
154 |
|
155 |
-
<p
|
156 |
-
Formidable Pro will help you style forms, manage data, and get reports.</p>
|
157 |
|
158 |
-
<a href="http://formidablepro.com"
|
159 |
</div>
|
160 |
<?php
|
161 |
}
|
126 |
function pro_cred_form(){ ?>
|
127 |
<div class="wrap">
|
128 |
<div id="icon-options-general" class="icon32"><br></div>
|
129 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Pro Account Information', FRM_PLUGIN_NAME)?></h2>
|
130 |
<?php
|
131 |
if(isset($_POST) and isset($_POST['process_cred_form']) and $_POST['process_cred_form'] == 'Y'){
|
132 |
if($this->process_pro_cred_form()){
|
152 |
|
153 |
$this->display_pro_cred_form(); ?>
|
154 |
|
155 |
+
<p><?php _e('Ready to take your forms to the next level?<br/>Formidable Pro will help you style forms, manage data, and get reports.', FRM_PLUGIN_NAME) ?></p>
|
|
|
156 |
|
157 |
+
<a href="http://formidablepro.com"><?php _e('Learn More', FRM_PLUGIN_NAME) ?> »</a>
|
158 |
</div>
|
159 |
<?php
|
160 |
}
|
classes/templates/contact.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$values['name'] = 'Contact Us';
|
4 |
-
$values['description'] = 'We would like to hear from you. Please send us a message by filling out the form below and we will get back with you shortly.';
|
5 |
|
6 |
if ($form){
|
7 |
$form_id = $form->id;
|
@@ -16,43 +16,43 @@ if ($form){
|
|
16 |
|
17 |
|
18 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('text', $form_id));
|
19 |
-
$field_values['name'] = 'Name';
|
20 |
$field_values['required'] = 1;
|
21 |
-
$field_values['field_options']['blank'] = 'Name cannot be blank';
|
22 |
$frm_field->create( $field_values );
|
23 |
|
24 |
|
25 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('email', $form_id));
|
26 |
-
$field_values['name'] = 'Email';
|
27 |
$field_values['required'] = 1;
|
28 |
-
$field_values['field_options']['blank'] = 'Email cannot be blank';
|
29 |
-
$field_values['field_options']['invalid'] = 'Please enter a valid email address';
|
30 |
$frm_field->create( $field_values );
|
31 |
|
32 |
|
33 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('website', $form_id));
|
34 |
-
$field_values['name'] = 'Website';
|
35 |
-
$field_values['field_options']['blank'] = 'Website cannot be blank';
|
36 |
-
$field_values['field_options']['invalid'] = 'Website is an invalid format';
|
37 |
$frm_field->create( $field_values );
|
38 |
|
39 |
|
40 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('text', $form_id));
|
41 |
-
$field_values['name'] = 'Subject';
|
42 |
$field_values['required'] = 1;
|
43 |
-
$field_values['field_options']['blank'] = 'Subject cannot be blank';
|
44 |
$frm_field->create( $field_values );
|
45 |
|
46 |
|
47 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('textarea', $form_id));
|
48 |
-
$field_values['name'] = 'Message';
|
49 |
$field_values['required'] = 1;
|
50 |
-
$field_values['field_options']['blank'] = 'Message cannot be blank';
|
51 |
$frm_field->create( $field_values );
|
52 |
|
53 |
|
54 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('captcha', $form_id));
|
55 |
-
$field_values['name'] = 'Captcha';
|
56 |
$field_values['field_options']['label'] = 'none';
|
57 |
$frm_field->create( $field_values );
|
58 |
|
1 |
<?php
|
2 |
|
3 |
+
$values['name'] = __('Contact Us', FRM_PLUGIN_NAME);
|
4 |
+
$values['description'] = __('We would like to hear from you. Please send us a message by filling out the form below and we will get back with you shortly.', FRM_PLUGIN_NAME);
|
5 |
|
6 |
if ($form){
|
7 |
$form_id = $form->id;
|
16 |
|
17 |
|
18 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('text', $form_id));
|
19 |
+
$field_values['name'] = __('Name', FRM_PLUGIN_NAME);
|
20 |
$field_values['required'] = 1;
|
21 |
+
$field_values['field_options']['blank'] = __('Name cannot be blank', FRM_PLUGIN_NAME);
|
22 |
$frm_field->create( $field_values );
|
23 |
|
24 |
|
25 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('email', $form_id));
|
26 |
+
$field_values['name'] = __('Email', FRM_PLUGIN_NAME);
|
27 |
$field_values['required'] = 1;
|
28 |
+
$field_values['field_options']['blank'] = __('Email cannot be blank', FRM_PLUGIN_NAME);
|
29 |
+
$field_values['field_options']['invalid'] = __('Please enter a valid email address', FRM_PLUGIN_NAME);
|
30 |
$frm_field->create( $field_values );
|
31 |
|
32 |
|
33 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('website', $form_id));
|
34 |
+
$field_values['name'] = __('Website', FRM_PLUGIN_NAME);
|
35 |
+
$field_values['field_options']['blank'] = __('Website cannot be blank', FRM_PLUGIN_NAME);
|
36 |
+
$field_values['field_options']['invalid'] = __('Website is an invalid format', FRM_PLUGIN_NAME);
|
37 |
$frm_field->create( $field_values );
|
38 |
|
39 |
|
40 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('text', $form_id));
|
41 |
+
$field_values['name'] = __('Subject', FRM_PLUGIN_NAME);
|
42 |
$field_values['required'] = 1;
|
43 |
+
$field_values['field_options']['blank'] = __('Subject cannot be blank', FRM_PLUGIN_NAME);
|
44 |
$frm_field->create( $field_values );
|
45 |
|
46 |
|
47 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('textarea', $form_id));
|
48 |
+
$field_values['name'] = __('Message', FRM_PLUGIN_NAME);
|
49 |
$field_values['required'] = 1;
|
50 |
+
$field_values['field_options']['blank'] = __('Message cannot be blank', FRM_PLUGIN_NAME);
|
51 |
$frm_field->create( $field_values );
|
52 |
|
53 |
|
54 |
$field_values = apply_filters('frm_before_field_created', FrmFieldsHelper::setup_new_vars('captcha', $form_id));
|
55 |
+
$field_values['name'] = __('Captcha', FRM_PLUGIN_NAME);
|
56 |
$field_values['field_options']['label'] = 'none';
|
57 |
$frm_field->create( $field_values );
|
58 |
|
classes/views/frm-entries/direct.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
|
4 |
<head profile="http://gmpg.org/xfn/11">
|
5 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
|
6 |
-
|
7 |
<?php global $frm_blogurl; ?>
|
8 |
<?php if ($custom_style){
|
9 |
$css = apply_filters('get_frm_stylesheet', FRM_URL .'/css/frm_display.css');
|
@@ -14,5 +14,6 @@
|
|
14 |
</head>
|
15 |
<body>
|
16 |
<?php require_once('frm-entry.php'); ?>
|
|
|
17 |
</body>
|
18 |
</html>
|
3 |
|
4 |
<head profile="http://gmpg.org/xfn/11">
|
5 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
|
6 |
+
<title><?php bloginfo('name'); ?></title>
|
7 |
<?php global $frm_blogurl; ?>
|
8 |
<?php if ($custom_style){
|
9 |
$css = apply_filters('get_frm_stylesheet', FRM_URL .'/css/frm_display.css');
|
14 |
</head>
|
15 |
<body>
|
16 |
<?php require_once('frm-entry.php'); ?>
|
17 |
+
<?php //wp_footer(); ?>
|
18 |
</body>
|
19 |
</html>
|
classes/views/frm-entries/form.php
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
?>
|
33 |
<?php if (is_admin() && !$frm_settings->lock_keys){ ?>
|
34 |
<div class="form-field">
|
35 |
-
<label
|
36 |
<input type="text" id="item_key" name="item_key" value="<?php echo $values['item_key'] ?>" />
|
37 |
</div>
|
38 |
<?php } ?>
|
@@ -42,8 +42,8 @@
|
|
42 |
|
43 |
<?php echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); ?>
|
44 |
|
45 |
-
<?php do_action('frm_entries_footer_scripts',$values['fields']); ?>
|
46 |
<script type="text/javascript">
|
|
|
47 |
function frmClearDefault(default_value,thefield){if(thefield.value==default_value)thefield.value='';}
|
48 |
function frmReplaceDefault(default_value,thefield){if(thefield.value=='')thefield.value=default_value;}
|
49 |
</script>
|
32 |
?>
|
33 |
<?php if (is_admin() && !$frm_settings->lock_keys){ ?>
|
34 |
<div class="form-field">
|
35 |
+
<label><?php _e('Entry Key', FRM_PLUGIN_NAME) ?></label>
|
36 |
<input type="text" id="item_key" name="item_key" value="<?php echo $values['item_key'] ?>" />
|
37 |
</div>
|
38 |
<?php } ?>
|
42 |
|
43 |
<?php echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); ?>
|
44 |
|
|
|
45 |
<script type="text/javascript">
|
46 |
+
<?php do_action('frm_entries_footer_scripts',$values['fields']); ?>
|
47 |
function frmClearDefault(default_value,thefield){if(thefield.value==default_value)thefield.value='';}
|
48 |
function frmReplaceDefault(default_value,thefield){if(thefield.value=='')thefield.value=default_value;}
|
49 |
</script>
|
classes/views/frm-entries/frm-entry.php
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
<?php
|
2 |
-
global $frm_form, $frm_field, $frm_entry, $frm_entry_meta, $
|
3 |
-
$fields = $frm_field->getAll("fi.form_id='$form->id'", ' ORDER BY field_order');
|
4 |
$form_name = $form->name;
|
5 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
6 |
|
7 |
-
$submit = isset($form_options['submit_value'])?$form_options['submit_value']:
|
8 |
-
$
|
9 |
-
$saved_message = isset($form_options['success_msg'])? $form_options['success_msg'] : "Your responses were successfully submitted. Thank you!";
|
10 |
|
11 |
$params = FrmEntriesController::get_params($form);
|
12 |
$message = '';
|
@@ -16,21 +14,23 @@ if($params['action'] == 'create' && $params['form_id'] == $form->id){
|
|
16 |
$errors = $frm_entry->validate($_POST);
|
17 |
|
18 |
if( !empty($errors) ){
|
19 |
-
$
|
|
|
20 |
require('new.php');
|
21 |
}else{
|
|
|
22 |
do_action('frm_validate_form_creation', $params, $fields, $form, $title, $description);
|
23 |
-
if (apply_filters('frm_continue_to_create', true)){
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
echo $failed_message;
|
28 |
}
|
29 |
}
|
30 |
}else{
|
|
|
31 |
do_action('frm_display_form_action', $params, $fields, $form, $title, $description);
|
32 |
-
if (apply_filters('frm_continue_to_new', true, $params['action'])){
|
33 |
-
$values = FrmEntriesHelper::setup_new_vars($fields);
|
34 |
require('new.php');
|
35 |
}
|
36 |
}
|
1 |
<?php
|
2 |
+
global $frm_form, $frm_field, $frm_entry, $frm_entry_meta, $user_ID, $frm_settings;
|
|
|
3 |
$form_name = $form->name;
|
4 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
5 |
|
6 |
+
$submit = isset($form_options['submit_value'])?$form_options['submit_value'] : $frm_settings->submit_value;
|
7 |
+
$saved_message = isset($form_options['success_msg'])? $form_options['success_msg'] : $frm_settings->success_msg;
|
|
|
8 |
|
9 |
$params = FrmEntriesController::get_params($form);
|
10 |
$message = '';
|
14 |
$errors = $frm_entry->validate($_POST);
|
15 |
|
16 |
if( !empty($errors) ){
|
17 |
+
$fields = FrmFieldsHelper::get_form_fields($form->id, true);
|
18 |
+
$values = FrmEntriesHelper::setup_new_vars($fields, $form);
|
19 |
require('new.php');
|
20 |
}else{
|
21 |
+
$fields = FrmFieldsHelper::get_form_fields($form->id);
|
22 |
do_action('frm_validate_form_creation', $params, $fields, $form, $title, $description);
|
23 |
+
if (apply_filters('frm_continue_to_create', true, $form->id)){
|
24 |
+
$values = FrmEntriesHelper::setup_new_vars($fields, $form, true);
|
25 |
+
$message = ($frm_entry->create( $_POST )) ? $saved_message : $frm_settings->failed_msg;
|
26 |
+
require('new.php');
|
|
|
27 |
}
|
28 |
}
|
29 |
}else{
|
30 |
+
$fields = FrmFieldsHelper::get_form_fields($form->id);
|
31 |
do_action('frm_display_form_action', $params, $fields, $form, $title, $description);
|
32 |
+
if (apply_filters('frm_continue_to_new', true, $form->id, $params['action'])){
|
33 |
+
$values = FrmEntriesHelper::setup_new_vars($fields, $form);
|
34 |
require('new.php');
|
35 |
}
|
36 |
}
|
classes/views/frm-entries/list.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Pro Entries
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
8 |
|
9 |
-
|
10 |
|
11 |
</div>
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Pro Entries', FRM_PLUGIN_NAME) ?></h2>
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
8 |
|
9 |
+
<p><?php printf(__('Upgrade to %1$sFormidable Pro%2$s to view, search, export, and bulk delete your saved entries.', FRM_PLUGIN_NAME), '<a href="http://formidablepro.com">', '</a>'); ?></p>
|
10 |
|
11 |
</div>
|
classes/views/frm-entries/new.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<div class="frm_forms<?php echo ($values['custom_style']) ? ' with_frm_style' : ''; ?>" id="frm_form_<?php echo $form->id ?>_container">
|
2 |
-
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
3 |
|
4 |
<form action="" enctype="multipart/form-data" method="post" class="frm-show-form" id="form_<?php echo $form->form_key ?>">
|
|
|
5 |
<?php $form_action = 'create'; ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/frm-entries/form.php'); ?>
|
8 |
|
9 |
<?php if (!$form->is_template){ ?>
|
10 |
<p class="submit">
|
11 |
-
<?php if (!isset($submit)) $submit =
|
12 |
<input type="submit" name="<?php echo $submit ?>" value="<?php echo $submit ?>" />
|
13 |
</p>
|
14 |
<?php } ?>
|
1 |
<div class="frm_forms<?php echo ($values['custom_style']) ? ' with_frm_style' : ''; ?>" id="frm_form_<?php echo $form->id ?>_container">
|
|
|
2 |
|
3 |
<form action="" enctype="multipart/form-data" method="post" class="frm-show-form" id="form_<?php echo $form->form_key ?>">
|
4 |
+
<?php include(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
5 |
<?php $form_action = 'create'; ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/frm-entries/form.php'); ?>
|
8 |
|
9 |
<?php if (!$form->is_template){ ?>
|
10 |
<p class="submit">
|
11 |
+
<?php if (!isset($submit)) $submit = $frm_settings->submit_value;?>
|
12 |
<input type="submit" name="<?php echo $submit ?>" value="<?php echo $submit ?>" />
|
13 |
</p>
|
14 |
<?php } ?>
|
classes/views/frm-fields/input.php
CHANGED
@@ -14,13 +14,12 @@
|
|
14 |
<?php }else if ($field['type'] == 'select'){?>
|
15 |
<select name="<?php echo $field_name ?>" id="item_meta<?php echo $field['id'] ?>" <?php echo $auto_width ?>>
|
16 |
<?php foreach ($field['options'] as $opt){ ?>
|
17 |
-
<option value=
|
18 |
<?php } ?>
|
19 |
</select>
|
20 |
<?php }else if ($field['type'] == 'captcha'){
|
21 |
-
|
22 |
-
|
23 |
-
FrmAppHelper::display_recaptcha($errors);
|
24 |
}else if ($field['type'] == 'checkbox'){
|
25 |
$checked_values = $field['value'];
|
26 |
foreach ($field['options'] as $opt){
|
14 |
<?php }else if ($field['type'] == 'select'){?>
|
15 |
<select name="<?php echo $field_name ?>" id="item_meta<?php echo $field['id'] ?>" <?php echo $auto_width ?>>
|
16 |
<?php foreach ($field['options'] as $opt){ ?>
|
17 |
+
<option value="<?php echo $opt ?>" <?php if ($field['value'] == $opt) echo 'selected="selected"'; ?>><?php echo $opt ?></option>
|
18 |
<?php } ?>
|
19 |
</select>
|
20 |
<?php }else if ($field['type'] == 'captcha'){
|
21 |
+
if (array_key_exists('captcha', FrmFieldsHelper::field_selection()))
|
22 |
+
FrmAppHelper::display_recaptcha();
|
|
|
23 |
}else if ($field['type'] == 'checkbox'){
|
24 |
$checked_values = $field['value'];
|
25 |
foreach ($field['options'] as $opt){
|
classes/views/frm-fields/single-option.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<span class="frm_spacer"></span>
|
3 |
<a href="javascript:frm_delete_field_option(<?php echo $field['id']?>, <?php echo $opt_key ?>);" class="frm_single_show_hover alignleft" ><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></a>
|
4 |
<?php if ($field['type'] != 'select'){ ?>
|
5 |
-
<input type=
|
6 |
<?php } ?>
|
7 |
<span class="frm_ipe_field_option" id="field_<?php echo $field['id']?>-<?php echo $opt_key ?>"><?php echo $opt ?></span>
|
8 |
</span>
|
2 |
<span class="frm_spacer"></span>
|
3 |
<a href="javascript:frm_delete_field_option(<?php echo $field['id']?>, <?php echo $opt_key ?>);" class="frm_single_show_hover alignleft" ><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></a>
|
4 |
<?php if ($field['type'] != 'select'){ ?>
|
5 |
+
<input type="<?php echo $field['type'] ?>" name="<?php echo $field_name ?><?php echo ($field['type'] == 'checkbox')?'[]':''; ?>" value="<?php echo str_replace('"', '"', $opt) ?>"<?php echo isset($checked)? $checked : ''; ?>/>
|
6 |
<?php } ?>
|
7 |
<span class="frm_ipe_field_option" id="field_<?php echo $field['id']?>-<?php echo $opt_key ?>"><?php echo $opt ?></span>
|
8 |
</span>
|
classes/views/frm-forms/add_field.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php $display = apply_filters('frm_display_field_options', array('type' => $field['type'], 'field_data' => $field, 'required' => true, 'description' => true, 'options' => true, 'label_position' => true, 'invalid' => false, 'size' => false, 'clear_on_focus' => false, 'default_blank' => true)); ?>
|
2 |
|
3 |
-
<li id="frm_field_id_<?php echo $field['id']; ?>" class="edit_form_item frm_field_box ui-state-default frm_hide_options<?php echo $display['options'] ?>">
|
4 |
<a href="javascript:void(0);" class="alignright frm-show-hover frm-move" title="Move Field"><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="Move"></a>
|
5 |
<a href="javascript:frm_delete_field(<?php echo $field['id']; ?>)" class="alignright frm-show-hover" id="frm_delete_field<?php echo $field['id']; ?>" title="Delete Field"><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></a>
|
6 |
<?php do_action('frm_extra_field_actions', $field['id']); ?>
|
@@ -15,14 +15,14 @@
|
|
15 |
<?php if ($display['type'] == 'text'){ ?>
|
16 |
<input type="text" name="<?php echo $field_name ?>" value="<?php echo $field['default_value']; ?>" size="<?php echo $field['size']; ?>"/>
|
17 |
<?php }else if ($field['type'] == 'textarea'){ ?>
|
18 |
-
<textarea name="<?php echo $field_name ?>"
|
19 |
|
20 |
<?php }else if ($field['type'] == 'radio' || $field['type'] == 'checkbox'){
|
21 |
$field['value'] = maybe_unserialize($field['default_value']); ?>
|
22 |
<?php require(FRM_VIEWS_PATH.'/frm-fields/radio.php'); ?>
|
23 |
|
24 |
<div id="frm_add_field_<?php echo $field['id']; ?>" class="frm-show-click">
|
25 |
-
<a href="javascript:frm_add_field_option(<?php echo $field['id']; ?>)"><span class="ui-icon ui-icon-plusthick alignleft"></span> Add an Option
|
26 |
</div>
|
27 |
|
28 |
<?php }else if ($field['type'] == 'select'){ ?>
|
@@ -35,23 +35,21 @@
|
|
35 |
<?php if ($display['default_blank']) FrmFieldsHelper::show_default_blank_js($field['id'], $field['default_blank']); ?>
|
36 |
<br/>
|
37 |
<div class="frm-show-click">
|
38 |
-
|
39 |
-
|
40 |
-
?>
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
<?php do_action('frm_add_multiple_opts', $field); ?>
|
45 |
</div>
|
46 |
-
|
47 |
<?php }else if ($field['type'] == 'captcha'){
|
48 |
-
if (
|
49 |
global $recaptcha_opt, $frm_siteurl; ?>
|
50 |
<img src="<?php echo FRM_URL ?>/images/<?php echo $recaptcha_opt['re_theme'];?>-captcha.png">
|
51 |
-
<span class="howto"
|
52 |
<input type="hidden" name="<?php echo $field_name ?>" value="1"/>
|
53 |
<?php }else
|
54 |
-
|
55 |
|
56 |
}else
|
57 |
do_action('frm_display_added_fields',$field);
|
@@ -64,43 +62,44 @@ if ($display['clear_on_focus']){
|
|
64 |
}
|
65 |
|
66 |
if ($display['description']){ ?>
|
67 |
-
<div class="frm_ipe_field_desc description" id="field_<?php echo $field['id']; ?>"><?php echo $field['description']; ?></div>
|
68 |
<?php
|
69 |
}
|
70 |
|
71 |
if ($display['options']){ ?>
|
72 |
<h3 class="ui-accordion-header ui-state-default">
|
73 |
<span class="ui-icon ui-icon-triangle-1-e"></span>
|
74 |
-
<a href="#"
|
75 |
</h3>
|
76 |
<div class="ui-widget-content ui-corner-bottom">
|
77 |
<?php if ($display['size']){ ?>
|
78 |
-
<p><label><?php echo ($field['type'] == 'textarea' || $field['type'] == 'rte')?'Columns':'Field Size' ?>:</label>
|
79 |
<input type="text" name="field_options[size_<?php echo $field['id'] ?>]" value="<?php echo $field['size']; ?>" size="5">
|
80 |
|
81 |
-
<label class="nofloat"><?php echo ($field['type'] == 'textarea' || $field['type'] == 'rte')?'Rows':'Max length of input' ?>:</label>
|
82 |
<input type="text" name="field_options[max_<?php echo $field['id'] ?>]" value="<?php echo $field['max']; ?>" size="5">
|
83 |
</p>
|
84 |
<?php } ?>
|
85 |
<?php if ($display['label_position']){ ?>
|
86 |
-
<p><label
|
87 |
<select name="field_options[label_<?php echo $field['id'] ?>]">
|
88 |
-
<option value="top"<?php echo ($field['label'] == 'top')?(' selected="true"'):('');
|
89 |
-
<option value="left"<?php echo ($field['label'] == 'left')?(' selected="true"'):('');
|
90 |
-
<option value="
|
|
|
91 |
</select>
|
92 |
</p>
|
93 |
<?php } ?>
|
94 |
<?php if ($display['required']){ ?>
|
95 |
-
<p><label
|
96 |
<input type="text" name="field_options[required_indicator_<?php echo $field['id'] ?>]" value="<?php echo $field['required_indicator']; ?>">
|
97 |
</p>
|
98 |
-
<p><label
|
99 |
<input type="text" name="field_options[blank_<?php echo $field['id'] ?>]" value="<?php echo $field['blank']; ?>" size="50">
|
100 |
</p>
|
101 |
<?php } ?>
|
102 |
<?php if ($display['invalid']){ ?>
|
103 |
-
<p><label
|
104 |
<input type="text" name="field_options[invalid_<?php echo $field['id'] ?>]" value="<?php echo $field['invalid']; ?>" size="50">
|
105 |
</p>
|
106 |
<?php } ?>
|
1 |
<?php $display = apply_filters('frm_display_field_options', array('type' => $field['type'], 'field_data' => $field, 'required' => true, 'description' => true, 'options' => true, 'label_position' => true, 'invalid' => false, 'size' => false, 'clear_on_focus' => false, 'default_blank' => true)); ?>
|
2 |
|
3 |
+
<li id="frm_field_id_<?php echo $field['id']; ?>" class="edit_form_item frm_field_box ui-state-default frm_hide_options<?php echo $display['options'] ?> edit_field_type_<?php echo $display['type'] ?>" onmouseover="frm_field_hover(1,<?php echo $field['id']; ?>)" onmouseout="frm_field_hover(0,<?php echo $field['id']; ?>)">
|
4 |
<a href="javascript:void(0);" class="alignright frm-show-hover frm-move" title="Move Field"><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="Move"></a>
|
5 |
<a href="javascript:frm_delete_field(<?php echo $field['id']; ?>)" class="alignright frm-show-hover" id="frm_delete_field<?php echo $field['id']; ?>" title="Delete Field"><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></a>
|
6 |
<?php do_action('frm_extra_field_actions', $field['id']); ?>
|
15 |
<?php if ($display['type'] == 'text'){ ?>
|
16 |
<input type="text" name="<?php echo $field_name ?>" value="<?php echo $field['default_value']; ?>" size="<?php echo $field['size']; ?>"/>
|
17 |
<?php }else if ($field['type'] == 'textarea'){ ?>
|
18 |
+
<textarea name="<?php echo $field_name ?>"<?php if ($field['size']) echo ' cols="'.$field['size'].'"' ?> rows="<?php echo $field['max']; ?>"><?php echo $field['default_value']; ?></textarea>
|
19 |
|
20 |
<?php }else if ($field['type'] == 'radio' || $field['type'] == 'checkbox'){
|
21 |
$field['value'] = maybe_unserialize($field['default_value']); ?>
|
22 |
<?php require(FRM_VIEWS_PATH.'/frm-fields/radio.php'); ?>
|
23 |
|
24 |
<div id="frm_add_field_<?php echo $field['id']; ?>" class="frm-show-click">
|
25 |
+
<a href="javascript:frm_add_field_option(<?php echo $field['id']; ?>)"><span class="ui-icon ui-icon-plusthick alignleft"></span> <?php _e('Add an Option', FRM_PLUGIN_NAME) ?></a>
|
26 |
</div>
|
27 |
|
28 |
<?php }else if ($field['type'] == 'select'){ ?>
|
35 |
<?php if ($display['default_blank']) FrmFieldsHelper::show_default_blank_js($field['id'], $field['default_blank']); ?>
|
36 |
<br/>
|
37 |
<div class="frm-show-click">
|
38 |
+
<?php foreach ($field['options'] as $opt_key => $opt) require(FRM_VIEWS_PATH.'/frm-fields/single-option.php'); ?>
|
39 |
+
<div id="frm_add_field_<?php echo $field['id']; ?>">
|
40 |
+
<a href="javascript:frm_add_field_option(<?php echo $field['id']; ?>)"><span class="ui-icon ui-icon-plusthick alignleft"></span>
|
41 |
+
<?php _e('Add an Option', FRM_PLUGIN_NAME) ?></a>
|
42 |
+
<?php do_action('frm_add_multiple_opts', $field); ?>
|
43 |
+
</div>
|
|
|
44 |
</div>
|
|
|
45 |
<?php }else if ($field['type'] == 'captcha'){
|
46 |
+
if (array_key_exists('captcha', FrmFieldsHelper::field_selection())){
|
47 |
global $recaptcha_opt, $frm_siteurl; ?>
|
48 |
<img src="<?php echo FRM_URL ?>/images/<?php echo $recaptcha_opt['re_theme'];?>-captcha.png">
|
49 |
+
<span class="howto"><?php printf(__('Hint: Change colors in the "Registration Options" %1$sreCAPTCHA settings', FRM_PLUGIN_NAME), '<a href="'. $frm_siteurl .'/wp-admin/options-general.php?page=wp-recaptcha/wp-recaptcha.php">') ?></a></span>
|
50 |
<input type="hidden" name="<?php echo $field_name ?>" value="1"/>
|
51 |
<?php }else
|
52 |
+
_e('Please download and activate the WP reCAPTCHA plugin to enable this feature.', FRM_PLUGIN_NAME);
|
53 |
|
54 |
}else
|
55 |
do_action('frm_display_added_fields',$field);
|
62 |
}
|
63 |
|
64 |
if ($display['description']){ ?>
|
65 |
+
<div class="frm_ipe_field_desc description frm-show-click" id="field_<?php echo $field['id']; ?>"><?php echo $field['description']; ?></div>
|
66 |
<?php
|
67 |
}
|
68 |
|
69 |
if ($display['options']){ ?>
|
70 |
<h3 class="ui-accordion-header ui-state-default">
|
71 |
<span class="ui-icon ui-icon-triangle-1-e"></span>
|
72 |
+
<a href="#"><?php _e('Field Options', FRM_PLUGIN_NAME) ?></a>
|
73 |
</h3>
|
74 |
<div class="ui-widget-content ui-corner-bottom">
|
75 |
<?php if ($display['size']){ ?>
|
76 |
+
<p><label><?php echo ($field['type'] == 'textarea' || $field['type'] == 'rte')? __('Columns', FRM_PLUGIN_NAME) : __('Field Size', FRM_PLUGIN_NAME) ?>:</label>
|
77 |
<input type="text" name="field_options[size_<?php echo $field['id'] ?>]" value="<?php echo $field['size']; ?>" size="5">
|
78 |
|
79 |
+
<label class="nofloat"><?php echo ($field['type'] == 'textarea' || $field['type'] == 'rte')? __('Rows', FRM_PLUGIN_NAME) : __('Max length of input', FRM_PLUGIN_NAME) ?>:</label>
|
80 |
<input type="text" name="field_options[max_<?php echo $field['id'] ?>]" value="<?php echo $field['max']; ?>" size="5">
|
81 |
</p>
|
82 |
<?php } ?>
|
83 |
<?php if ($display['label_position']){ ?>
|
84 |
+
<p><label><?php _e('Label Position', FRM_PLUGIN_NAME) ?>:</label>
|
85 |
<select name="field_options[label_<?php echo $field['id'] ?>]">
|
86 |
+
<option value="top"<?php echo ($field['label'] == 'top')?(' selected="true"'):(''); ?>><?php _e('Top', FRM_PLUGIN_NAME) ?></option>
|
87 |
+
<option value="left"<?php echo ($field['label'] == 'left')?(' selected="true"'):(''); ?>><?php _e('Left', FRM_PLUGIN_NAME) ?></option>
|
88 |
+
<option value="right"<?php echo ($field['label'] == 'right')?(' selected="true"'):(''); ?>><?php _e('Right', FRM_PLUGIN_NAME) ?></option>
|
89 |
+
<option value="none"<?php echo ($field['label'] == 'none')?(' selected="true"'):(''); ?>><?php _e('Hidden', FRM_PLUGIN_NAME) ?></option>
|
90 |
</select>
|
91 |
</p>
|
92 |
<?php } ?>
|
93 |
<?php if ($display['required']){ ?>
|
94 |
+
<p><label><?php _e('Indicate required field with', FRM_PLUGIN_NAME) ?>:</label>
|
95 |
<input type="text" name="field_options[required_indicator_<?php echo $field['id'] ?>]" value="<?php echo $field['required_indicator']; ?>">
|
96 |
</p>
|
97 |
+
<p><label><?php _e('Error message if required field is left blank', FRM_PLUGIN_NAME) ?>:</label>
|
98 |
<input type="text" name="field_options[blank_<?php echo $field['id'] ?>]" value="<?php echo $field['blank']; ?>" size="50">
|
99 |
</p>
|
100 |
<?php } ?>
|
101 |
<?php if ($display['invalid']){ ?>
|
102 |
+
<p><label><?php _e('Error message if entry is an invalid format', FRM_PLUGIN_NAME) ?>:</label>
|
103 |
<input type="text" name="field_options[invalid_<?php echo $field['id'] ?>]" value="<?php echo $field['invalid']; ?>" size="50">
|
104 |
</p>
|
105 |
<?php } ?>
|
classes/views/frm-forms/add_field_links.php
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
<div id="frm_form_options" class="alignright">
|
2 |
<?php if (!$values['is_template']){ ?>
|
3 |
-
<p class="howto"
|
4 |
-
<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; ?>]'
|
5 |
<?php } ?>
|
6 |
|
7 |
<ul class="frmbutton nodrag">
|
8 |
-
<li class="ui-widget-header"><a href="<?php echo FrmFormsHelper::get_direct_link($values['form_key']); ?>" target="blank"
|
9 |
<?php global $frm_settings; if ($frm_settings->preview_page_id > 0){ ?>
|
10 |
-
<li class="ui-widget-header"><a href="<?php echo add_query_arg('form', $values['form_key'], get_permalink($frm_settings->preview_page_id)) ?>" target="blank" class="frmbutton"
|
11 |
<?php } ?>
|
12 |
</ul>
|
13 |
|
14 |
-
<p class="howto"
|
15 |
<div id="themeRoller" class="clearfix">
|
16 |
<div id="rollerTabs">
|
17 |
|
18 |
<fieldset class="clearfix">
|
19 |
<div class="theme-group clearfix">
|
20 |
<div class="theme-group-header state-default">
|
21 |
-
<span class="icon icon-triangle-1-e"
|
22 |
-
<a href="#"
|
23 |
</div><!-- /theme group Error -->
|
24 |
<div class="theme-group-content corner-bottom clearfix">
|
25 |
<div class="clearfix">
|
@@ -27,60 +27,65 @@
|
|
27 |
<?php foreach ($frm_field_selection as $field_key => $field_type){ ?>
|
28 |
<li class="frmbutton button" 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>
|
29 |
<?php } ?>
|
30 |
-
<?php if (
|
31 |
-
global $frm_siteurl;
|
32 |
-
|
33 |
-
|
34 |
</ul>
|
35 |
</div>
|
36 |
-
|
37 |
</div><!-- /theme group content -->
|
38 |
</div><!-- /theme group -->
|
39 |
|
40 |
<div class="theme-group clearfix">
|
41 |
<div class="theme-group-header state-default">
|
42 |
-
<span class="icon icon-triangle-1-e"
|
43 |
-
<a href="#"
|
44 |
</div><!-- /theme group Error -->
|
45 |
<div class="theme-group-content corner-bottom clearfix">
|
46 |
<div class="clearfix">
|
47 |
<ul class="field_type_list">
|
48 |
<?php
|
49 |
if($frmpro_is_installed){
|
50 |
-
foreach (
|
51 |
<li class="frmbutton button" 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>
|
52 |
<?php }
|
53 |
}else
|
54 |
-
foreach (
|
55 |
echo '<li class="frmbutton">'.$field_type.'</li>';
|
56 |
?>
|
57 |
</ul>
|
58 |
</div>
|
59 |
-
|
60 |
</div><!-- /theme group content -->
|
61 |
</div><!-- /theme group -->
|
62 |
|
63 |
|
64 |
<div class="theme-group clearfix">
|
65 |
<div class="theme-group-header state-default">
|
66 |
-
<span class="icon icon-triangle-1-e"
|
67 |
-
<a href="#"
|
68 |
</div><!-- /theme group Content -->
|
69 |
<div class="theme-group-content corner-bottom clearfix">
|
70 |
|
71 |
<div class="clearfix">
|
72 |
<ul class="ui-state-default">
|
73 |
-
<li><span class="ui-icon ui-icon-star alignleft"></span> = required field
|
74 |
-
<li><span class="frm_inactive_icon ui-icon ui-icon-star alignleft"></span>
|
75 |
-
|
76 |
-
<li><span
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
<li><span><img src="<?php echo FRM_IMAGES_URL
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
</ul>
|
83 |
-
|
84 |
</div>
|
85 |
</div><!-- /theme group content -->
|
86 |
</div><!-- /theme group -->
|
@@ -88,8 +93,9 @@
|
|
88 |
</fieldset>
|
89 |
|
90 |
</div>
|
|
|
91 |
</div><!-- /themeroller -->
|
92 |
|
93 |
-
|
94 |
|
95 |
</div>
|
1 |
<div id="frm_form_options" class="alignright">
|
2 |
<?php if (!$values['is_template']){ ?>
|
3 |
+
<p class="howto"><?php _e('Copy this code and paste it into your post, page or text widget', FRM_PLUGIN_NAME) ?>:
|
4 |
+
<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>
|
5 |
<?php } ?>
|
6 |
|
7 |
<ul class="frmbutton nodrag">
|
8 |
+
<li class="ui-widget-header"><a href="<?php echo FrmFormsHelper::get_direct_link($values['form_key']); ?>" target="blank" ><?php _e('Preview Form', FRM_PLUGIN_NAME) ?></a></li>
|
9 |
<?php global $frm_settings; if ($frm_settings->preview_page_id > 0){ ?>
|
10 |
+
<li class="ui-widget-header"><a href="<?php echo add_query_arg('form', $values['form_key'], get_permalink($frm_settings->preview_page_id)) ?>" target="blank" class="frmbutton"><?php _e('Preview Form in Current Theme', FRM_PLUGIN_NAME) ?></a></li>
|
11 |
<?php } ?>
|
12 |
</ul>
|
13 |
|
14 |
+
<p class="howto"><?php _e('Click on or drag a field into your form', FRM_PLUGIN_NAME) ?></p>
|
15 |
<div id="themeRoller" class="clearfix">
|
16 |
<div id="rollerTabs">
|
17 |
|
18 |
<fieldset class="clearfix">
|
19 |
<div class="theme-group clearfix">
|
20 |
<div class="theme-group-header state-default">
|
21 |
+
<span class="icon icon-triangle-1-e"><?php _e('Collapse', FRM_PLUGIN_NAME) ?></span>
|
22 |
+
<a href="#"><?php _e('Basic Fields', FRM_PLUGIN_NAME) ?></a>
|
23 |
</div><!-- /theme group Error -->
|
24 |
<div class="theme-group-content corner-bottom clearfix">
|
25 |
<div class="clearfix">
|
27 |
<?php foreach ($frm_field_selection as $field_key => $field_type){ ?>
|
28 |
<li class="frmbutton button" 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>
|
29 |
<?php } ?>
|
30 |
+
<?php if (!array_key_exists('captcha', $frm_field_selection) && !function_exists( 'akismet_http_post' )){
|
31 |
+
global $frm_siteurl; ?>
|
32 |
+
<p class="howto"><?php printf(__('Hint: Download and activate %1$sWP-reCAPTCHA%2$s to add a captcha to your form. Alternatively activate Akismet for captcha-free spam screening.', FRM_PLUGIN_NAME), '<a href="'.$frm_siteurl.'/wp-admin/plugin-install.php?tab=plugin-information&plugin=wp-recaptcha&TB_iframe=true&width=640&height=593" class="thickbox onclick" title="WP-reCAPTCHA">', '</a>'); ?></p>
|
33 |
+
<?php } ?>
|
34 |
</ul>
|
35 |
</div>
|
|
|
36 |
</div><!-- /theme group content -->
|
37 |
</div><!-- /theme group -->
|
38 |
|
39 |
<div class="theme-group clearfix">
|
40 |
<div class="theme-group-header state-default">
|
41 |
+
<span class="icon icon-triangle-1-e"><?php _e('Collapse', FRM_PLUGIN_NAME) ?></span>
|
42 |
+
<a href="#"><?php _e('Pro Fields', FRM_PLUGIN_NAME) ?></a>
|
43 |
</div><!-- /theme group Error -->
|
44 |
<div class="theme-group-content corner-bottom clearfix">
|
45 |
<div class="clearfix">
|
46 |
<ul class="field_type_list">
|
47 |
<?php
|
48 |
if($frmpro_is_installed){
|
49 |
+
foreach (FrmFieldsHelper::pro_field_selection() as $field_key => $field_type){ ?>
|
50 |
<li class="frmbutton button" 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>
|
51 |
<?php }
|
52 |
}else
|
53 |
+
foreach (FrmFieldsHelper::pro_field_selection() as $field_key => $field_type)
|
54 |
echo '<li class="frmbutton">'.$field_type.'</li>';
|
55 |
?>
|
56 |
</ul>
|
57 |
</div>
|
|
|
58 |
</div><!-- /theme group content -->
|
59 |
</div><!-- /theme group -->
|
60 |
|
61 |
|
62 |
<div class="theme-group clearfix">
|
63 |
<div class="theme-group-header state-default">
|
64 |
+
<span class="icon icon-triangle-1-e"><?php _e('Collapse', FRM_PLUGIN_NAME) ?></span>
|
65 |
+
<a href="#"><?php _e('Key', FRM_PLUGIN_NAME) ?></a>
|
66 |
</div><!-- /theme group Content -->
|
67 |
<div class="theme-group-content corner-bottom clearfix">
|
68 |
|
69 |
<div class="clearfix">
|
70 |
<ul class="ui-state-default">
|
71 |
+
<li><span class="ui-icon ui-icon-star alignleft"></span> = <?php _e('required field', FRM_PLUGIN_NAME) ?></li>
|
72 |
+
<li><span class="frm_inactive_icon ui-icon ui-icon-star alignleft"></span>
|
73 |
+
= <?php _e('not required', FRM_PLUGIN_NAME) ?></li>
|
74 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></span>
|
75 |
+
= <?php _e('clear default text on click', FRM_PLUGIN_NAME) ?></li>
|
76 |
+
<li><span class="frm_inactive_icon"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></span>
|
77 |
+
= <?php _e('do not clear default text on click', FRM_PLUGIN_NAME) ?></li>
|
78 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL?>/error.png"></span>
|
79 |
+
= <?php _e('default value will NOT pass validation', FRM_PLUGIN_NAME) ?></li>
|
80 |
+
<li><span class="frm_inactive_icon"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></span>
|
81 |
+
= <?php _e('default value will pass validation', FRM_PLUGIN_NAME) ?></li>
|
82 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></span>
|
83 |
+
= <?php _e('delete field and all inputed data', FRM_PLUGIN_NAME) ?></li>
|
84 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL ?>/duplicate.png" alt="Move"></span>
|
85 |
+
= <?php _e('duplicate field', FRM_PLUGIN_NAME) ?></li>
|
86 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="Move"></span> =
|
87 |
+
<?php _e('move field', FRM_PLUGIN_NAME) ?></li>
|
88 |
</ul>
|
|
|
89 |
</div>
|
90 |
</div><!-- /theme group content -->
|
91 |
</div><!-- /theme group -->
|
93 |
</fieldset>
|
94 |
|
95 |
</div>
|
96 |
+
<p class="howto"><?php _e('Enter or select default values into fields on this form.', FRM_PLUGIN_NAME) ?></p>
|
97 |
</div><!-- /themeroller -->
|
98 |
|
99 |
+
|
100 |
|
101 |
</div>
|
classes/views/frm-forms/default-templates.php
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
<?php FrmFormsHelper::get_template_dropdown($all_templates); ?>
|
2 |
|
3 |
-
<h3
|
4 |
<table class="widefat post fixed" cellspacing="0">
|
5 |
<thead>
|
6 |
<tr>
|
7 |
-
<th class="manage-column" width="30%"
|
8 |
-
<th class="manage-column"
|
9 |
</tr>
|
10 |
</thead>
|
11 |
<?php if(empty($default_templates)){ ?>
|
12 |
-
<tr><td colspan="2"
|
13 |
<?php
|
14 |
}else{
|
15 |
foreach($default_templates as $form){
|
16 |
?>
|
17 |
<tr style="min-height: 60px; height: 60px;">
|
18 |
<td class="edit_item">
|
19 |
-
<a class="item_name" href="<?php echo $url = FrmFormsHelper::get_direct_link($form->form_key); ?>" title="Preview <?php echo stripslashes($form->name); ?>" target="blank"><?php echo stripslashes($form->name); ?></a>
|
20 |
<br/>
|
21 |
<div class="item_actions">
|
22 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>" title="Copy <?php echo $form->name; ?>"
|
23 |
<?php global $frm_settings;
|
24 |
if ($frm_settings->preview_page_id > 0)
|
25 |
$url = add_query_arg('form', $form->form_key, get_permalink($frm_settings->preview_page_id));
|
26 |
?>
|
27 |
-
<a href="<?php echo $url ?>" title="View <?php echo stripslashes($form->name); ?>" target="blank"
|
28 |
</div>
|
29 |
</td>
|
30 |
<td><?php echo $form->description ?></td>
|
@@ -35,10 +35,10 @@
|
|
35 |
?>
|
36 |
<tfoot>
|
37 |
<tr>
|
38 |
-
<th class="manage-column"
|
39 |
-
<th class="manage-column"
|
40 |
</tr>
|
41 |
</tfoot>
|
42 |
</table>
|
43 |
|
44 |
-
<br/><br/><h3
|
1 |
<?php FrmFormsHelper::get_template_dropdown($all_templates); ?>
|
2 |
|
3 |
+
<h3><?php _e('Default Templates', 'formidable') ?></h3>
|
4 |
<table class="widefat post fixed" cellspacing="0">
|
5 |
<thead>
|
6 |
<tr>
|
7 |
+
<th class="manage-column" width="30%"><?php _e('Name', 'formidable') ?></th>
|
8 |
+
<th class="manage-column"><?php _e('Description', 'formidable') ?></th>
|
9 |
</tr>
|
10 |
</thead>
|
11 |
<?php if(empty($default_templates)){ ?>
|
12 |
+
<tr><td colspan="2"><?php _e('No Templates Found', 'formidable') ?></td></tr>
|
13 |
<?php
|
14 |
}else{
|
15 |
foreach($default_templates as $form){
|
16 |
?>
|
17 |
<tr style="min-height: 60px; height: 60px;">
|
18 |
<td class="edit_item">
|
19 |
+
<a class="item_name" href="<?php echo $url = FrmFormsHelper::get_direct_link($form->form_key); ?>" title="<?php _e('Preview', 'formidable')?> <?php echo stripslashes($form->name); ?>" target="blank"><?php echo stripslashes($form->name); ?></a>
|
20 |
<br/>
|
21 |
<div class="item_actions">
|
22 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>" title="<?php _e('Copy', 'formidable') ?> <?php echo $form->name; ?>"><?php _e('Create Form from Template', 'formidable') ?></a> |
|
23 |
<?php global $frm_settings;
|
24 |
if ($frm_settings->preview_page_id > 0)
|
25 |
$url = add_query_arg('form', $form->form_key, get_permalink($frm_settings->preview_page_id));
|
26 |
?>
|
27 |
+
<a href="<?php echo $url ?>" title="View <?php echo stripslashes($form->name); ?>" target="blank"><?php _e('View', 'formidable') ?></a>
|
28 |
</div>
|
29 |
</td>
|
30 |
<td><?php echo $form->description ?></td>
|
35 |
?>
|
36 |
<tfoot>
|
37 |
<tr>
|
38 |
+
<th class="manage-column"><?php _e('Name', 'formidable') ?></th>
|
39 |
+
<th class="manage-column"><?php _e('Description', 'formidable') ?></th>
|
40 |
</tr>
|
41 |
</tfoot>
|
42 |
</table>
|
43 |
|
44 |
+
<br/><br/><h3><?php _e('Custom Templates', 'formidable') ?></h3>
|
classes/views/frm-forms/edit.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Edit Form
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
@@ -9,8 +9,8 @@
|
|
9 |
<div class="frm_form_builder alignleft" id="poststuff">
|
10 |
<form name="form1" method="post" action="">
|
11 |
<p class="submit">
|
12 |
-
<input type="submit" name="Submit" value="Update" class="button-primary" /> or
|
13 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME ?>"
|
14 |
</p>
|
15 |
|
16 |
<input type="hidden" name="action" value="update">
|
@@ -20,8 +20,8 @@
|
|
20 |
<?php require(FRM_VIEWS_PATH.'/frm-forms/form.php'); ?>
|
21 |
|
22 |
<p class="submit">
|
23 |
-
<input type="submit" name="Submit" value="Update" class="button-primary" /> or
|
24 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME ?>"
|
25 |
</p>
|
26 |
</form>
|
27 |
</div>
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Edit Form', 'formidable') ?></h2>
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
9 |
<div class="frm_form_builder alignleft" id="poststuff">
|
10 |
<form name="form1" method="post" action="">
|
11 |
<p class="submit">
|
12 |
+
<input type="submit" name="Submit" value="<?php _e('Update', 'formidable') ?>" class="button-primary" /> <?php _e('or', 'formidable') ?>
|
13 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME ?>"><?php _e('Cancel', 'formidable') ?></a>
|
14 |
</p>
|
15 |
|
16 |
<input type="hidden" name="action" value="update">
|
20 |
<?php require(FRM_VIEWS_PATH.'/frm-forms/form.php'); ?>
|
21 |
|
22 |
<p class="submit">
|
23 |
+
<input type="submit" name="Submit" value="<?php _e('Update', 'formidable') ?>" class="button-primary" /> <?php _e('or', 'formidable') ?>
|
24 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME ?>"><?php _e('Cancel', 'formidable') ?></a>
|
25 |
</p>
|
26 |
</form>
|
27 |
</div>
|
classes/views/frm-forms/footer.php
CHANGED
@@ -50,8 +50,15 @@ $("#new_fields").sortable({
|
|
50 |
jQuery.ajax({
|
51 |
type:"POST",
|
52 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
53 |
-
data:"action=frm_insert_field&form_id=<?php echo $id; ?>&
|
54 |
-
success:function(msg){ $('.frmbutton_loadingnow#'+new_id).replaceWith(msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
});
|
56 |
},
|
57 |
update:function(){
|
50 |
jQuery.ajax({
|
51 |
type:"POST",
|
52 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
53 |
+
data:"action=frm_insert_field&form_id=<?php echo $id; ?>&field="+new_id,
|
54 |
+
success:function(msg){ $('.frmbutton_loadingnow#'+new_id).replaceWith(msg);
|
55 |
+
var order= $('#new_fields').sortable('serialize');
|
56 |
+
jQuery.ajax({
|
57 |
+
type:"POST",
|
58 |
+
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
59 |
+
data:"action=frm_update_field_order&"+order
|
60 |
+
});
|
61 |
+
}
|
62 |
});
|
63 |
},
|
64 |
update:function(){
|
classes/views/frm-forms/form.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div id="frm_form_editor_container">
|
2 |
<div id="form_desc" class="edit_form_item frm_field_box frm_head_box">
|
3 |
<h2 class="frm_ipe_form_name" id="frmform_<?php echo $id; ?>"><?php echo $values['name']; ?></h2>
|
4 |
-
<div class="frm_ipe_form_desc"><?php echo
|
5 |
</div>
|
6 |
|
7 |
<ul id="new_fields">
|
@@ -17,52 +17,52 @@ if (isset($values['fields']) && !empty($values['fields'])){
|
|
17 |
<?php if (!$values['is_template']){ ?>
|
18 |
<h3 class="ui-accordion-header ui-state-default">
|
19 |
<span class="ui-icon ui-icon-triangle-1-e"></span>
|
20 |
-
<a href="#"
|
21 |
</h3>
|
22 |
<div class="ui-widget-content ui-corner-bottom">
|
23 |
-
<span class="alignright"><a title="<?php _e(
|
24 |
|
25 |
-
<p style="clear:both;"><label
|
26 |
[formidable id=<?php echo $id; ?> title=true description=true] [formidable key=<?php echo $values['form_key']; ?>]
|
27 |
</p>
|
28 |
|
29 |
-
<p><label
|
30 |
<input type="text" name="form_key" value="<?php echo $values['form_key']; ?>" />
|
31 |
</p>
|
32 |
|
33 |
-
<p><label
|
34 |
-
Use Formidable styling for this form
|
35 |
</p>
|
36 |
|
37 |
-
<p><label
|
38 |
-
<input type="text" name="options[email_to]" value="<?php echo $values['email_to']; ?>" />
|
39 |
</p>
|
40 |
|
41 |
-
<p><label
|
42 |
<input type="text" name="options[submit_value]" value="<?php echo $values['submit_value']; ?>" />
|
43 |
</p>
|
44 |
|
45 |
-
<p><label
|
46 |
<input type="text" name="options[success_msg]" size="55" value="<?php echo $values['success_msg']; ?>" />
|
47 |
</p>
|
48 |
|
49 |
<?php do_action('frm_additional_form_options', $values); ?>
|
50 |
|
51 |
<?php if (function_exists( 'akismet_http_post' )){ ?>
|
52 |
-
<p><input type="checkbox" name="options[akismet]" id="akismet" value="1" <?php checked($values['akismet'], 1); ?> /> Use Akismet to check entries for spam
|
53 |
<?php } ?>
|
54 |
</div>
|
55 |
</div>
|
56 |
<div id="frm_editable_html" style="display:none;">
|
57 |
<div class="alignleft" style="width:500px">
|
58 |
-
<p><label class="frm_pos_top"
|
59 |
<textarea name="options[before_html]" rows="4" style="width:100%"><?php echo $values['before_html']?></textarea></p>
|
60 |
|
61 |
<div id="add_html_fields">
|
62 |
<?php
|
63 |
if (isset($values['fields'])){
|
64 |
foreach($values['fields'] as $field){
|
65 |
-
if (apply_filters('
|
66 |
<p><label class="frm_pos_top"><?php echo $field['name'] ?></label>
|
67 |
<textarea name="field_options[custom_html_<?php echo $field['id'] ?>]" rows="7" style="width:100%"><?php echo $field['custom_html'] ?></textarea></p>
|
68 |
<?php }
|
@@ -70,26 +70,26 @@ if (isset($values['fields']) && !empty($values['fields'])){
|
|
70 |
} ?>
|
71 |
</div>
|
72 |
|
73 |
-
<p><label class="frm_pos_top"
|
74 |
<textarea name="options[after_html]" rows="3" style="width:100%"><?php echo $values['after_html']?></textarea></p>
|
75 |
</div>
|
76 |
|
77 |
<div class="alignright" style="width:150px;">
|
78 |
-
<h4
|
79 |
<ul>
|
80 |
-
<li><b
|
81 |
-
<li><b
|
82 |
</ul>
|
83 |
<ul>
|
84 |
-
<li><b
|
85 |
-
<li><b
|
86 |
-
<li><b
|
87 |
-
<li><b
|
88 |
-
<li><b
|
89 |
-
<li><b
|
90 |
-
<li><b
|
91 |
-
<li><b
|
92 |
-
<li><b
|
93 |
</ul>
|
94 |
</div>
|
95 |
|
1 |
<div id="frm_form_editor_container">
|
2 |
<div id="form_desc" class="edit_form_item frm_field_box frm_head_box">
|
3 |
<h2 class="frm_ipe_form_name" id="frmform_<?php echo $id; ?>"><?php echo $values['name']; ?></h2>
|
4 |
+
<div class="frm_ipe_form_desc"><?php echo $values['description']; ?></div>
|
5 |
</div>
|
6 |
|
7 |
<ul id="new_fields">
|
17 |
<?php if (!$values['is_template']){ ?>
|
18 |
<h3 class="ui-accordion-header ui-state-default">
|
19 |
<span class="ui-icon ui-icon-triangle-1-e"></span>
|
20 |
+
<a href="#"><?php _e('Advanced Form Options', 'formidable') ?></a>
|
21 |
</h3>
|
22 |
<div class="ui-widget-content ui-corner-bottom">
|
23 |
+
<span class="alignright"><a title="<?php _e('Edit HTML', 'formidable') ?>" href="#TB_inline?height=500&width=700&inlineId=frm_editable_html" class="thickbox button"><?php _e('Edit HTML', 'formidable') ?></a></span>
|
24 |
|
25 |
+
<p style="clear:both;"><label><?php _e('Form ShortCodes') ?>:</label>
|
26 |
[formidable id=<?php echo $id; ?> title=true description=true] [formidable key=<?php echo $values['form_key']; ?>]
|
27 |
</p>
|
28 |
|
29 |
+
<p><label><?php _e('Form Key') ?></label>
|
30 |
<input type="text" name="form_key" value="<?php echo $values['form_key']; ?>" />
|
31 |
</p>
|
32 |
|
33 |
+
<p><label><?php _e('Styling', 'formidable') ?></label><input type="checkbox" name="options[custom_style]" <?php echo ($values['custom_style']) ? (' checked="checked"') : (''); ?> />
|
34 |
+
<?php _e('Use Formidable styling for this form', 'formidable') ?>
|
35 |
</p>
|
36 |
|
37 |
+
<p><label><?php _e('Email Form Responses to', 'formidable') ?></label>
|
38 |
+
<input type="text" name="options[email_to]" size="55" value="<?php echo $values['email_to']; ?>" />
|
39 |
</p>
|
40 |
|
41 |
+
<p><label><?php _e('New Entry Submit Button Label', 'formidable') ?></label>
|
42 |
<input type="text" name="options[submit_value]" value="<?php echo $values['submit_value']; ?>" />
|
43 |
</p>
|
44 |
|
45 |
+
<p><label><?php _e('New Entry Success Message', 'formidable') ?></label>
|
46 |
<input type="text" name="options[success_msg]" size="55" value="<?php echo $values['success_msg']; ?>" />
|
47 |
</p>
|
48 |
|
49 |
<?php do_action('frm_additional_form_options', $values); ?>
|
50 |
|
51 |
<?php if (function_exists( 'akismet_http_post' )){ ?>
|
52 |
+
<p><input type="checkbox" name="options[akismet]" id="akismet" value="1" <?php checked($values['akismet'], 1); ?> /> <?php _e('Use Akismet to check entries for spam', 'formidable') ?></p>
|
53 |
<?php } ?>
|
54 |
</div>
|
55 |
</div>
|
56 |
<div id="frm_editable_html" style="display:none;">
|
57 |
<div class="alignleft" style="width:500px">
|
58 |
+
<p><label class="frm_pos_top"><?php _e('Before Fields', 'formidable') ?></label>
|
59 |
<textarea name="options[before_html]" rows="4" style="width:100%"><?php echo $values['before_html']?></textarea></p>
|
60 |
|
61 |
<div id="add_html_fields">
|
62 |
<?php
|
63 |
if (isset($values['fields'])){
|
64 |
foreach($values['fields'] as $field){
|
65 |
+
if (apply_filters('frm_show_custom_html', true, $field['type'])){ ?>
|
66 |
<p><label class="frm_pos_top"><?php echo $field['name'] ?></label>
|
67 |
<textarea name="field_options[custom_html_<?php echo $field['id'] ?>]" rows="7" style="width:100%"><?php echo $field['custom_html'] ?></textarea></p>
|
68 |
<?php }
|
70 |
} ?>
|
71 |
</div>
|
72 |
|
73 |
+
<p><label class="frm_pos_top"><?php _e('After Fields', 'formidable') ?></label>
|
74 |
<textarea name="options[after_html]" rows="3" style="width:100%"><?php echo $values['after_html']?></textarea></p>
|
75 |
</div>
|
76 |
|
77 |
<div class="alignright" style="width:150px;">
|
78 |
+
<h4><?php _e('Key', 'formidable') ?></h4>
|
79 |
<ul>
|
80 |
+
<li><b><?php _e('Form Name', 'formidable') ?>:</b> [form_name]</li>
|
81 |
+
<li><b><?php _e('Form Description', 'formidable') ?>:</b> [form_description]</li>
|
82 |
</ul>
|
83 |
<ul>
|
84 |
+
<li><b><?php _e('Field Id', 'formidable') ?>:</b> [id]</li>
|
85 |
+
<li><b><?php _e('Field Key', 'formidable') ?>:</b> [key]</li>
|
86 |
+
<li><b><?php _e('Field Name', 'formidable') ?>:</b> [field_name]</li>
|
87 |
+
<li><b><?php _e('Field Description', 'formidable') ?>:</b> [description]</li>
|
88 |
+
<li><b><?php _e('Label Position', 'formidable') ?>:</b> [label_position]</li>
|
89 |
+
<li><b><?php _e('Required label', 'formidable') ?>:</b> [required_label]</li>
|
90 |
+
<li><b><?php _e('Input Field', 'formidable') ?>:</b> [input]</li>
|
91 |
+
<li><b><?php _e('Add class name if field is required', 'formidable') ?>:</b> [required_class]</li>
|
92 |
+
<li><b><?php _e('Add class name if field has an error on form submit', 'formidable') ?>:</b> [error_class]</li>
|
93 |
</ul>
|
94 |
</div>
|
95 |
|
classes/views/frm-forms/list.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php echo ($params['template'])? 'Templates' : 'Forms'; ?></h2>
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
@@ -18,24 +18,33 @@
|
|
18 |
<tr>
|
19 |
<?php if ($params['template']){ ?>
|
20 |
<th class="manage-column" width="30%">
|
21 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-templates&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"
|
22 |
-
|
|
|
|
|
|
|
23 |
<?php }else{?>
|
24 |
<th class="manage-column" width="50px">
|
25 |
-
<?php do_action('frm_column_header'); ?> <a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=id<?php echo (($sort_str == 'id' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"
|
|
|
26 |
<th class="manage-column" width="">
|
27 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"
|
28 |
-
|
29 |
-
<th class="manage-column"
|
30 |
-
|
31 |
-
|
32 |
-
<th class="manage-column" width="
|
|
|
|
|
|
|
|
|
|
|
33 |
<?php } ?>
|
34 |
</tr>
|
35 |
</thead>
|
36 |
<?php if($record_count <= 0){ ?>
|
37 |
<tr>
|
38 |
-
<td colspan="<?php echo ($params['template'])? '2':'7'; ?>"
|
39 |
</tr>
|
40 |
<?php
|
41 |
}else{
|
@@ -44,37 +53,37 @@
|
|
44 |
<tr style="min-height: 75px; height: 75px;">
|
45 |
<?php if ($params['template']){ ?>
|
46 |
<td class="edit_item">
|
47 |
-
<a class="item_name" href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="Edit <?php echo stripslashes($form->name); ?>"><?php echo stripslashes($form->name); ?></a>
|
48 |
<br/>
|
49 |
<div class="item_actions">
|
50 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>" title="Copy <?php echo $form->name; ?>"
|
51 |
-
| <a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="Edit <?php echo $form->name; ?>"
|
52 |
-
| <a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=destroy&id=<?php echo $form->id; ?>" onclick="return confirm('Are you sure you want to delete your
|
53 |
</div>
|
54 |
</td>
|
55 |
<td><?php echo $form->description ?></td>
|
56 |
<?php }else{ ?>
|
57 |
<td><?php do_action('frm_first_col', $form->id); ?> <?php echo $form->id ?></td>
|
58 |
<td class="edit_item">
|
59 |
-
<a class="item_name" href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="Edit <?php echo stripslashes($form->name); ?>"><?php echo stripslashes($form->name); ?></a>
|
60 |
<br/>
|
61 |
<div class="item_actions">
|
62 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="Edit <?php echo $form->name; ?>"
|
63 |
<?php if($frmpro_is_installed){ ?>
|
64 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-entries&action=new&form=<?php echo $form->id; ?>" title="New <?php echo $form->name; ?> Entry"
|
65 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-entries&form=<?php echo $form->id; ?>" title="<?php echo $form->name; ?> Entries"
|
66 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-reports&form=<?php echo $form->id; ?>" title="<?php echo $form->name; ?> Reports"
|
67 |
<?php } ?>
|
68 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>" title="Copy <?php echo $form->name; ?>"
|
69 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>&template=1" title="Create <?php echo $form->name; ?> Template"
|
70 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=destroy&id=<?php echo $form->id; ?>" onclick="return confirm('Are you sure you want to delete your
|
71 |
</div>
|
72 |
</td>
|
73 |
<td><?php echo stripslashes($form->description) ?></td>
|
74 |
<td><?php echo $form->form_key ?></td>
|
75 |
-
<td><?php echo apply_filters('frm_view_entries_link', $frm_entry->getRecordCount("it.form_id=$form->id") . ' Entries', $form->id); ?></td>
|
76 |
<td>
|
77 |
-
<input type='text' style="font-size: 10px; width: 100%;" readonly="true" onclick='this.select();' onfocus='this.select();' value='<?php echo $target_url = FrmFormsHelper::get_direct_link($form->form_key, $form->prli_link_id); ?>' /><br/><a href="<?php echo $target_url; ?>" target="blank"
|
78 |
</td>
|
79 |
<td><input type='text' style="font-size: 10px; width: 100%;" readonly="true" onclick='this.select();' onfocus='this.select();' value='[formidable id=<?php echo $form->id; ?>]' /></td>
|
80 |
<?php } ?>
|
@@ -86,16 +95,16 @@
|
|
86 |
<tfoot>
|
87 |
<tr>
|
88 |
<?php if ($params['template']){ ?>
|
89 |
-
<th class="manage-column"
|
90 |
-
<th class="manage-column"
|
91 |
<?php }else{ ?>
|
92 |
-
<th class="manage-column"><?php do_action('frm_column_header'); ?> ID
|
93 |
-
<th class="manage-column"
|
94 |
-
<th class="manage-column"
|
95 |
-
<th class="manage-column"
|
96 |
-
<th class="manage-column"
|
97 |
-
<th class="manage-column"
|
98 |
-
<th class="manage-column"
|
99 |
<?php } ?>
|
100 |
</tr>
|
101 |
</tfoot>
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php echo ($params['template'])? __('Templates', FRM_PLUGIN_NAME) : __('Forms', FRM_PLUGIN_NAME); ?></h2>
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
18 |
<tr>
|
19 |
<?php if ($params['template']){ ?>
|
20 |
<th class="manage-column" width="30%">
|
21 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-templates&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"><?php _e('Name', FRM_PLUGIN_NAME) ?><?php echo (($sort_str == 'name')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
|
22 |
+
</th>
|
23 |
+
<th class="manage-column">
|
24 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-templates&sort=description<?php echo (($sort_str == 'description' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"><?php _e('Description', FRM_PLUGIN_NAME) ?><?php echo (($sort_str == 'description')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
|
25 |
+
</th>
|
26 |
<?php }else{?>
|
27 |
<th class="manage-column" width="50px">
|
28 |
+
<?php do_action('frm_column_header'); ?> <a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=id<?php echo (($sort_str == 'id' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"><?php _e('ID', FRM_PLUGIN_NAME) ?><?php echo (($sort_str == 'id')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
|
29 |
+
</th>
|
30 |
<th class="manage-column" width="">
|
31 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"><?php _e('Name', FRM_PLUGIN_NAME) ?><?php echo (($sort_str == 'name')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
|
32 |
+
</th>
|
33 |
+
<th class="manage-column">
|
34 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=description<?php echo (($sort_str == 'description' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"><?php _e('Description', FRM_PLUGIN_NAME) ?><?php echo (($sort_str == 'description')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
|
35 |
+
</th>
|
36 |
+
<th class="manage-column" width="70px">
|
37 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=form_key<?php echo (($sort_str == 'form_key' and $sdir_str == 'asc')?'&sdir=desc':''); ?>"><?php _e('Key', FRM_PLUGIN_NAME) ?><?php echo (($sort_str == 'form_key')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
|
38 |
+
</th>
|
39 |
+
<th class="manage-column" width="60px"><?php _e('Entries', FRM_PLUGIN_NAME) ?></th>
|
40 |
+
<th class="manage-column"><?php _e('Direct Link', FRM_PLUGIN_NAME) ?></th>
|
41 |
+
<th class="manage-column" width="115px"><?php _e('ShortCode', FRM_PLUGIN_NAME) ?></th>
|
42 |
<?php } ?>
|
43 |
</tr>
|
44 |
</thead>
|
45 |
<?php if($record_count <= 0){ ?>
|
46 |
<tr>
|
47 |
+
<td colspan="<?php echo ($params['template'])? '2':'7'; ?>"><?php _e('No Forms Found', FRM_PLUGIN_NAME) ?></td>
|
48 |
</tr>
|
49 |
<?php
|
50 |
}else{
|
53 |
<tr style="min-height: 75px; height: 75px;">
|
54 |
<?php if ($params['template']){ ?>
|
55 |
<td class="edit_item">
|
56 |
+
<a class="item_name" href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="<?php _e('Edit', FRM_PLUGIN_NAME) ?> <?php echo stripslashes($form->name); ?>"><?php echo stripslashes($form->name); ?></a>
|
57 |
<br/>
|
58 |
<div class="item_actions">
|
59 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>" title="<?php _e('Copy', FRM_PLUGIN_NAME) ?> <?php echo $form->name; ?>"><?php _e('Create Form from Template', FRM_PLUGIN_NAME) ?></a>
|
60 |
+
| <a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="<?php _e('Edit', FRM_PLUGIN_NAME) ?> <?php echo $form->name; ?>"><?php _e('Edit', FRM_PLUGIN_NAME) ?></a>
|
61 |
+
| <a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=destroy&id=<?php echo $form->id; ?>" onclick="return confirm(<?php printf(__('Are you sure you want to delete your %1$s Form?'), $form->name) ?>);" title="<?php _e('Delete', FRM_PLUGIN_NAME) ?> <?php echo $form->form_key; ?>"><?php _e('Delete', FRM_PLUGIN_NAME) ?></a>
|
62 |
</div>
|
63 |
</td>
|
64 |
<td><?php echo $form->description ?></td>
|
65 |
<?php }else{ ?>
|
66 |
<td><?php do_action('frm_first_col', $form->id); ?> <?php echo $form->id ?></td>
|
67 |
<td class="edit_item">
|
68 |
+
<a class="item_name" href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="<?php _e('Edit', FRM_PLUGIN_NAME) ?> <?php echo stripslashes($form->name); ?>"><?php echo stripslashes($form->name); ?></a>
|
69 |
<br/>
|
70 |
<div class="item_actions">
|
71 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=edit&id=<?php echo $form->id; ?>" title="<?php _e('Edit', FRM_PLUGIN_NAME) ?> <?php echo $form->name; ?>"><?php _e('Edit', FRM_PLUGIN_NAME) ?></a> |
|
72 |
<?php if($frmpro_is_installed){ ?>
|
73 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-entries&action=new&form=<?php echo $form->id; ?>" title="<?php _e('New', FRM_PLUGIN_NAME) ?> <?php echo $form->name; ?> <?php _e('Entry', FRM_PLUGIN_NAME) ?>"><?php _e('New Entry', FRM_PLUGIN_NAME) ?></a> |
|
74 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-entries&form=<?php echo $form->id; ?>" title="<?php echo $form->name; ?> Entries"><?php _e('Entries', FRM_PLUGIN_NAME) ?></a> |
|
75 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-reports&form=<?php echo $form->id; ?>" title="<?php echo $form->name; ?> Reports"><?php _e('Reports', FRM_PLUGIN_NAME) ?></a> |
|
76 |
<?php } ?>
|
77 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>" title="<?php _e('Copy', FRM_PLUGIN_NAME) ?> <?php echo $form->name; ?>"><?php _e('Duplicate', FRM_PLUGIN_NAME) ?></a> |
|
78 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=duplicate&id=<?php echo $form->id; ?>&template=1" title="<?php _e('Create', FRM_PLUGIN_NAME) ?> <?php echo $form->name; ?> <?php _e('Template', FRM_PLUGIN_NAME) ?>"><?php _e('Create Template', FRM_PLUGIN_NAME) ?></a> |
|
79 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=destroy&id=<?php echo $form->id; ?>" onclick="return confirm(<?php printf(__('Are you sure you want to delete your %1$s Form?'), $form->name) ?>);" title="<?php _e('Delete', FRM_PLUGIN_NAME) ?> <?php echo $form->form_key; ?>"><?php _e('Delete', FRM_PLUGIN_NAME) ?></a>
|
80 |
</div>
|
81 |
</td>
|
82 |
<td><?php echo stripslashes($form->description) ?></td>
|
83 |
<td><?php echo $form->form_key ?></td>
|
84 |
+
<td><?php echo apply_filters('frm_view_entries_link', $frm_entry->getRecordCount("it.form_id=$form->id") . ' '. __('Entries', FRM_PLUGIN_NAME), $form->id); ?></td>
|
85 |
<td>
|
86 |
+
<input type='text' style="font-size: 10px; width: 100%;" readonly="true" onclick='this.select();' onfocus='this.select();' value='<?php echo $target_url = FrmFormsHelper::get_direct_link($form->form_key, $form->prli_link_id); ?>' /><br/><a href="<?php echo $target_url; ?>" target="blank"><?php _e('View Form', FRM_PLUGIN_NAME) ?></a>
|
87 |
</td>
|
88 |
<td><input type='text' style="font-size: 10px; width: 100%;" readonly="true" onclick='this.select();' onfocus='this.select();' value='[formidable id=<?php echo $form->id; ?>]' /></td>
|
89 |
<?php } ?>
|
95 |
<tfoot>
|
96 |
<tr>
|
97 |
<?php if ($params['template']){ ?>
|
98 |
+
<th class="manage-column"><?php _e('Name', FRM_PLUGIN_NAME) ?></th>
|
99 |
+
<th class="manage-column"><?php _e('Description', FRM_PLUGIN_NAME) ?></th>
|
100 |
<?php }else{ ?>
|
101 |
+
<th class="manage-column"><?php do_action('frm_column_header'); ?> <?php _e('ID', FRM_PLUGIN_NAME) ?></th>
|
102 |
+
<th class="manage-column"><?php _e('Name', FRM_PLUGIN_NAME) ?></th>
|
103 |
+
<th class="manage-column"><?php _e('Description', FRM_PLUGIN_NAME) ?></th>
|
104 |
+
<th class="manage-column"><?php _e('Key', FRM_PLUGIN_NAME) ?></th>
|
105 |
+
<th class="manage-column"><?php _e('Entries', FRM_PLUGIN_NAME) ?></th>
|
106 |
+
<th class="manage-column"><?php _e('Direct Link', FRM_PLUGIN_NAME) ?></th>
|
107 |
+
<th class="manage-column"><?php _e('ShortCode', FRM_PLUGIN_NAME) ?></th>
|
108 |
<?php } ?>
|
109 |
</tr>
|
110 |
</tfoot>
|
classes/views/frm-forms/new-field-js.php
CHANGED
@@ -6,14 +6,8 @@ jQuery(document).ready(function($){
|
|
6 |
$('li.ui-state-default.selected').removeClass('selected'); $(this).addClass('selected');
|
7 |
});
|
8 |
|
9 |
-
jQuery('#frm_field_id_<?php echo $field['id']; ?>.ui-state-default').hover(
|
10 |
-
function(){jQuery(this).children(".frm-show-hover").show();},
|
11 |
-
function(){if(jQuery(this).is('.selected')){}else{ jQuery(this).children(".frm-show-hover").hide();}}
|
12 |
-
);
|
13 |
-
|
14 |
$('#frm_form_editor_container #frm_field_id_<?php echo $field['id']; ?> .ui-accordion-header').addClass('ui-corner-all').spinDown();
|
15 |
|
16 |
-
jQuery('#frm_field_id_<?php echo $field['id']; ?> .frm_single_show_hover').hide();
|
17 |
jQuery('#frm_field_id_<?php echo $field['id']; ?> .frm_single_option').hover(
|
18 |
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
19 |
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
@@ -21,7 +15,7 @@ jQuery(document).ready(function($){
|
|
21 |
|
22 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_option").editInPlace({
|
23 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
24 |
-
params:"action=frm_field_option_ipe", default_text:'(Blank)'
|
25 |
});
|
26 |
|
27 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_label").editInPlace({
|
@@ -32,7 +26,7 @@ jQuery(document).ready(function($){
|
|
32 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_desc").editInPlace({
|
33 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
34 |
params:"action=frm_field_desc_in_place_edit",
|
35 |
-
default_text:"(Click here to add optional description or instructions)",
|
36 |
field_type:'textarea', textarea_rows:1
|
37 |
});
|
38 |
});
|
6 |
$('li.ui-state-default.selected').removeClass('selected'); $(this).addClass('selected');
|
7 |
});
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
$('#frm_form_editor_container #frm_field_id_<?php echo $field['id']; ?> .ui-accordion-header').addClass('ui-corner-all').spinDown();
|
10 |
|
|
|
11 |
jQuery('#frm_field_id_<?php echo $field['id']; ?> .frm_single_option').hover(
|
12 |
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
13 |
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
15 |
|
16 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_option").editInPlace({
|
17 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
18 |
+
params:"action=frm_field_option_ipe", default_text:"<?php _e('(Blank)', 'formidable') ?>"
|
19 |
});
|
20 |
|
21 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_label").editInPlace({
|
26 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_desc").editInPlace({
|
27 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
28 |
params:"action=frm_field_desc_in_place_edit",
|
29 |
+
default_text:"<?php _e('(Click here to add optional description or instructions)', 'formidable') ?>",
|
30 |
field_type:'textarea', textarea_rows:1
|
31 |
});
|
32 |
});
|
classes/views/frm-forms/new-option-js.php
CHANGED
@@ -9,7 +9,7 @@ jQuery(document).ready(function(){
|
|
9 |
jQuery("#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .frm_ipe_field_option").editInPlace({
|
10 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
11 |
params:"action=frm_field_option_ipe",
|
12 |
-
default_text:'(Blank)'
|
13 |
});
|
14 |
});
|
15 |
</script>
|
9 |
jQuery("#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .frm_ipe_field_option").editInPlace({
|
10 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
11 |
params:"action=frm_field_option_ipe",
|
12 |
+
default_text:"<?php _e('(Blank)', 'formidable') ?>"
|
13 |
});
|
14 |
});
|
15 |
</script>
|
classes/views/frm-forms/new-selection.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
|
4 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Create Form
|
5 |
|
6 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
7 |
<br/>
|
8 |
<p>
|
9 |
<?php FrmFormsHelper::get_template_dropdown($all_templates); ?>
|
10 |
-
or
|
11 |
-
<a href="<?php echo add_query_arg('action','new') ?>"
|
12 |
</p>
|
13 |
|
14 |
</div>
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
|
4 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Create Form', FRM_PLUGIN_NAME) ?></h2>
|
5 |
|
6 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
7 |
<br/>
|
8 |
<p>
|
9 |
<?php FrmFormsHelper::get_template_dropdown($all_templates); ?>
|
10 |
+
<?php _e('or', FRM_PLUGIN_NAME) ?>
|
11 |
+
<a href="<?php echo add_query_arg('action','new') ?>"><?php _e('Create New Form', FRM_PLUGIN_NAME) ?></a>
|
12 |
</p>
|
13 |
|
14 |
</div>
|
classes/views/frm-forms/new.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
|
4 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Create Form
|
5 |
|
6 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
7 |
|
@@ -16,8 +16,8 @@
|
|
16 |
<?php require(FRM_VIEWS_PATH.'/frm-forms/form.php'); ?>
|
17 |
|
18 |
<p class="submit">
|
19 |
-
<input type="submit" name="Submit" value="Create" class="button-primary" /> or
|
20 |
-
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=destroy&id=<?php echo $id; ?>"
|
21 |
</p>
|
22 |
</form>
|
23 |
</div>
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
|
4 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Create Form', FRM_PLUGIN_NAME) ?></h2>
|
5 |
|
6 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
7 |
|
16 |
<?php require(FRM_VIEWS_PATH.'/frm-forms/form.php'); ?>
|
17 |
|
18 |
<p class="submit">
|
19 |
+
<input type="submit" name="Submit" value="<?php _e('Create', FRM_PLUGIN_NAME) ?>" class="button-primary" /> <?php _e('or', FRM_PLUGIN_NAME) ?>
|
20 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&action=destroy&id=<?php echo $id; ?>"><?php _e('Cancel', FRM_PLUGIN_NAME) ?></a>
|
21 |
</p>
|
22 |
</form>
|
23 |
</div>
|
classes/views/frm-settings/form.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="wrap">
|
2 |
<div id="icon-options-general" class="icon32"><br></div>
|
3 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Settings
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
@@ -23,7 +23,7 @@
|
|
23 |
<td>
|
24 |
<input type="checkbox" value="1" id="frm_custom_style" name="frm_custom_style" <?php checked($frm_settings->custom_style, 1) ?>>
|
25 |
<?php _e('Use Formidable styling settings for my forms', FRM_PLUGIN_NAME); ?>
|
26 |
-
<p class="description"
|
27 |
</td>
|
28 |
</tr>
|
29 |
|
1 |
<div class="wrap">
|
2 |
<div id="icon-options-general" class="icon32"><br></div>
|
3 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Settings', FRM_PLUGIN_NAME); ?></h2>
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
23 |
<td>
|
24 |
<input type="checkbox" value="1" id="frm_custom_style" name="frm_custom_style" <?php checked($frm_settings->custom_style, 1) ?>>
|
25 |
<?php _e('Use Formidable styling settings for my forms', FRM_PLUGIN_NAME); ?>
|
26 |
+
<p class="description"><?php _e('You can override this setting on individual forms.', FRM_PLUGIN_NAME); ?></p>
|
27 |
</td>
|
28 |
</tr>
|
29 |
|
classes/views/frm-statistics/list.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
-
<h2><?php echo FRM_PLUGIN_TITLE ?>: Pro Statistics
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
8 |
|
9 |
-
|
10 |
|
11 |
</div>
|
1 |
<div class="wrap">
|
2 |
<div class="frmicon"><br></div>
|
3 |
+
<h2><?php echo FRM_PLUGIN_TITLE ?>: <?php _e('Pro Statistics', FRM_PLUGIN_NAME) ?></h2>
|
4 |
|
5 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
8 |
|
9 |
+
<p><?php _e('Upgrade to Formidable Pro to get reports and statistics on your saved entries', FRM_PLUGIN_NAME) ?>
|
10 |
|
11 |
</div>
|
classes/views/shared/errors.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<div class="error">
|
5 |
<ul id="frm_errors">
|
6 |
<?php foreach( $errors as $error )
|
7 |
-
echo '<li>' . $error . '</li>';
|
8 |
?>
|
9 |
</ul>
|
10 |
</div>
|
4 |
<div class="error">
|
5 |
<ul id="frm_errors">
|
6 |
<?php foreach( $errors as $error )
|
7 |
+
echo '<li>' . stripslashes($error) . '</li>';
|
8 |
?>
|
9 |
</ul>
|
10 |
</div>
|
classes/views/shared/head.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
if (isset($css_file)){
|
3 |
if (is_array($css_file)){
|
4 |
-
foreach ($css_file as $
|
5 |
-
echo '<link rel="Stylesheet"
|
6 |
}else{?>
|
7 |
<link rel="stylesheet" href="<?php echo $css_file; ?>" type="text/css" />
|
8 |
<?php }
|
1 |
<?php
|
2 |
if (isset($css_file)){
|
3 |
if (is_array($css_file)){
|
4 |
+
foreach ($css_file as $file)
|
5 |
+
echo '<link rel="Stylesheet" href="'. $file .'" type="text/css" />';
|
6 |
}else{?>
|
7 |
<link rel="stylesheet" href="<?php echo $css_file; ?>" type="text/css" />
|
8 |
<?php }
|
classes/views/shared/item-table-nav.php
CHANGED
@@ -1,63 +1,11 @@
|
|
1 |
-
<div class="tablenav"
|
2 |
<?php
|
3 |
// Only show the pager bar if there is more than 1 page
|
4 |
if($page_count > 1){ ?>
|
5 |
<?php do_action('frm-item-list-actions', $footer); ?>
|
6 |
-
<div class='tablenav-pages'><span class="displaying-num"
|
7 |
|
8 |
-
|
9 |
-
if($current_page > 1){ ?>
|
10 |
-
<a class='prev page-numbers' href='?page=<?php print $controller_file . $page_params; ?>&paged=<?php print($current_page-1); ?>'>«</a>
|
11 |
-
<?php
|
12 |
-
}
|
13 |
-
|
14 |
-
// First page is always displayed
|
15 |
-
if($current_page==1){ ?>
|
16 |
-
<span class='page-numbers current'>1</span>
|
17 |
-
<?php }else{ ?>
|
18 |
-
<a class='page-numbers' href='?page=<?php print $controller_file . $page_params; ?>&paged=1'>1</a>
|
19 |
-
<?php
|
20 |
-
}
|
21 |
-
|
22 |
-
// If the current page is more than 2 spaces away from the first page then we put some dots in here
|
23 |
-
if($current_page >= 5){
|
24 |
-
?>
|
25 |
-
<span class='page-numbers dots'>...</span>
|
26 |
-
<?php
|
27 |
-
}
|
28 |
-
|
29 |
-
// display the current page icon and the 2 pages beneath and above it
|
30 |
-
$low_page = (($current_page >= 5)?($current_page-2):2);
|
31 |
-
$high_page = ((($current_page + 2) < ($page_count-1))?($current_page+2):($page_count-1));
|
32 |
-
for($i = $low_page; $i <= $high_page; $i++){
|
33 |
-
if($current_page==$i){ ?>
|
34 |
-
<span class='page-numbers current'><?php print $i; ?></span>
|
35 |
-
<?php }else{ ?>
|
36 |
-
<a class='page-numbers' href='?page=<?php print $controller_file . $page_params; ?>&paged=<?php print $i; ?>'><?php print $i; ?></a>
|
37 |
-
<?php
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
// If the current page is more than 2 away from the last page then show ellipsis
|
42 |
-
if($current_page < ($page_count - 3)){ ?>
|
43 |
-
<span class='page-numbers dots'>...</span>
|
44 |
-
<?php
|
45 |
-
}
|
46 |
-
|
47 |
-
// Display the last page icon
|
48 |
-
if($current_page == $page_count){ ?>
|
49 |
-
<span class='page-numbers current'><?php print $page_count; ?></span>
|
50 |
-
<?php }else{ ?>
|
51 |
-
<a class='page-numbers' href='?page=<?php print $controller_file . $page_params; ?>&paged=<?php print $page_count; ?>'><?php print $page_count; ?></a>
|
52 |
-
<?php
|
53 |
-
}
|
54 |
-
|
55 |
-
// Display the next page icon if there is a next page
|
56 |
-
if($current_page < $page_count){ ?>
|
57 |
-
<a class='next page-numbers' href='?page=<?php print $controller_file . $page_params; ?>&paged=<?php print($current_page + 1); ?>'>»</a>
|
58 |
-
<?php
|
59 |
-
}
|
60 |
-
?>
|
61 |
</div>
|
62 |
<?php }
|
63 |
|
1 |
+
<div class="tablenav">
|
2 |
<?php
|
3 |
// Only show the pager bar if there is more than 1 page
|
4 |
if($page_count > 1){ ?>
|
5 |
<?php do_action('frm-item-list-actions', $footer); ?>
|
6 |
+
<div class='tablenav-pages'><span class="displaying-num"><?php printf(__('Displaying %1$s–%2$s of %3$s', FRM_PLUGIN_NAME), $page_first_record, $page_last_record, $record_count); ?></span>
|
7 |
|
8 |
+
<?php $page_param = 'paged'; require('pagination.php'); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
</div>
|
10 |
<?php }
|
11 |
|
classes/views/shared/nav.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<div id="button_bar">
|
2 |
<ul class="subsubsub">
|
3 |
-
<li><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>"
|
4 |
-
<li><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-new"
|
5 |
-
<li><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-templates"
|
6 |
<?php do_action('frm_nav_items'); ?>
|
7 |
</ul>
|
8 |
</div>
|
1 |
<div id="button_bar">
|
2 |
<ul class="subsubsub">
|
3 |
+
<li><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>"><?php _e('Forms', FRM_PLUGIN_NAME) ?></a> | </li>
|
4 |
+
<li><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-new"><?php _e('Create a Form', FRM_PLUGIN_NAME) ?></a> | </li>
|
5 |
+
<li><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>-templates"><?php _e('Templates', FRM_PLUGIN_NAME) ?></a></li>
|
6 |
<?php do_action('frm_nav_items'); ?>
|
7 |
</ul>
|
8 |
</div>
|
classes/views/shared/pagination.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if($current_page > 1){ // Only show the prev page button if the current page is not the first page ?>
|
2 |
+
<a class='prev page-numbers' href="<?php echo add_query_arg(array($page_param => $current_page - 1)); ?>">«</a> <?php
|
3 |
+
}
|
4 |
+
|
5 |
+
// First page is always displayed
|
6 |
+
if($current_page==1){ ?>
|
7 |
+
<span class='page-numbers current'>1</span><?php
|
8 |
+
}else{ ?>
|
9 |
+
<a class='page-numbers' href="<?php echo add_query_arg(array($page_param => 1)); ?>">1</a> <?php
|
10 |
+
}
|
11 |
+
|
12 |
+
// If the current page is more than 2 spaces away from the first page then we put some dots in here
|
13 |
+
if($current_page >= 5){ ?>
|
14 |
+
<span class='page-numbers dots'>...</span> <?php
|
15 |
+
}
|
16 |
+
|
17 |
+
// display the current page icon and the 2 pages beneath and above it
|
18 |
+
$low_page = (($current_page >= 5)?($current_page-2):2);
|
19 |
+
$high_page = ((($current_page + 2) < ($page_count-1))?($current_page+2):($page_count-1));
|
20 |
+
for($i = $low_page; $i <= $high_page; $i++){
|
21 |
+
if($current_page==$i){ ?>
|
22 |
+
<span class='page-numbers current'><?php print $i; ?></span> <?php
|
23 |
+
}else{ ?>
|
24 |
+
<a class='page-numbers' href="<?php echo add_query_arg(array($page_param => $i)); ?>"><?php print $i; ?></a> <?php
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
// If the current page is more than 2 away from the last page then show ellipsis
|
29 |
+
if($current_page < ($page_count - 3)){ ?>
|
30 |
+
<span class='page-numbers dots'>...</span> <?php
|
31 |
+
}
|
32 |
+
|
33 |
+
// Display the last page icon
|
34 |
+
if($current_page == $page_count){ ?>
|
35 |
+
<span class='page-numbers current'><?php print $page_count; ?></span><?php
|
36 |
+
}else{ ?>
|
37 |
+
<a class='page-numbers' href="<?php echo add_query_arg(array($page_param => $page_count)); ?>"><?php print $page_count; ?></a><?php
|
38 |
+
}
|
39 |
+
|
40 |
+
// Display the next page icon if there is a next page
|
41 |
+
if($current_page < $page_count){ ?>
|
42 |
+
<a class='next page-numbers' href="<?php echo add_query_arg(array($page_param => $current_page + 1)); ?>">»</a><?php
|
43 |
+
} ?>
|
css/frm_admin.css
CHANGED
@@ -9,6 +9,7 @@ ul.pane li {padding: 0px; margin: 0px;}
|
|
9 |
|
10 |
.item_name {font-size: 12px; font-weight: bold;}
|
11 |
.item_actions {padding-top: 5px; display:none;}
|
|
|
12 |
|
13 |
.frmcenter{text-align:center;}
|
14 |
.frmicon {
|
@@ -42,16 +43,20 @@ ul.pane li {padding: 0px; margin: 0px;}
|
|
42 |
.form-field input{width:auto;}
|
43 |
textarea.inplace_field{width:100%;}
|
44 |
.inplace_field{width:80%;}
|
45 |
-
|
|
|
|
|
|
|
46 |
.frm_field_box{padding:5px;}
|
47 |
|
48 |
.frm_pos_top{display:block;}
|
49 |
-
.frm_pos_left{float:left;}
|
50 |
.frm_pos_none, .form-wrap label.frm_pos_none{display:none;}
|
51 |
.frm_spacer{float:left; width:16px; height:16px;}
|
52 |
.frm_charts object{background:transparent;}
|
53 |
|
54 |
.frm-show-hover, .frm_single_show_hover, .frm-show-click{display:none;}
|
|
|
55 |
#new_fields span.ui-icon{width:16px;}
|
56 |
|
57 |
.frm_inactive_icon, .frm_required0{
|
@@ -76,20 +81,27 @@ textarea.inplace_field{width:100%;}
|
|
76 |
#frm_form_editor_container .ui-accordion-header.ui-state-default{}
|
77 |
#frm_form_editor_container .ui-accordion-header.ui-state-active{display:block; border-bottom:none;}
|
78 |
#new_fields li.ui-state-default.selected .ui-accordion-header{display:block;}
|
79 |
-
|
80 |
#frm_form_options .ui-state-default,
|
81 |
#new_fields li.ui-state-default{
|
82 |
border:none;
|
83 |
font-weight:normal;
|
84 |
background-color:transparent; background-image:none;
|
85 |
-
margin
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
#frm_form_options .ui-state-default{color:#000;}
|
88 |
-
#new_fields li.ui-state-default
|
89 |
-
|
|
|
90 |
#new_fields li.ui-state-default.selected{background:#fdf5ce;}
|
91 |
|
92 |
|
|
|
93 |
/*hide elements if js is avail*/
|
94 |
.js .theme-group-content, .js #submitBtn, .js select.texture, .js #themeGallery, .js #help {
|
95 |
display: none;
|
@@ -108,6 +120,8 @@ textarea.inplace_field{width:100%;}
|
|
108 |
#frm_form_options #themeRoller{
|
109 |
background:transparent;
|
110 |
width:240px;
|
|
|
|
|
111 |
}
|
112 |
|
113 |
.form-table td #themeRoller{
|
9 |
|
10 |
.item_name {font-size: 12px; font-weight: bold;}
|
11 |
.item_actions {padding-top: 5px; display:none;}
|
12 |
+
.form_item_actions{display:none;}
|
13 |
|
14 |
.frmcenter{text-align:center;}
|
15 |
.frmicon {
|
43 |
.form-field input{width:auto;}
|
44 |
textarea.inplace_field{width:100%;}
|
45 |
.inplace_field{width:80%;}
|
46 |
+
.frm_rte{background:url(../images/rte.gif) no-repeat; border-bottom:1px solid #dfdfdf;}
|
47 |
+
.frm_rte .howto{margin:10px 0 45px 0;}
|
48 |
+
.frm_rte textarea{width:650px; border:none; background:#fff; margin:1px; }
|
49 |
+
.with_frm_style .frm_full_rte textarea{width:100%; padding:0;}
|
50 |
.frm_field_box{padding:5px;}
|
51 |
|
52 |
.frm_pos_top{display:block;}
|
53 |
+
.frm_pos_left{float:left; width:150px;}
|
54 |
.frm_pos_none, .form-wrap label.frm_pos_none{display:none;}
|
55 |
.frm_spacer{float:left; width:16px; height:16px;}
|
56 |
.frm_charts object{background:transparent;}
|
57 |
|
58 |
.frm-show-hover, .frm_single_show_hover, .frm-show-click{display:none;}
|
59 |
+
li.ui-state-default.selected .frm-show-click, li.ui-state-default.selected .frm-show-hover{display:inline;}
|
60 |
#new_fields span.ui-icon{width:16px;}
|
61 |
|
62 |
.frm_inactive_icon, .frm_required0{
|
81 |
#frm_form_editor_container .ui-accordion-header.ui-state-default{}
|
82 |
#frm_form_editor_container .ui-accordion-header.ui-state-active{display:block; border-bottom:none;}
|
83 |
#new_fields li.ui-state-default.selected .ui-accordion-header{display:block;}
|
84 |
+
#new_fields{min-height:200px;}
|
85 |
#frm_form_options .ui-state-default,
|
86 |
#new_fields li.ui-state-default{
|
87 |
border:none;
|
88 |
font-weight:normal;
|
89 |
background-color:transparent; background-image:none;
|
90 |
+
padding:6px; margin:20px 0;
|
91 |
+
}
|
92 |
+
#new_fields li.ui-state-default.edit_field_type_break{border-top:1px dashed; padding-top:5px;}
|
93 |
+
#new_fields .edit_field_type_divider .frm_ipe_field_label,
|
94 |
+
#new_fields .edit_field_type_break .frm_ipe_field_label{
|
95 |
+
font-size:116%;
|
96 |
}
|
97 |
#frm_form_options .ui-state-default{color:#000;}
|
98 |
+
#new_fields li.ui-state-default:hover, #new_fields li.ui-state-default.selected{
|
99 |
+
border:1px solid #fbcb09; padding:5px; background:#ffe;
|
100 |
+
}
|
101 |
#new_fields li.ui-state-default.selected{background:#fdf5ce;}
|
102 |
|
103 |
|
104 |
+
|
105 |
/*hide elements if js is avail*/
|
106 |
.js .theme-group-content, .js #submitBtn, .js select.texture, .js #themeGallery, .js #help {
|
107 |
display: none;
|
120 |
#frm_form_options #themeRoller{
|
121 |
background:transparent;
|
122 |
width:240px;
|
123 |
+
position:fixed;
|
124 |
+
z-index:5;
|
125 |
}
|
126 |
|
127 |
.form-table td #themeRoller{
|
css/frm_display.css
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
.with_frm_style .frm_pos_top{display:block;}
|
2 |
.with_frm_style .frm_pos_left{float:left; padding-right:10px; width:150px;}
|
|
|
3 |
.with_frm_style .frm_pos_none{display:none;}
|
4 |
.with_frm_style .frm_10radio{margin-right:10px; text-align:center; float:left;}
|
5 |
.with_frm_style .form-field{margin-top:15px;}
|
6 |
-
.with_frm_style .frm_blank_field input[type=
|
7 |
.with_frm_style .frm_blank_field select{border:1px solid red;}
|
8 |
.with_frm_style ul#frm_errors{list-style: square inside url(../images/error.png);}
|
9 |
.with_frm_style .frm_checkbox, .with_frm_style .frm_radio{display:block;}
|
1 |
.with_frm_style .frm_pos_top{display:block;}
|
2 |
.with_frm_style .frm_pos_left{float:left; padding-right:10px; width:150px;}
|
3 |
+
.with_frm_style .frm_pos_right{float:right; padding-left:10px; width:150px;}
|
4 |
.with_frm_style .frm_pos_none{display:none;}
|
5 |
.with_frm_style .frm_10radio{margin-right:10px; text-align:center; float:left;}
|
6 |
.with_frm_style .form-field{margin-top:15px;}
|
7 |
+
.with_frm_style .frm_blank_field input[type="text"], .with_frm_style .frm_blank_field textarea,
|
8 |
.with_frm_style .frm_blank_field select{border:1px solid red;}
|
9 |
.with_frm_style ul#frm_errors{list-style: square inside url(../images/error.png);}
|
10 |
.with_frm_style .frm_checkbox, .with_frm_style .frm_radio{display:block;}
|
formidable.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
-
Version: 1.01
|
6 |
Plugin URI: http://blog.strategy11.com/formidable-wordpress-plugin
|
7 |
Author URI: http://blog.strategy11.com
|
8 |
Author: Stephanie Wells
|
@@ -30,13 +30,9 @@ if (!defined ('IS_WPMU')){
|
|
30 |
|
31 |
global $frm_blogurl;
|
32 |
global $frm_siteurl;
|
33 |
-
global $frm_blogname;
|
34 |
-
global $frm_blogdescription;
|
35 |
|
36 |
$frm_blogurl = ((get_option('home'))?get_option('home'):get_option('siteurl'));
|
37 |
$frm_siteurl = get_option('siteurl');
|
38 |
-
$frm_blogname = get_option('blogname');
|
39 |
-
$frm_blogdescription = get_option('blogdescription');
|
40 |
|
41 |
/***** SETUP SETTINGS OBJECT *****/
|
42 |
global $frm_settings;
|
@@ -120,44 +116,4 @@ if($frmpro_is_installed)
|
|
120 |
global $frm_page_size;
|
121 |
$frm_page_size = 10;
|
122 |
|
123 |
-
global $frm_field_selection;
|
124 |
-
|
125 |
-
$frm_field_selection = array(
|
126 |
-
'text' => 'Text Input (One Line)',
|
127 |
-
'textarea' => 'Paragraph Input (Multiple Lines)',
|
128 |
-
'checkbox' => 'Multiple Selection (Check Boxes)',
|
129 |
-
'radio' => 'Select One (Radio)',
|
130 |
-
'select' => 'Drop-Down (Select)'
|
131 |
-
);
|
132 |
-
|
133 |
-
global $frm_recaptcha_enabled;
|
134 |
-
|
135 |
-
$frm_recaptcha_enabled = ( in_array('wp-recaptcha/wp-recaptcha.php', get_option('active_plugins')) )? true : false;
|
136 |
-
if ($frm_recaptcha_enabled)
|
137 |
-
$frm_field_selection['captcha'] = 'reCAPTCHA Field';
|
138 |
-
|
139 |
-
global $frm_pro_field_selection;
|
140 |
-
|
141 |
-
$frm_pro_field_selection = array(
|
142 |
-
'divider' => 'Section Divider/Heading',
|
143 |
-
'file' => 'File Upload',
|
144 |
-
//'rte' => 'Rich Text Editor',
|
145 |
-
'phone' => 'Phone',
|
146 |
-
'email' => 'Email',
|
147 |
-
'date' => 'Date',
|
148 |
-
//'time' => 'Time',
|
149 |
-
'hidden' => 'Hidden Field',
|
150 |
-
'user_id' => 'Hidden User Id',
|
151 |
-
'website' => 'Website/URL',
|
152 |
-
'image' => 'Image URL',
|
153 |
-
'10radio' => '1-10 radio',
|
154 |
-
'data' => 'Data from Entries',
|
155 |
-
//'multiple' => 'Multiple Select Box', //http://code.google.com/p/jquery-asmselect/
|
156 |
-
//'address' => 'Address' //Address line 1, Address line 2, City, State/Providence, Postal Code, Select Country
|
157 |
-
//'city_selector' => 'US State/County/City selector',
|
158 |
-
//'full_name' => 'First and Last Name',
|
159 |
-
//'terms' => 'Terms of Use',// checkbox or show terms (integrate with Terms of use plugin)
|
160 |
-
//'quiz' => 'Question and Answer' // for captcha alternative
|
161 |
-
);
|
162 |
-
|
163 |
?>
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
+
Version: 1.02.01
|
6 |
Plugin URI: http://blog.strategy11.com/formidable-wordpress-plugin
|
7 |
Author URI: http://blog.strategy11.com
|
8 |
Author: Stephanie Wells
|
30 |
|
31 |
global $frm_blogurl;
|
32 |
global $frm_siteurl;
|
|
|
|
|
33 |
|
34 |
$frm_blogurl = ((get_option('home'))?get_option('home'):get_option('siteurl'));
|
35 |
$frm_siteurl = get_option('siteurl');
|
|
|
|
|
36 |
|
37 |
/***** SETUP SETTINGS OBJECT *****/
|
38 |
global $frm_settings;
|
116 |
global $frm_page_size;
|
117 |
$frm_page_size = 10;
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
?>
|
images/rte.gif
ADDED
Binary file
|
js/formidable.js
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
window.onscroll = document.documentElement.onscroll = frmSetMenuOffset;
|
3 |
+
frmSetMenuOffset();
|
4 |
+
|
5 |
+
jQuery('.edit_form_item').hover(
|
6 |
+
function(){jQuery(this).children(".form_item_actions").show();},
|
7 |
+
function(){jQuery(this).children(".form_item_actions").hide();}
|
8 |
+
);
|
9 |
+
|
10 |
+
jQuery('.edit_item').hover(
|
11 |
+
function(){jQuery(this).children(".item_actions").show();},
|
12 |
+
function(){jQuery(this).children(".item_actions").hide();}
|
13 |
+
);
|
14 |
+
|
15 |
+
jQuery('.select-all-item-action-checkboxes').change(function(){
|
16 |
+
if (jQuery(this).attr("checked")){
|
17 |
+
jQuery(".item-action-checkbox").attr("checked","checked");
|
18 |
+
jQuery(".select-all-item-action-checkboxes").attr("checked","checked");
|
19 |
+
}else{
|
20 |
+
jQuery(".item-action-checkbox").removeAttr("checked");
|
21 |
+
jQuery(".select-all-item-action-checkboxes").removeAttr("checked");
|
22 |
+
}
|
23 |
+
});
|
24 |
+
|
25 |
+
jQuery('.item-action-checkbox').change(function(){
|
26 |
+
if(!jQuery(this).attr("checked")){jQuery(".select-all-item-action-checkboxes").removeAttr("checked");}
|
27 |
+
});
|
28 |
+
|
29 |
+
jQuery('.item-list-form').submit(function(){
|
30 |
+
if(jQuery('#bulkaction').val() == 'delete'){return confirm('Are you sure you want to delete each of the selected items below?');}
|
31 |
+
});
|
32 |
+
|
33 |
+
jQuery('.frm_single_option').hover(
|
34 |
+
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
35 |
+
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
36 |
+
);
|
37 |
+
|
38 |
+
jQuery('li.ui-state-default').click(function(evt){
|
39 |
+
var target = evt.target;
|
40 |
+
$('.frm-show-hover').hide(); $(this).children(".frm-show-hover").show();
|
41 |
+
$('.frm-show-click').hide(); $(this).children(".frm-show-click").show();
|
42 |
+
$('li.ui-state-default.selected').removeClass('selected'); $(this).addClass('selected');
|
43 |
+
if(!$(target).is('.inplace_field') && !$(target).is('.frm_ipe_field_label') && !$(target).is('.frm_ipe_field_desc') && !$(target).is('.frm_ipe_field_option')){ $('.inplace_field').blur();}
|
44 |
+
});
|
45 |
+
});
|
46 |
+
|
47 |
+
function frm_field_hover(show, field_id){
|
48 |
+
var html_id = '#frm_field_id_'+field_id;
|
49 |
+
if(show){jQuery(html_id).children(".frm-show-hover").show();}
|
50 |
+
else{if(!jQuery(html_id).is('.selected')){jQuery(html_id).children(".frm-show-hover").hide();}}
|
51 |
+
}
|
52 |
+
|
53 |
+
function frmSetMenuOffset() {
|
54 |
+
var fields = jQuery('#frm_form_options #themeRoller');
|
55 |
+
if (!fields) return;
|
56 |
+
var currentOffset = document.documentElement.scrollTop || document.body.scrollTop; // body for Safari
|
57 |
+
var desiredOffset = 340 - currentOffset;
|
58 |
+
if (desiredOffset < 10) desiredOffset = 10;
|
59 |
+
//if (desiredOffset != parseInt(header.style.top))
|
60 |
+
fields.attr('style', 'top:'+desiredOffset + 'px;');
|
61 |
+
}
|
js/jquery/jquery.editinplace.js
CHANGED
@@ -139,12 +139,12 @@ jQuery.fn.editInPlace = function(options) {
|
|
139 |
|
140 |
if (settings.field_type == "textarea")
|
141 |
{
|
142 |
-
var use_field_type = '<textarea name="inplace_value" class="inplace_field" rows="' + settings.textarea_rows + '" cols="' + settings.textarea_cols + '">' + jQuery(this).
|
143 |
}
|
144 |
else if(settings.field_type == "text")
|
145 |
{
|
146 |
var use_field_type = '<input type="text" name="inplace_value" class="inplace_field" value="' +
|
147 |
-
jQuery(this).
|
148 |
}
|
149 |
else if(settings.field_type == "select")
|
150 |
{
|
139 |
|
140 |
if (settings.field_type == "textarea")
|
141 |
{
|
142 |
+
var use_field_type = '<textarea name="inplace_value" class="inplace_field" rows="' + settings.textarea_rows + '" cols="' + settings.textarea_cols + '">' + jQuery(this).html().trim().escape_html() + '</textarea>';
|
143 |
}
|
144 |
else if(settings.field_type == "text")
|
145 |
{
|
146 |
var use_field_type = '<input type="text" name="inplace_value" class="inplace_field" value="' +
|
147 |
+
jQuery(this).html().trim().escape_html() + '" />';
|
148 |
}
|
149 |
else if(settings.field_type == "select")
|
150 |
{
|
js/jquery/jquery.editinplace.packed.js
CHANGED
@@ -2,10 +2,10 @@ jQuery.fn.editInPlace=function(options){var settings={url:"",params:"",field_typ
|
|
2 |
if(settings.saving_image!=""){var loading_image=new Image();loading_image.src=settings.saving_image;}
|
3 |
String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};String.prototype.escape_html=function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");};return this.each(function(){if(jQuery(this).html()=="")jQuery(this).html(settings.default_text);var editing=false;var original_element=jQuery(this);var click_count=0;jQuery(this).mouseover(function(){jQuery(this).css("background",settings.bg_over);}).mouseout(function(){jQuery(this).css("background",settings.bg_out);}).click(function(){click_count++;if(!editing)
|
4 |
{jQuery('.inplace_field').blur();editing=true;var original_html=jQuery(this).html();var buttons_code=(settings.show_buttons)?settings.save_button+' '+settings.cancel_button:'';if(original_html==settings.default_text)jQuery(this).html('');if(settings.field_type=="textarea")
|
5 |
-
{var use_field_type='<textarea name="inplace_value" class="inplace_field" rows="'+settings.textarea_rows+'" cols="'+settings.textarea_cols+'">'+jQuery(this).
|
6 |
else if(settings.field_type=="text")
|
7 |
{var use_field_type='<input type="text" name="inplace_value" class="inplace_field" value="'+
|
8 |
-
jQuery(this).
|
9 |
else if(settings.field_type=="select")
|
10 |
{var optionsArray=settings.select_options.split(',');var use_field_type='<select name="inplace_value" class="inplace_field"><option value="">'+settings.select_text+'</option>';for(var i=0;i<optionsArray.length;i++){var optionsValuesArray=optionsArray[i].split(':');var use_value=optionsValuesArray[1]||optionsValuesArray[0];var selected=use_value==original_html?'selected="selected" ':'';use_field_type+='<option '+selected+'value="'+use_value.trim().escape_html()+'">'+optionsValuesArray[0].trim().escape_html()+'</option>';}
|
11 |
use_field_type+='</select>';}
|
2 |
if(settings.saving_image!=""){var loading_image=new Image();loading_image.src=settings.saving_image;}
|
3 |
String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};String.prototype.escape_html=function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");};return this.each(function(){if(jQuery(this).html()=="")jQuery(this).html(settings.default_text);var editing=false;var original_element=jQuery(this);var click_count=0;jQuery(this).mouseover(function(){jQuery(this).css("background",settings.bg_over);}).mouseout(function(){jQuery(this).css("background",settings.bg_out);}).click(function(){click_count++;if(!editing)
|
4 |
{jQuery('.inplace_field').blur();editing=true;var original_html=jQuery(this).html();var buttons_code=(settings.show_buttons)?settings.save_button+' '+settings.cancel_button:'';if(original_html==settings.default_text)jQuery(this).html('');if(settings.field_type=="textarea")
|
5 |
+
{var use_field_type='<textarea name="inplace_value" class="inplace_field" rows="'+settings.textarea_rows+'" cols="'+settings.textarea_cols+'">'+jQuery(this).html().trim().escape_html()+'</textarea>';}
|
6 |
else if(settings.field_type=="text")
|
7 |
{var use_field_type='<input type="text" name="inplace_value" class="inplace_field" value="'+
|
8 |
+
jQuery(this).html().trim().escape_html()+'" />';}
|
9 |
else if(settings.field_type=="select")
|
10 |
{var optionsArray=settings.select_options.split(',');var use_field_type='<select name="inplace_value" class="inplace_field"><option value="">'+settings.select_text+'</option>';for(var i=0;i<optionsArray.length;i++){var optionsValuesArray=optionsArray[i].split(':');var use_value=optionsValuesArray[1]||optionsValuesArray[0];var selected=use_value==original_html?'selected="selected" ':'';use_field_type+='<option '+selected+'value="'+use_value.trim().escape_html()+'">'+optionsValuesArray[0].trim().escape_html()+'</option>';}
|
11 |
use_field_type+='</select>';}
|
js/list-items.js
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
-
jQuery('.form_item_actions').hide();
|
3 |
-
jQuery('.edit_form_item').hover(
|
4 |
-
function(){jQuery(this).children(".form_item_actions").show();},
|
5 |
-
function(){jQuery(this).children(".form_item_actions").hide();}
|
6 |
-
);
|
7 |
-
|
8 |
-
jQuery('.item_actions').hide();
|
9 |
-
jQuery('.edit_item').hover(
|
10 |
-
function(){jQuery(this).children(".item_actions").show();},
|
11 |
-
function(){jQuery(this).children(".item_actions").hide();}
|
12 |
-
);
|
13 |
-
|
14 |
-
jQuery('.select-all-item-action-checkboxes').change(function(){
|
15 |
-
if (jQuery(this).attr("checked")){
|
16 |
-
jQuery(".item-action-checkbox").attr("checked","checked");
|
17 |
-
jQuery(".select-all-item-action-checkboxes").attr("checked","checked");
|
18 |
-
}else{
|
19 |
-
jQuery(".item-action-checkbox").removeAttr("checked");
|
20 |
-
jQuery(".select-all-item-action-checkboxes").removeAttr("checked");
|
21 |
-
}
|
22 |
-
});
|
23 |
-
jQuery('.item-action-checkbox').change(function(){
|
24 |
-
if(!jQuery(this).attr("checked")){
|
25 |
-
jQuery(".select-all-item-action-checkboxes").removeAttr("checked");
|
26 |
-
}
|
27 |
-
});
|
28 |
-
|
29 |
-
jQuery('.item-list-form').submit(function(){
|
30 |
-
if(jQuery('#bulkaction').val() == 'delete'){
|
31 |
-
return confirm('Are you sure you want to delete each of the selected items below?');
|
32 |
-
}
|
33 |
-
});
|
34 |
-
|
35 |
-
jQuery('.frm_single_show_hover').hide();
|
36 |
-
jQuery('.frm_single_option').hover(
|
37 |
-
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
38 |
-
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
39 |
-
);
|
40 |
-
|
41 |
-
jQuery('li.ui-state-default').hover(
|
42 |
-
function(){jQuery(this).children(".frm-show-hover").show();},
|
43 |
-
function(){if(jQuery(this).is('.selected')){}else{ jQuery(this).children(".frm-show-hover").hide();}}
|
44 |
-
);
|
45 |
-
|
46 |
-
jQuery('li.ui-state-default').click(function(){
|
47 |
-
$('.frm-show-click').hide(); $(this).children(".frm-show-click").show();
|
48 |
-
$('.frm-show-hover').hide(); $(this).children(".frm-show-hover").show();
|
49 |
-
$('li.ui-state-default.selected').removeClass('selected'); $(this).addClass('selected');
|
50 |
-
});
|
51 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
=== Formidable ===
|
2 |
Contributors: sswells
|
3 |
Donate link: http://blog.strategy11.com/donate
|
4 |
-
Tags: WPMU, form, builder, drag, drop, widget, sidebar, Post, posts, page, wordpress, plugin, template, contact, contact form, captcha, email, database, save, admin, akismet, AJAX, links, javascript, jquery, theme, spam, content, image, images, poll, survey, feedback
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 2.9.2
|
7 |
-
Stable tag: 1.01
|
8 |
|
9 |
Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
|
10 |
|
@@ -23,14 +23,22 @@ http://formidablepro.com
|
|
23 |
* Shortcode [formidable id=x] for use in pages, posts, or text widgets for WordPress version 2.8 and above.
|
24 |
* Alternatively use `<?php echo FrmEntriesController::show_form(2, $key = '', $title=true, $description=true); ?>` in your template
|
25 |
* Customize most HTML when editing the form (code for editing HTML when creating the form is soon to follow... and documentation too)
|
26 |
-
* Create forms from existing templates or add your own
|
27 |
* Direct links available for previews and emailing surveys with and without integration with your current theme. Make these links pretty with [Pretty Link](http://blog.strategy11.com/prettylink "Pretty Link") integration
|
28 |
* Select an email address to send form responses under "Advanced Form Options"
|
29 |
-
* Input default
|
30 |
* Saves responses to the database for future retrieval, reports, and display in [Formidable Pro](http://formidablepro.com/ "Formidable Pro")
|
31 |
* PHP ninjas can display data in templates using functions in FrmApiController. However, there is currently no documentation for these functions.
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
== Installation ==
|
36 |
1. Upload `formidable` folder to the `/wp-content/plugins/` directory
|
@@ -48,6 +56,32 @@ Feedback and requests are welcome.
|
|
48 |
[Formidable FAQs](http://blog.strategy11.com/formidable-faqs/ "Formidable FAQs")
|
49 |
|
50 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
= 1.01.04 =
|
52 |
* Updated in-place edit to work with more characters and function without the save buttons
|
53 |
* Fixed bug causing several form options to be lost when the form name or description was edited without also clicking update for the whole form
|
1 |
+
=== Formidable Forms ===
|
2 |
Contributors: sswells
|
3 |
Donate link: http://blog.strategy11.com/donate
|
4 |
+
Tags: WPMU, form, builder, drag, drop, widget, sidebar, Post, posts, page, wordpress, plugin, template, contact, contact form, forms, captcha, email, database, save, admin, akismet, AJAX, links, javascript, jquery, theme, spam, content, image, images, poll, survey, feedback, anti-spam
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 2.9.2
|
7 |
+
Stable tag: 1.02.01
|
8 |
|
9 |
Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
|
10 |
|
23 |
* Shortcode [formidable id=x] for use in pages, posts, or text widgets for WordPress version 2.8 and above.
|
24 |
* Alternatively use `<?php echo FrmEntriesController::show_form(2, $key = '', $title=true, $description=true); ?>` in your template
|
25 |
* Customize most HTML when editing the form (code for editing HTML when creating the form is soon to follow... and documentation too)
|
26 |
+
* Create forms from existing templates or add your own. A contact form template is included.
|
27 |
* Direct links available for previews and emailing surveys with and without integration with your current theme. Make these links pretty with [Pretty Link](http://blog.strategy11.com/prettylink "Pretty Link") integration
|
28 |
* Select an email address to send form responses under "Advanced Form Options"
|
29 |
+
* Input default values into form fields with the option to clear when clicked
|
30 |
* Saves responses to the database for future retrieval, reports, and display in [Formidable Pro](http://formidablepro.com/ "Formidable Pro")
|
31 |
* PHP ninjas can display data in templates using functions in FrmApiController. However, there is currently no documentation for these functions.
|
32 |
|
33 |
+
= PRO Features =
|
34 |
+
* Visual form styling editor. Want to [check it out](http://formidablepro.com/customer-service?test=1 "check it out")?
|
35 |
+
* Additional fields which include page breaks for multiple paged forms, file uploads, section headers, rich text editor, date with calendar, email, phone, website, and a dynamic field populated with data from other entries.
|
36 |
+
* View graphical reports for the form results (replace Google docs surveys)
|
37 |
+
* Add, edit, search, and CSV export entries from the WordPress admin
|
38 |
+
* Make your default values dynamic
|
39 |
+
* Conditionally hide and show fields
|
40 |
+
* Display your gathered data in a page, post, or widget
|
41 |
+
|
42 |
|
43 |
== Installation ==
|
44 |
1. Upload `formidable` folder to the `/wp-content/plugins/` directory
|
56 |
[Formidable FAQs](http://blog.strategy11.com/formidable-faqs/ "Formidable FAQs")
|
57 |
|
58 |
== Changelog ==
|
59 |
+
= 1.02.01 =
|
60 |
+
* Emailer now works for everyone! (hopefully)
|
61 |
+
* Optionally Reset HTML. Just clear out the box for the HTML for that field and hit update.
|
62 |
+
* PRO: Fixed collapsable section to use correct default HTML.
|
63 |
+
* PRO: Only call rich text javascript on entries pages
|
64 |
+
* PRO: A few small reports modifications. Report for the User ID field will show the percentage of your users who have submitted the form if you are allowing edits with only one submission per user.
|
65 |
+
|
66 |
+
= 1.02.0 =
|
67 |
+
* Updated in-place edit to save more easily and not wipe HTML when editing
|
68 |
+
* Updated email notifications to hopefully work for more users, send from the first email address submitted in the form, and send one email per email address in the form options
|
69 |
+
* Changed form to show after being submitted instead of only showing the success message.
|
70 |
+
* Fixed bug causing newly added fields to be ordered incorrectly when dragged into the form
|
71 |
+
* Made the field list sticky temporarily until the UI gets further updates
|
72 |
+
* Fixed quotation marks and apostrophes in form input fields so data won't be lost after them
|
73 |
+
* Radio buttons and check boxes are now truly required
|
74 |
+
* PRO: Added a Page Break field for multiple paged forms
|
75 |
+
* PRO: Added a Rich Text Editor field
|
76 |
+
* PRO: Added a widget to list entries linking to entry detail page to be used along-side a single custom display
|
77 |
+
* PRO: Added an option to order entries by ascending or descending in the entry display settings
|
78 |
+
* PRO: Added front-end pagination for displaying entries
|
79 |
+
* PRO: Fixed bug with multiple forms on single page causing 2nd form to be hidden when 1st form submitted with errors
|
80 |
+
* PRO: Updated custom displays for faster front-end loading and more efficiency
|
81 |
+
* PRO: Added `size` option parameter to file upload shortcodes and `show` parameter to data from entries field for use in custom displays
|
82 |
+
* PRO: Added customizable HTML for section divider and page break
|
83 |
+
* PRO: Added page to view entries in a read-only format in the admin
|
84 |
+
|
85 |
= 1.01.04 =
|
86 |
* Updated in-place edit to work with more characters and function without the save buttons
|
87 |
* Fixed bug causing several form options to be lost when the form name or description was edited without also clicking update for the whole form
|