PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.25
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.25
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 / FrmFieldSelect.php

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

97 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 /**
7 * @since 3.0
8 */
9 class FrmFieldSelect extends FrmFieldType {
10
11 /**
12 * @var string
13 * @since 3.0
14 */
15 protected $type = 'select';
16
17 /**
18 * @var bool
19 * @since 3.0
20 */
21 protected $holds_email_values = true;
22
23 protected function include_form_builder_file() {
24 return $this->include_front_form_file();
25 }
26
27 /**
28 * @return bool[]
29 */
30 protected function field_settings_for_type() {
31 return array(
32 'clear_on_focus' => true,
33 'size' => true,
34 'invalid' => true,
35 );
36 }
37
38 /**
39 * @return string[]
40 */
41 protected function new_field_settings() {
42 return array(
43 'options' => serialize(
44 array(
45 '',
46 __( 'Option 1', 'formidable' ),
47 )
48 ),
49 );
50 }
51
52 /**
53 * Get the type of field being displayed.
54 *
55 * @since 4.02.01
56 * @return array
57 */
58 public function displayed_field_type( $field ) {
59 return array(
60 $this->type => true,
61 );
62 }
63
64 /**
65 * @since 4.0
66 *
67 * @param array $args Includes 'field', 'display', and 'values'.
68 *
69 * @return void
70 */
71 public function show_extra_field_choices( $args ) {
72 $this->auto_width_setting( $args );
73 }
74
75 /**
76 * @return string
77 */
78 protected function include_front_form_file() {
79 return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php';
80 }
81
82 /**
83 * @return bool
84 */
85 protected function show_readonly_hidden() {
86 return true;
87 }
88
89 protected function prepare_import_value( $value, $atts ) {
90 if ( FrmField::is_option_true( $this->field, 'multiple' ) ) {
91 $value = $this->get_multi_opts_for_import( $value );
92 }
93
94 return $value;
95 }
96 }
97