PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.35
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.35
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / models / fields / FrmFieldSubmit.php

FrmFieldSubmit.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.35, at classes/models/fields/FrmFieldSubmit.php

122 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Submit field class
4 *
5 * @since 6.9
6 *
7 * @package Formidable
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 die( 'You are not allowed to call this page directly.' );
12 }
13
14 /**
15 * @since 6.9
16 */
17 class FrmFieldSubmit extends FrmFieldType {
18
19 /**
20 * Field type.
21 *
22 * @var string
23 */
24 protected $type = FrmSubmitHelper::FIELD_TYPE;
25
26 /**
27 * Has for label or not?
28 *
29 * @var bool
30 */
31 protected $has_for_label = false;
32
33 /**
34 * Has input or not?
35 *
36 * @var bool
37 */
38 protected $has_input = false;
39
40 /**
41 * Default HTML.
42 *
43 * @return string
44 */
45 public function default_html() {
46 return <<<DEFAULT_HTML
47 <div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
48 [input]
49 </div>
50 DEFAULT_HTML;
51 }
52
53 /**
54 * Sets settings for this field type.
55 *
56 * @return array
57 */
58 protected function field_settings_for_type() {
59 return array(
60 'required' => false,
61 'visibility' => false,
62 'label_position' => false,
63 'options' => false,
64 'default' => false,
65 'description' => false,
66 'logic' => true,
67 );
68 }
69
70 /**
71 * Includes form builder file.
72 *
73 * @return string
74 */
75 protected function include_form_builder_file() {
76 return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-submit.php';
77 }
78
79 /**
80 * Shows label on form builder.
81 */
82 public function show_label_on_form_builder() {
83 // Do nothing.
84 }
85
86 /**
87 * Gets frontend field input.
88 *
89 * @param array $args Args.
90 * @param array $shortcode_atts Shortcode atts.
91 *
92 * @return string
93 */
94 public function front_field_input( $args, $shortcode_atts ) {
95 $form = $args['form'];
96
97 if ( ! FrmForm::show_submit( $form ) ) {
98 return '';
99 }
100
101 $submit = $this->field['name'];
102 $form_action = FrmSubmitHelper::get_current_action_from_global_var( $form->id );
103 $values = FrmAppHelper::setup_edit_vars( $form, 'forms' );
104
105 ob_start();
106
107 /**
108 * @since 5.5.1
109 */
110 do_action( 'frm_before_submit_btn', compact( 'form' ) );
111
112 FrmFormsHelper::get_custom_submit( $values['submit_html'], $form, $submit, $form_action, $values );
113
114 /**
115 * @since 5.5.1
116 */
117 do_action( 'frm_after_submit_btn', compact( 'form' ) );
118
119 return ob_get_clean();
120 }
121 }
122