| @@ -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 FrmFieldSelect extends FrmFieldType { |
| 10 | 7 | |
| 11 | 8 | /** |
| 12 | 9 | * @var string |
| 13 | - * | |
| 14 | 10 | * @since 3.0 |
| 15 | 11 | */ |
| 16 | 12 | protected $type = 'select'; |
| 17 | 13 | |
| @@ -16,31 +12,22 @@ | ||
| 16 | 12 | protected $type = 'select'; |
| 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 | 20 | protected function include_form_builder_file() { |
| 26 | - return $this->include_front_form_file(); | |
| 21 | + return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/dropdown-field.php'; | |
| 27 | 22 | } |
| 28 | 23 | |
| 29 | - /** | |
| 30 | - * @return bool[] | |
| 31 | - */ | |
| 32 | 24 | protected function field_settings_for_type() { |
| 33 | 25 | return array( |
| 34 | - 'clear_on_focus' => true, | |
| 35 | - 'size' => true, | |
| 36 | - 'invalid' => true, | |
| 26 | + 'size' => true, | |
| 37 | 27 | ); |
| 38 | 28 | } |
| 39 | 29 | |
| 40 | - /** | |
| 41 | - * @return string[] | |
| 42 | - */ | |
| 43 | 30 | protected function new_field_settings() { |
| 44 | 31 | return array( |
| 45 | 32 | 'options' => serialize( |
| 46 | 33 | array( |
| @@ -50,44 +37,12 @@ | ||
| 50 | 37 | ), |
| 51 | 38 | ); |
| 52 | 39 | } |
| 53 | 40 | |
| 54 | - /** | |
| 55 | - * Get the type of field being displayed. | |
| 56 | - * | |
| 57 | - * @since 4.02.01 | |
| 58 | - * | |
| 59 | - * @param array|object $field | |
| 60 | - * | |
| 61 | - * @return array | |
| 62 | - */ | |
| 63 | - public function displayed_field_type( $field ) { | |
| 64 | - return array( | |
| 65 | - $this->type => true, | |
| 66 | - ); | |
| 67 | - } | |
| 68 | - | |
| 69 | - /** | |
| 70 | - * @since 4.0 | |
| 71 | - * | |
| 72 | - * @param array $args Includes 'field', 'display', and 'values'. | |
| 73 | - * | |
| 74 | - * @return void | |
| 75 | - */ | |
| 76 | - public function show_extra_field_choices( $args ) { | |
| 77 | - $this->auto_width_setting( $args ); | |
| 78 | - } | |
| 79 | - | |
| 80 | - /** | |
| 81 | - * @return string | |
| 82 | - */ | |
| 83 | 41 | protected function include_front_form_file() { |
| 84 | 42 | return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php'; |
| 85 | 43 | } |
| 86 | 44 | |
| 87 | - /** | |
| 88 | - * @return bool | |
| 89 | - */ | |
| 90 | 45 | protected function show_readonly_hidden() { |
| 91 | 46 | return true; |
| 92 | 47 | } |
| 93 | 48 | |
| @@ -92,10 +47,9 @@ | ||
| 92 | 47 | } |
| 93 | 48 | |
| 94 | 49 | protected function prepare_import_value( $value, $atts ) { |
| 95 | 50 | if ( FrmField::is_option_true( $this->field, 'multiple' ) ) { |
| 96 | - return $this->get_multi_opts_for_import( $value ); | |
| 51 | + $value = $this->get_multi_opts_for_import( $value ); | |
| 97 | 52 | } |
| 98 | - | |
| 99 | 53 | return $value; |
| 100 | 54 | } |
| 101 | 55 | } |