| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * @since 3.0 |
| 8 | 5 | */ |
| @@ -9,9 +6,8 @@ | ||
| 9 | 6 | class FrmFieldCheckbox extends FrmFieldType { |
| 10 | 7 | |
| 11 | 8 | /** |
| 12 | 9 | * @var string |
| 13 | - * | |
| 14 | 10 | * @since 3.0 |
| 15 | 11 | */ |
| 16 | 12 | protected $type = 'checkbox'; |
| 17 | 13 | |
| @@ -16,9 +12,8 @@ | ||
| 16 | 12 | protected $type = 'checkbox'; |
| 17 | 13 | |
| 18 | 14 | /** |
| 19 | 15 | * @var bool |
| 20 | - * | |
| 21 | 16 | * @since 3.0 |
| 22 | 17 | */ |
| 23 | 18 | protected $holds_email_values = true; |
| 24 | 19 | |
| @@ -25,36 +20,26 @@ | ||
| 25 | 20 | /** |
| 26 | 21 | * Does the html for this field label need to include "for"? |
| 27 | 22 | * |
| 28 | 23 | * @var bool |
| 29 | - * | |
| 30 | 24 | * @since 3.06.01 |
| 31 | 25 | */ |
| 32 | 26 | protected $has_for_label = false; |
| 33 | 27 | |
| 34 | - /** | |
| 35 | - * @return string | |
| 36 | - */ | |
| 37 | 28 | protected function input_html() { |
| 38 | 29 | return $this->multiple_input_html(); |
| 39 | 30 | } |
| 40 | 31 | |
| 41 | 32 | protected function include_form_builder_file() { |
| 42 | - return $this->include_front_form_file(); | |
| 33 | + return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-multiple.php'; | |
| 43 | 34 | } |
| 44 | 35 | |
| 45 | - /** | |
| 46 | - * @return bool[] | |
| 47 | - */ | |
| 48 | 36 | protected function field_settings_for_type() { |
| 49 | 37 | return array( |
| 50 | - 'invalid' => true, | |
| 38 | + 'default_blank' => false, | |
| 51 | 39 | ); |
| 52 | 40 | } |
| 53 | 41 | |
| 54 | - /** | |
| 55 | - * @return string[] | |
| 56 | - */ | |
| 57 | 42 | protected function new_field_settings() { |
| 58 | 43 | return array( |
| 59 | 44 | 'options' => serialize( |
| 60 | 45 | array( |
| @@ -64,53 +49,19 @@ | ||
| 64 | 49 | ), |
| 65 | 50 | ); |
| 66 | 51 | } |
| 67 | 52 | |
| 68 | - /** | |
| 69 | - * Get the type of field being displayed. | |
| 70 | - * | |
| 71 | - * @since 4.02.01 | |
| 72 | - * | |
| 73 | - * @param array|object $field | |
| 74 | - * | |
| 75 | - * @return array | |
| 76 | - */ | |
| 77 | - public function displayed_field_type( $field ) { | |
| 78 | - return array( | |
| 79 | - $this->type => true, | |
| 80 | - ); | |
| 81 | - } | |
| 82 | - | |
| 83 | - /** | |
| 84 | - * @return array | |
| 85 | - */ | |
| 86 | 53 | protected function extra_field_opts() { |
| 54 | + $form_id = $this->get_field_column( 'form_id' ); | |
| 87 | 55 | return array( |
| 88 | - 'align' => '', | |
| 56 | + 'align' => FrmStylesController::get_style_val( 'check_align', ( empty( $form_id ) ? 'default' : $form_id ) ), | |
| 89 | 57 | ); |
| 90 | 58 | } |
| 91 | 59 | |
| 92 | - /** | |
| 93 | - * @since 4.06 | |
| 94 | - * | |
| 95 | - * @param array $args | |
| 96 | - * | |
| 97 | - * @return void | |
| 98 | - */ | |
| 99 | - protected function show_priority_field_choices( $args = array() ) { | |
| 100 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/radio-images.php'; | |
| 101 | - } | |
| 102 | - | |
| 103 | - /** | |
| 104 | - * @return string | |
| 105 | - */ | |
| 106 | 60 | protected function include_front_form_file() { |
| 107 | 61 | return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/checkbox-field.php'; |
| 108 | 62 | } |
| 109 | 63 | |
| 110 | - /** | |
| 111 | - * @return bool | |
| 112 | - */ | |
| 113 | 64 | protected function show_readonly_hidden() { |
| 114 | 65 | return true; |
| 115 | 66 | } |
| 116 | 67 | |
| @@ -115,19 +66,6 @@ | ||
| 115 | 66 | } |
| 116 | 67 | |
| 117 | 68 | protected function prepare_import_value( $value, $atts ) { |
| 118 | 69 | return $this->get_multi_opts_for_import( $value ); |
| 119 | - } | |
| 120 | - | |
| 121 | - /** | |
| 122 | - * Unset aria-invalid for checkboxes because it's not valid for checkboxes. | |
| 123 | - * Instead aria-invalid is added to the checkbox group parent element. | |
| 124 | - * | |
| 125 | - * @since 6.25 | |
| 126 | - * | |
| 127 | - * @param array $shortcode_atts | |
| 128 | - * @param array $args | |
| 129 | - */ | |
| 130 | - public function set_aria_invalid_error( &$shortcode_atts, $args ) { | |
| 131 | - unset( $shortcode_atts['aria-invalid'] ); | |
| 132 | 70 | } |
| 133 | 71 | } |