forked from wp-premium/gravityforms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
form_detail.php
2431 lines (2137 loc) · 174 KB
/
form_detail.php
1
2
3
4
5
6
7
8
9
10
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
if(!class_exists('GFForms')){
die();
}
class GFFormDetail{
public static function forms_page($form_id){
global $wpdb;
if(!GFCommon::ensure_wp_version())
return;
$update_result = "";
if(rgpost("operation") == "trash"){
check_admin_referer('gforms_trash_form', 'gforms_trash_form');
GFFormsModel::trash_form($form_id);
?>
<script type="text/javascript">
jQuery(document).ready(
function(){document.location.href="?page=gf_edit_forms";}
);
</script>
<?php
exit;
}
else if(!rgempty("gform_meta")){
check_admin_referer("gforms_update_form_{$form_id}", 'gforms_update_form');
$update_result = self::save_form_info($form_id, rgpost("gform_meta", false));
}
require_once(GFCommon::get_base_path() . '/currency.php');
wp_print_styles(array('thickbox'));
?>
<link rel="stylesheet" href="<?php echo GFCommon::get_base_url() ?>/css/admin.css?ver=<?php echo GFCommon::$version ?>" type="text/css" />
<script type="text/javascript">
<?php GFCommon::gf_global(); ?>
<?php GFCommon::gf_vars(); ?>
</script>
<script type="text/javascript">
function has_entry(fieldNumber){
var submitted_fields = [<?php echo RGFormsModel::get_submitted_fields($form_id); ?>];
for(var i=0; i<submitted_fields.length; i++){
if(submitted_fields[i] == fieldNumber)
return true;
}
return false;
}
function InsertPostImageVariable(element_id, callback){
var variable = jQuery('#' + element_id + '_image_size_select').attr("variable");
var size = jQuery('#' + element_id + '_image_size_select').val();
if(size){
variable = "{" + variable + ":" + size + "}";
InsertVariable(element_id, callback, variable);
jQuery('#' + element_id + '_image_size_select').hide();
jQuery('#' + element_id + '_image_size_select')[0].selectedIndex = 0;
}
}
function InsertPostContentVariable(element_id, callback){
var variable = jQuery('#' + element_id + '_variable_select').val();
var regex=/{([^{]*?: *(\d+\.?\d*).*?)}/;
matches = regex.exec(variable);
if(!matches){
InsertVariable(element_id, callback);
return;
}
variable = matches[1];
field_id = matches[2];
for(var i=0; i<form["fields"].length; i++){
if(form["fields"][i]["id"] == field_id){
if(form["fields"][i]["type"] == "post_image"){
jQuery('#' + element_id + '_image_size_select').attr("variable", variable);
jQuery('#' + element_id + '_image_size_select').show();
return;
}
}
}
InsertVariable(element_id, callback);
}
function IsValidFormula(formula){
if(formula == '')
return true;
var patt = /{([^}]+)}/i,
exprPatt = /^[0-9 -/*\(\)]+$/i,
expr = formula.replace(/(\r\n|\n|\r)/gm,""),
match;
while(match = patt.exec(expr)) {
expr = expr.replace(match[0], 1);
}
if(exprPatt.test(expr)) {
try {
var r = eval(expr);
return !isNaN(parseFloat(r)) && isFinite(r);
} catch (e) {
return false;
}
} else {
return false;
}
}
</script>
<?php
$form = !rgempty("meta",$update_result) ? rgar($update_result, "meta") : GFFormsModel::get_form_meta($form_id);
$form = RGFormsModel::add_default_properties($form);
if(!isset($form['fields']) || !is_array($form['fields']))
$form["fields"] = array();
$form = apply_filters("gform_admin_pre_render_" . $form_id, apply_filters("gform_admin_pre_render", $form));
if(isset($form['id']))
echo "<script type=\"text/javascript\">var form = " . GFCommon::json_encode($form) . ";</script>";
else
echo "<script type=\"text/javascript\">var form = new Form();</script>";
?>
<?php echo GFCommon::get_remote_message(); ?>
<div class="wrap gforms_edit_form <?php echo GFCommon::get_browser_class() ?>">
<?php if( empty($form_id) ): ?>
<h2 class="gf_admin_page_title"><?php _e("New Form", "gravityforms") ?></h2>
<?php else: ?>
<h2 class="gf_admin_page_title"><span><?php _e("Form Editor", "gravityforms") ?></span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php echo $form['id']; ?></span><span class="gf_admin_page_formname"><?php _e("Form Name", "gravityforms") ?>: <?php echo $form['title']; ?></span></span></h2>
<?php endif; ?>
<?php RGForms::top_toolbar() ?>
<?php
switch(rgar($update_result, "status")){
case "invalid_json" :
?>
<div class="error_base gform_editor_status" id="after_update_error_dialog">
<?php _e("There was an error while saving your form.", "gravityforms") ?>
<?php printf(__("Please %scontact our support team%s.", "gravityforms"), '<a href="http://www.gravityhelp.com">', '</a>') ?>
</div>
<?php
break;
case "duplicate_title" :
?>
<div class="error_base gform_editor_status" id="after_update_error_dialog">
<?php _e("The form title you have entered is already taken. Please enter a unique form title.", "gravityforms") ?>
</div>
<?php
break;
default :
if(!empty($update_result)){
?>
<div class="updated_base gform_editor_status" id="after_update_dialog">
<strong><?php _e("Form updated successfully.", "gravityforms"); ?></strong>
</div>
<?php
}
break;
}
?>
<?php // link to the google webfont library ?>
<style type="text/css">
@import url('//fonts.googleapis.com/css?family=Shadows+Into+Light+Two');
</style>
<form method="post" id="form_trash">
<?php wp_nonce_field( 'gforms_trash_form', 'gforms_trash_form' ); ?>
<input type="hidden" value="trash" name="operation" />
</form>
<table width="100%">
<tr>
<td class="pad_top" valign="top">
<?php
$has_pages = GFCommon::has_pages($form);
?>
<div id="gform_pagination" class="selectable gform_settings_container" style="display:<?php echo $has_pages ? "block" : "none" ?>;">
<div class="settings_control_container">
<a href="javascript:void(0);" class="form_edit_icon edit_icon_collapsed" title="<?php _e("click to edit page options", "gravityforms"); ?>"><i class='fa fa-caret-down fa-lg'></i></a>
</div>
<div class="gf-pagebreak-first gf-pagebreak-container">
<div class="gf-pagebreak-text-before"><?php _e("begin form", "gravityforms") ?></div>
<div class="gf-pagebreak-text-main"><span><?php _e("START PAGING", "gravityforms") ?></span></div>
<div class="gf-pagebreak-text-after"><?php _e("top of the first page", "gravityforms") ?></div>
</div>
<div id="pagination_settings" style="display: none;">
<ul>
<li style="width:100px; padding:0px;"><a href="#gform_pagination_settings_tab_1"><?php _e("Properties", "gravityforms"); ?></a></li>
<li style="width:100px; padding:0px;"><a href="#gform_pagination_settings_tab_2"><?php _e("Advanced", "gravityforms"); ?></a></li>
</ul>
<div id="gform_pagination_settings_tab_1">
<ul class="gforms_form_settings">
<li>
<label for="pagination_type_container">
<?php _e("Progress Indicator", "gravityforms"); ?>
<?php gform_tooltip("form_progress_indicator") ?>
</label>
<div id="pagination_type_container" class="pagination_container" >
<input type="radio" id="pagination_type_percentage" name="pagination_type" value="percentage" onclick='InitPaginationOptions();'/>
<label for="pagination_type_percentage" class="inline">
<?php _e("Progress Bar", "gravityforms"); ?>
</label>
<input type="radio" id="pagination_type_steps" name="pagination_type" value="steps" onclick='InitPaginationOptions();'/>
<label for="pagination_type_steps" class="inline">
<?php _e("Steps", "gravityforms"); ?>
</label>
<input type="radio" id="pagination_type_none" name="pagination_type" value="none" onclick='InitPaginationOptions();'/>
<label for="pagination_type_none" class="inline">
<?php _e("None", "gravityforms"); ?>
</label>
</div>
</li>
<li id="percentage_style_setting">
<div class="percentage_style_setting" style="float:left; z-index: 99;">
<label for="percentage_style" style="display:block;">
<?php _e("Style", "gravityforms"); ?>
<?php gform_tooltip("form_percentage_style") ?>
</label>
<select id="percentage_style" onchange="TogglePercentageStyle();">
<option value="blue"> <?php _e("Blue", "gravityforms"); ?> </option>
<option value="gray"> <?php _e("Gray", "gravityforms"); ?> </option>
<option value="green"> <?php _e("Green", "gravityforms"); ?> </option>
<option value="orange"> <?php _e("Orange", "gravityforms"); ?> </option>
<option value="red"> <?php _e("Red", "gravityforms"); ?> </option>
<option value="custom"> <?php _e("Custom", "gravityforms"); ?> </option>
</select>
</div>
<div class="percentage_custom_container" style="float:left; padding-left:20px;">
<label for="percentage_background_color" style="display:block;">
<?php _e("Text Color", "gravityforms"); ?>
</label>
<?php self::color_picker("percentage_style_custom_color", "") ?>
</div>
<div class="percentage_custom_container" style="float:left; padding-left:20px;">
<label for="percentage_background_bgcolor" style="display:block;">
<?php _e("Background Color", "gravityforms"); ?>
</label>
<?php self::color_picker("percentage_style_custom_bgcolor", "") ?>
</div>
</li>
<li id="page_names_setting">
<label for="page_names_container">
<?php _e("Page Names", "gravityforms"); ?>
<?php gform_tooltip("form_page_names") ?>
</label>
<div id="page_names_container" style="margin-top:5px;">
<!-- Populated dynamically from js.php -->
</div>
</li>
<li id="percentage_confirmation_display_setting">
<div class="percentage_confirmation_display_setting">
<input type="checkbox" id="percentage_confirmation_display" onclick="TogglePercentageConfirmationText()">
<label for="percentage_confirmation_display" class="inline">
<?php _e("Display completed progress bar on confirmation","gravityforms"); ?>
<?php gform_tooltip("form_percentage_confirmation_display"); ?>
</label>
</div>
</li>
<li id="percentage_confirmation_page_name_setting">
<div class="percentage_confirmation_page_name_setting">
<label for="percentage_confirmation_page_name" style="display:block;">
<?php _e("Completion Text","gravityforms"); ?> <?php gform_tooltip("percentage_confirmation_page_name"); ?>
</label>
<input type="text" id="percentage_confirmation_page_name" class="fieldwidth-3"/>
</div>
</li>
</ul>
</div>
<div id="gform_pagination_settings_tab_2">
<ul class="gforms_form_settings">
<li>
<label for="first_page_css_class" style="display:block;">
<?php _e("CSS Class Name", "gravityforms"); ?>
<?php gform_tooltip("form_field_css_class") ?>
</label>
<input type="text" id="first_page_css_class" size="30"/>
</li>
</ul>
</div>
</div>
</div>
<?php
$description_class = rgar($form,"descriptionPlacement") == "above" ? "description_above" : "description_below";
?>
<ul id="gform_fields" class="<?php echo rgar($form,"labelPlacement"). " " . $description_class ?>" style="position: relative;">
<?php if(empty($form['fields'])) { ?>
<?php // link to the google webfont library ?>
<style type="text/css">
@import url('//fonts.googleapis.com/css?family=Shadows+Into+Light+Two');
</style>
<li id="no-fields">
<div class="newform_notice"><?php _e("This form doesn't have any fields yet. Follow the steps below to get started.", 'gravityforms'); ?><span></span></div>
<?php // first step ?>
<h4 class="gf_nofield_header gf_nofield_1">1. <?php _e('Select A Field Type', 'gravityforms'); ?></h4>
<p><?php _e('Start by seleting a field type from the nifty floating panels on the right.', 'gravityforms'); ?></p>
<div id="gf_nofield_1_instructions">
<span class="gf_nofield_1_instructions_heading gf_tips"><?php _e('Start Over There', 'gravityforms'); ?></span>
<span class="gf_nofield_1_instructions_copy gf_tips"><?php _e('Pick a field.. any field. Don\'t be shy.', 'gravityforms'); ?></span>
</div>
<?php // second step ?>
<h4 class="gf_nofield_header gf_nofield_2">2. <?php _e('Click to Add A Field', 'gravityforms'); ?></h4>
<p><?php _e("Once you've found the field type you want, click to add it to the form editor here on the left side of your screen.", 'gravityforms'); ?></p>
<div id="gf_nofield_2_instructions">
<span class="gf_nofield_2_instructions_copy gf_tips"><?php _e('Now your new field magically appears over here.', 'gravityforms'); ?></span>
</div>
<?php // third step ?>
<h4 class="gf_nofield_header gf_nofield_3">3. <?php _e('Edit Field Options', 'gravityforms'); ?></h4>
<p><?php _e('Click on the edit link to configure the various field options', 'gravityforms'); ?></p>
<div id="gf_nofield_3_instructions">
<span class="gf_nofield_3_instructions_copy_top gf_tips"><?php _e('Preview your changes up here.', 'gravityforms'); ?></span>
<span class="gf_nofield_3_instructions_copy_mid gf_tips"><?php _e('Edit the field options. Go ahead.. go crazy.', 'gravityforms'); ?></span>
<span class="gf_nofield_3_instructions_copy_bottom gf_tips"><?php _e('If you get stuck, mouseover the tool tips for a little help.', 'gravityforms'); ?></span>
</div>
<?php // fourth step ?>
<h4 class="gf_nofield_header gf_nofield_4">4. <?php _e('Drag to Arrange Fields', 'gravityforms'); ?></h4>
<p><?php _e('Drag the fields to arrange them the way you prefer', 'gravityforms'); ?></p>
<div id="gf_nofield_4_instructions">
<span class="gf_nofield_4_instructions_copy_top gf_tips"><?php _e('Grab here with your cursor.', 'gravityforms'); ?></span>
<span class="gf_nofield_4_instructions_copy_bottom gf_tips"><?php _e('Drag up or down to arrange your fields.', 'gravityforms'); ?></span>
</div>
<?php // fifth step ?>
<h4 class="gf_nofield_header gf_nofield_5">5. <?php _e('Save Your Form', 'gravityforms'); ?></h4>
<p><?php _e('Once you're happy with your form, remember to click on the "update form" button to save all your hard work.', 'gravityforms'); ?></p>
<div id="gf_nofield_5_instructions">
<span class="gf_nofield_5_instructions_heading gf_tips"><?php _e('Save Your New Form', 'gravityforms'); ?></span>
<span class="gf_nofield_5_instructions_copy gf_tips"><?php _e('You\'re done. That\'s it.', 'gravityforms'); ?></span>
</div>
</li>
<?php } ?>
<?php
if(is_array(rgar($form,"fields")))
{
require_once(GFCommon::get_base_path() . "/form_display.php");
foreach($form["fields"] as $field){
echo GFFormDisplay::get_field($field, "", true);
}
}
?>
</ul>
<div id="gform_last_page_settings" class="selectable gform_settings_container" style="display:<?php echo $has_pages ? "block" : "none" ?>;">
<div class="settings_control_container">
<a href="javascript:void(0);" class="form_edit_icon edit_icon_collapsed" title="<?php _e("Edit Last Page", "gravityforms"); ?>"><i class='fa fa-caret-down fa-lg'></i></a>
</div>
<div class="gf-pagebreak-end gf-pagebreak-container">
<div class="gf-pagebreak-text-before"><?php _e("end of last page", "gravityforms") ?></div>
<div class="gf-pagebreak-text-main"><span><?php _e("END PAGING", "gravityforms") ?></span></div>
<div class="gf-pagebreak-text-after"><?php _e("end of form", "gravityforms") ?></div>
</div>
<div id="last_page_settings" style="display:none;">
<ul>
<li style="width:100px; padding:0px;"><a href="#gform_last_page_settings_tab_1"><?php _e("Properties", "gravityforms"); ?></a></li>
</ul>
<div id="gform_last_page_settings_tab_1">
<ul class="gforms_form_settings">
<li>
<label for="last_page_button_container">
<?php _e("Previous Button", "gravityforms"); ?>
<?php gform_tooltip("form_field_last_page_button") ?>
</label>
<div class="last_page_button_options" id="last_page_button_container">
<input type="radio" id="last_page_button_text" name="last_page_button" value="text" onclick="TogglePageButton('last_page');"/>
<label for="last_page_button_text" class="inline">
<?php _e("Default", "gravityforms"); ?>
<?php gform_tooltip("previous_button_text") ?>
</label>
<input type="radio" id="last_page_button_image" name="last_page_button" value="image" onclick="TogglePageButton('last_page');"/>
<label for="last_page_button_image" class="inline">
<?php _e("Image", "gravityforms"); ?>
<?php gform_tooltip("previous_button_image") ?>
</label>
<div id="last_page_button_text_container" style="margin-top:5px;">
<label for="last_page_button_text_input" class="inline">
<?php _e("Text:", "gravityforms"); ?>
</label>
<input type="text" id="last_page_button_text_input" class="input_size_b" size="40" />
</div>
<div id="last_page_button_image_container" style="margin-top:5px;">
<label for="last_page_button_image_url" class="inline">
<?php _e("Image Path:", "gravityforms"); ?>
</label>
<input type="text" id="last_page_button_image_url" size="45"/>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<div>
<div id="after_insert_dialog" style="display:none;">
<h3><?php _e("You have successfully saved your form!", "gravityforms"); ?></h3>
<p><?php _e("What would you like to do next?", "gravityforms"); ?></p>
<div class="new-form-option"><a title="<?php _e("Preview this form", "gravityforms"); ?>" id="preview_form_link" href="<?php echo trailingslashit(site_url()) ?>?gf_page=preview&id={formid}" target="_blank"><?php _e("Preview this Form", "gravityforms"); ?></a></div>
<?php if(GFCommon::current_user_can_any("gravityforms_edit_forms")){ ?>
<div class="new-form-option"><a title="<?php _e("Setup email notifications for this form", "gravityforms"); ?>" id="notification_form_link" href="#"><?php _e("Setup Email Notifications for this Form", "gravityforms"); ?></a></div>
<?php } ?>
<div class="new-form-option"><a title="<?php _e("Continue editing this form", "gravityforms"); ?>" id="edit_form_link" href="#"><?php _e("Continue Editing this Form", "gravityforms"); ?></a></div>
<div class="new-form-option"><a title="<?php _e("I am done. Take me back to form list", "gravityforms"); ?>" href="?page=gf_edit_forms"><?php _e("Return to Form List", "gravityforms"); ?></a></div>
</div>
</div>
<div id="field_settings" style="display: none;">
<ul>
<li style="width:100px; padding:0px;"><a href="#gform_tab_1"><?php _e("Properties", "gravityforms"); ?></a></li>
<li style="width:100px; padding:0px; "><a href="#gform_tab_2"><?php _e("Advanced", "gravityforms"); ?></a></li>
</ul>
<div id="gform_tab_1">
<ul>
<?php
do_action("gform_field_standard_settings", 0, $form_id);
?>
<li class="label_setting field_setting">
<label for="field_label">
<?php _e("Field Label", "gravityforms"); ?>
<?php gform_tooltip("form_field_label") ?>
<?php gform_tooltip("form_field_label_html") ?>
</label>
<input type="text" id="field_label" class="fieldwidth-3" onkeyup="SetFieldLabel(this.value)" size="35"/>
</li>
<li class="product_field_setting field_setting">
<label for="product_field">
<?php _e("Product Field", "gravityforms"); ?>
<?php gform_tooltip("form_field_product") ?>
</label>
<select id="product_field" onchange="SetFieldProperty('productField', jQuery(this).val());">
<!-- will be populated when field is selected (js.php) -->
</select>
</li>
<?php
do_action("gform_field_standard_settings", 25, $form_id);
?>
<li class="product_field_type_setting field_setting">
<label for="product_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="product_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeProductType(jQuery('#product_field_type').val());});">
<option value="singleproduct"><?php _e("Single Product", "gravityforms"); ?></option>
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
<option value="price"><?php _e("User Defined Price", "gravityforms"); ?></option>
<option value="hiddenproduct"><?php _e("Hidden", "gravityforms"); ?></option>
<option value="calculation"><?php _e("Calculation", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 37, $form_id);
?>
<li class="shipping_field_type_setting field_setting">
<label for="shipping_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="shipping_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeShippingType(jQuery('#shipping_field_type').val());});">
<option value="singleshipping"><?php _e("Single Method", "gravityforms"); ?></option>
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 50, $form_id);
?>
<li class="base_price_setting field_setting">
<label for="field_base_price">
<?php _e("Price", "gravityforms"); ?>
<?php gform_tooltip("form_field_base_price") ?>
</label>
<input type="text" id="field_base_price" onchange="SetBasePrice(this.value)"/>
</li>
<?php
do_action("gform_field_standard_settings", 75, $form_id);
?>
<li class="disable_quantity_setting field_setting">
<input type="checkbox" name="field_disable_quantity" id="field_disable_quantity" onclick="SetDisableQuantity(jQuery(this).is(':checked'));"/>
<label for="field_disable_quantity" class="inline">
<?php _e("Disable quantity field", "gravityforms"); ?>
<?php gform_tooltip("form_field_disable_quantity") ?>
</label>
</li>
<?php
do_action("gform_field_standard_settings", 100, $form_id);
?>
<li class="option_field_type_setting field_setting">
<label for="option_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="option_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#option_field_type').val());});">
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="checkbox"><?php _e("Checkboxes", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 125, $form_id);
?>
<li class="donation_field_type_setting field_setting">
<label for="donation_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="donation_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeDonationType(jQuery('#donation_field_type').val());});">
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="donation"><?php _e("User Defined Price", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 150, $form_id);
?>
<li class="quantity_field_type_setting field_setting">
<label for="quantity_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="quantity_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#quantity_field_type').val());});">
<option value="number"><?php _e("Number", "gravityforms"); ?></option>
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="hidden"><?php _e("Hidden", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 200, $form_id);
?>
<li class="content_setting field_setting">
<label for="field_content">
<?php _e("Content", "gravityforms"); ?>
<?php gform_tooltip("form_field_content") ?>
</label>
<textarea id="field_content" class="fieldwidth-3 fieldheight-1 merge-tag-support mt-position-right mt-prepopulate" onkeyup="SetFieldProperty('content', this.value);" onchange="SetFieldProperty('content', this.value);"></textarea>
</li>
<?php
do_action("gform_field_standard_settings", 225, $form_id);
?>
<li class="next_button_setting field_setting">
<label for="next_button_container">
<?php _e("Next Button", "gravityforms"); ?>
</label>
<div class="next_button_options" id="next_button_container">
<input type="radio" id="next_button_text" name="next_button" value="text" onclick="TogglePageButton('next'); SetPageButton('next');"/>
<label for="next_button_text" class="inline">
<?php _e("Default", "gravityforms"); ?>
<?php gform_tooltip("next_button_text") ?>
</label>
<input type="radio" id="next_button_image" name="next_button" value="image" onclick="TogglePageButton('next'); SetPageButton('next');"/>
<label for="next_button_image" class="inline">
<?php _e("Image", "gravityforms"); ?>
<?php gform_tooltip("next_button_image") ?>
</label>
<div id="next_button_text_container" style="margin-top:5px;">
<label for="next_button_text_input" class="inline">
<?php _e("Text:", "gravityforms"); ?>
</label>
<input type="text" id="next_button_text_input" class="input_size_b" size="40" onkeyup="SetPageButton('next');"/>
</div>
<div id="next_button_image_container" style="margin-top:5px;">
<label for="next_button_image_url" class="inline">
<?php _e("Image Path:", "gravityforms"); ?>
</label>
<input type="text" id="next_button_image_url" size="45" onkeyup="SetPageButton('next');"/>
</div>
</div>
</li>
<?php
do_action("gform_field_standard_settings", 237, $form_id);
?>
<li class="previous_button_setting field_setting">
<label for="previous_button_container">
<?php _e("Previous Button", "gravityforms"); ?>
<?php gform_tooltip("form_field_previous_button") ?>
</label>
<div class="previous_button_options" id="previous_button_container">
<input type="radio" id="previous_button_text" name="previous_button" value="text" onclick="TogglePageButton('previous'); SetPageButton('previous');"/>
<label for="previous_button_text" class="inline">
<?php _e("Default", "gravityforms"); ?>
<?php gform_tooltip("previous_button_text") ?>
</label>
<input type="radio" id="previous_button_image" name="previous_button" value="image" onclick="TogglePageButton('previous'); SetPageButton('previous');"/>
<label for="previous_button_image" class="inline">
<?php _e("Image", "gravityforms"); ?>
<?php gform_tooltip("previous_button_image") ?>
</label>
<div id="previous_button_text_container" style="margin-top:5px;">
<label for="previous_button_text_input" class="inline">
<?php _e("Text:", "gravityforms"); ?>
</label>
<input type="text" id="previous_button_text_input" class="input_size_b" size="40" onkeyup="SetPageButton('previous');" />
</div>
<div id="previous_button_image_container" style="margin-top:5px;">
<label for="previous_button_image_url" class="inline">
<?php _e("Image Path:", "gravityforms"); ?>
</label>
<input type="text" id="previous_button_image_url" size="45" onkeyup="SetPageButton('previous');"/>
</div>
</div>
</li>
<?php
do_action("gform_field_standard_settings", 250, $form_id);
?>
<li class="disable_margins_setting field_setting">
<input type="checkbox" id="field_margins" onclick="SetFieldProperty('disableMargins', this.checked);"/>
<label for="field_disable_margins" class="inline">
<?php _e("Disable default margins", "gravityforms"); ?>
<?php gform_tooltip("form_field_disable_margins") ?>
</label><br/>
</li>
<?php
do_action("gform_field_standard_settings", 300, $form_id);
?>
<li class="post_custom_field_type_setting field_setting">
<label for="post_custom_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="post_custom_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#post_custom_field_type').val());});">
<option value="" class="option_header"><?php _e("Standard Fields", "gravityforms"); ?></option>
<option value="text"><?php _e("Single line text", "gravityforms"); ?></option>
<option value="textarea"><?php _e("Paragraph Text", "gravityforms"); ?></option>
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="multiselect"><?php _e("Multi Select", "gravityforms"); ?></option>
<option value="number"><?php _e("Number", "gravityforms"); ?></option>
<option value="checkbox"><?php _e("Checkboxes", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
<option value="hidden"><?php _e("Hidden", "gravityforms"); ?></option>
<option value="" class="option_header"><?php _e("Advanced Fields", "gravityforms"); ?></option>
<option value="date"><?php _e("Date", "gravityforms"); ?></option>
<option value="time"><?php _e("Time", "gravityforms"); ?></option>
<option value="phone"><?php _e("Phone", "gravityforms"); ?></option>
<option value="website"><?php _e("Website", "gravityforms"); ?></option>
<option value="email"><?php _e("Email", "gravityforms"); ?></option>
<option value="fileupload"><?php _e("File Upload", "gravityforms"); ?></option>
<option value="list"><?php _e("List", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 350, $form_id);
?>
<li class="post_tag_type_setting field_setting">
<label for="post_tag_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="post_tag_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#post_tag_type').val());});">
<option value="text"><?php _e("Single line text", "gravityforms"); ?></option>
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="multiselect"><?php _e("Multi Select", "gravityforms"); ?></option>
<option value="checkbox"><?php _e("Checkboxes", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 400, $form_id);
?>
<?php
if(class_exists("ReallySimpleCaptcha")){
?>
<li class="captcha_type_setting field_setting">
<label for="field_captcha_type">
<?php _e("Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_captcha_type") ?>
</label>
<select id="field_captcha_type" onchange="StartChangeCaptchaType(jQuery(this).val())">
<option value="captcha"><?php _e("reCAPTCHA", "gravityforms"); ?></option>
<option value="simple_captcha"><?php _e("Really Simple CAPTCHA", "gravityforms"); ?></option>
<option value="math"><?php _e("Math Challenge", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 450, $form_id);
?>
<li class="captcha_size_setting field_setting">
<label for="field_captcha_size">
<?php _e("Size", "gravityforms"); ?>
</label>
<select id="field_captcha_size" onchange="SetCaptchaSize(jQuery(this).val());">
<option value="small"><?php _e("Small", "gravityforms"); ?></option>
<option value="medium"><?php _e("Medium", "gravityforms"); ?></option>
<option value="large"><?php _e("Large", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 500, $form_id);
?>
<li class="captcha_fg_setting field_setting">
<label for="field_captcha_fg">
<?php _e("Font Color", "gravityforms"); ?>
</label>
<?php self::color_picker("field_captcha_fg", "SetCaptchaFontColor") ?>
</li>
<?php
do_action("gform_field_standard_settings", 550, $form_id);
?>
<li class="captcha_bg_setting field_setting">
<label for="field_captcha_bg">
<?php _e("Background Color", "gravityforms"); ?>
</label>
<?php self::color_picker("field_captcha_bg", "SetCaptchaBackgroundColor") ?>
</li>
<?php
}
do_action("gform_field_standard_settings", 600, $form_id);
?>
<li class="captcha_theme_setting field_setting">
<label for="field_captcha_theme">
<?php _e("Theme", "gravityforms"); ?>
<?php gform_tooltip("form_field_recaptcha_theme") ?>
</label>
<select id="field_captcha_theme" onchange="SetCaptchaTheme(this.value, '<?php echo GFCommon::get_base_url() ?>/images/captcha_' + this.value + '.jpg')">
<option value="red"><?php _e("Red", "gravityforms"); ?></option>
<option value="white"><?php _e("White", "gravityforms"); ?></option>
<option value="blackglass"><?php _e("Black Glass", "gravityforms"); ?></option>
<option value="clean"><?php _e("Clean", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 650, $form_id);
?>
<li class="post_custom_field_setting field_setting">
<label for="field_custom_field_name">
<?php _e("Custom Field Name", "gravityforms"); ?>
<?php gform_tooltip("form_field_custom_field_name") ?>
</label>
<div style="width:100px; float:left;">
<input type="radio" name="field_custom" id="field_custom_existing" size="10" onclick="ToggleCustomField();" />
<label for="field_custom_existing" class="inline">
<?php _e("Existing", "gravityforms"); ?>
</label>
</div>
<div style="width:100px; float:left;">
<input type="radio" name="field_custom" id="field_custom_new" size="10" onclick="ToggleCustomField();" />
<label for="field_custom_new" class="inline">
<?php _e("New", "gravityforms"); ?>
</label>
</div>
<div class="clear">
<input type="text" id="field_custom_field_name_text" size="35" onkeyup="SetFieldProperty('postCustomFieldName', this.value);"/>
<select id="field_custom_field_name_select" onchange="SetFieldProperty('postCustomFieldName', jQuery(this).val());">
<option value=""><?php _e("Select an existing custom field", "gravityforms"); ?></option>
<?php
$custom_field_names = RGFormsModel::get_custom_field_names();
foreach($custom_field_names as $name){
?>
<option value="<?php echo $name?>"><?php echo $name?></option>
<?php
}
?>
</select>
</div>
</li>
<?php
do_action("gform_field_standard_settings", 700, $form_id);
?>
<li class="post_status_setting field_setting">
<label for="field_post_status">
<?php _e("Post Status", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_status") ?>
</label>
<select id="field_post_status" name="field_post_status">
<?php $post_stati = apply_filters('gform_post_status_options', array(
'draft' => 'Draft',
'pending' => 'Pending Review',
'publish' => 'Published'
));
foreach($post_stati as $value => $label) { ?>
<option value="<?php echo $value; ?>"><?php echo $label; ?></option>
<?php } ?>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 750, $form_id);
?>
<li class="post_author_setting field_setting">
<label for="field_post_author">
<?php _e("Default Post Author", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_author") ?>
</label>
<?php
$args = array('name' => 'field_post_author');
$args = apply_filters("gform_author_dropdown_args_" . rgar($form, "id"), apply_filters("gform_author_dropdown_args", $args));
wp_dropdown_users($args);
?>
<div>
<input type="checkbox" id="gfield_current_user_as_author"/>
<label for="gfield_current_user_as_author" class="inline"><?php _e("Use logged in user as author", "gravityforms"); ?> <?php gform_tooltip("form_field_current_user_as_author") ?></label>
</div>
</li>
<?php
do_action("gform_field_standard_settings", 775, $form_id);
?>
<?php if(current_theme_supports('post-formats')) { ?>
<li class="post_format_setting field_setting">
<label for="field_post_format">
<?php _e("Post Format", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_format") ?>
</label>
<?php
$post_formats = get_theme_support('post-formats');
$post_formats_dropdown = '<option value="0">Standard</option>';
foreach($post_formats[0] as $post_format){
$post_formats_dropdown .= "<option value='$post_format'>" . ucfirst($post_format) . "</option>";
}
echo '<select name="field_post_format" id="field_post_format">' . $post_formats_dropdown . '</select>';
?>
</li>
<?php } // if theme supports post formats ?>
<?php
do_action("gform_field_standard_settings", 800, $form_id);
?>
<li class="post_category_setting field_setting">
<label for="field_post_category">
<?php _e("Post Category", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_category") ?>
</label>
<?php wp_dropdown_categories(array('selected' => get_option('default_category'), 'hide_empty' => 0, 'id' => 'field_post_category', 'name' => 'field_post_category', 'orderby' => 'name', 'selected' => 'field_post_category', 'hierarchical' => true )); ?>
</li>
<?php
do_action("gform_field_standard_settings", 825, $form_id);
?>
<li class="post_category_field_type_setting field_setting">
<label for="post_category_field_type">
<?php _e("Field Type", "gravityforms"); ?>
<?php gform_tooltip("form_field_type") ?>
</label>
<select id="post_category_field_type" onchange="jQuery('#field_settings').slideUp(function(){StartChangeInputType( jQuery('#post_category_field_type').val() );});">
<option value="select"><?php _e("Drop Down", "gravityforms"); ?></option>
<option value="checkbox"><?php _e("Checkboxes", "gravityforms"); ?></option>
<option value="radio"><?php _e("Radio Buttons", "gravityforms"); ?></option>
<option value="multiselect"><?php _e("Multi Select", "gravityforms"); ?></option>
</select>
</li>
<?php
do_action("gform_field_standard_settings", 850, $form_id);
?>
<li class="post_category_checkbox_setting field_setting">
<label for="field_post_category">
<?php _e("Category", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_category_selection") ?>
</label>
<input type="radio" id="gfield_category_all" name="gfield_category" value="all" onclick="ToggleCategory();"/>
<label for="gfield_category_all" class="inline">
<?php _e("All Categories", "gravityforms"); ?>
</label>
<input type="radio" id="gfield_category_select" name="gfield_category" value="select" onclick="ToggleCategory();"/>
<label for="form_button_image" class="inline">
<?php _e("Select Categories", "gravityforms"); ?>
</label>
<div id="gfield_settings_category_container">
<table cellpadding="0" cellspacing="5">
<?php
$categories = get_categories( array('hide_empty' => 0) );
$count = 0;
$category_rows = '';
self::_cat_rows($categories, $count, $category_rows);
echo $category_rows;
?>
</table>
</div>
</li>
<?php
do_action("gform_field_standard_settings", 875, $form_id);
?>
<li class="post_category_initial_item_setting field_setting">
<input type="checkbox" id="gfield_post_category_initial_item_enabled" onclick="TogglePostCategoryInitialItem(); SetCategoryInitialItem();"/>
<label for="gfield_post_category_initial_item_enabled" class="inline">
<?php _e("Display placeholder", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_category_initial_item") ?>
</label>
</li>
<li id="gfield_post_category_initial_item_container">
<label for="field_post_category_initial_item">
<?php _e("Placeholder Label", "gravityforms"); ?>
</label>
<input type="text" id="field_post_category_initial_item" onchange="SetCategoryInitialItem();" class="fieldwidth-3" size="35"/>
</li>
<?php
do_action("gform_field_standard_settings", 900, $form_id);
?>
<li class="post_content_template_setting field_setting">
<input type="checkbox" id="gfield_post_content_enabled" onclick="TogglePostContentTemplate();"/>
<label for="gfield_post_content_enabled" class="inline">
<?php _e("Create content template", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_content_template_enable") ?>
</label>
<div id="gfield_post_content_container">
<div>
<?php GFCommon::insert_post_content_variables($form["fields"], "field_post_content_template", '', 25); ?>
</div>
<textarea id="field_post_content_template" class="fieldwidth-3 fieldheight-1"></textarea>
</div>
</li>
<?php
do_action("gform_field_standard_settings", 950, $form_id);
?>
<li class="post_title_template_setting field_setting">
<input type="checkbox" id="gfield_post_title_enabled" onclick="TogglePostTitleTemplate();" />
<label for="gfield_post_title_enabled" class="inline">
<?php _e("Create content template", "gravityforms"); ?>
<?php gform_tooltip("form_field_post_title_template_enable") ?>
</label>
<div id="gfield_post_title_container">
<input type="text" id="field_post_title_template" class="fieldwidth-3 merge-tag-support mt-position-right mt-hide_all_fields mt-exclude-post_image-fileupload" />
</div>