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

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

103 lines 1.9 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 FrmFieldCheckbox extends FrmFieldType {
10
11 /**
12 * @var string
13 * @since 3.0
14 */
15 protected $type = 'checkbox';
16
17 /**
18 * @var bool
19 * @since 3.0
20 */
21 protected $holds_email_values = true;
22
23 /**
24 * Does the html for this field label need to include "for"?
25 *
26 * @var bool
27 * @since 3.06.01
28 */
29 protected $has_for_label = false;
30
31 protected function input_html() {
32 return $this->multiple_input_html();
33 }
34
35 protected function include_form_builder_file() {
36 return $this->include_front_form_file();
37 }
38
39 /**
40 * @return string[]
41 */
42 protected function new_field_settings() {
43 return array(
44 'options' => serialize(
45 array(
46 __( 'Option 1', 'formidable' ),
47 __( 'Option 2', 'formidable' ),
48 )
49 ),
50 );
51 }
52
53 /**
54 * Get the type of field being displayed.
55 *
56 * @since 4.02.01
57 * @return array
58 */
59 public function displayed_field_type( $field ) {
60 return array(
61 $this->type => true,
62 );
63 }
64
65 /**
66 * @return array
67 */
68 protected function extra_field_opts() {
69 $form_id = $this->get_field_column( 'form_id' );
70
71 return array(
72 'align' => FrmStylesController::get_style_val( 'check_align', ( empty( $form_id ) ? 'default' : $form_id ) ),
73 );
74 }
75
76 /**
77 * @since 4.06
78 *
79 * @return void
80 */
81 protected function show_priority_field_choices( $args = array() ) {
82 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/radio-images.php';
83 }
84
85 /**
86 * @return string
87 */
88 protected function include_front_form_file() {
89 return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/checkbox-field.php';
90 }
91
92 /**
93 * @return bool
94 */
95 protected function show_readonly_hidden() {
96 return true;
97 }
98
99 protected function prepare_import_value( $value, $atts ) {
100 return $this->get_multi_opts_for_import( $value );
101 }
102 }
103