| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* @since 3.0 |
| 5 |
*/ |
| 6 |
class FrmFieldSelect extends FrmFieldType { |
| 7 |
|
| 8 |
/** |
| 9 |
* @var string |
| 10 |
* @since 3.0 |
| 11 |
*/ |
| 12 |
protected $type = 'select'; |
| 13 |
|
| 14 |
/** |
| 15 |
* @var bool |
| 16 |
* @since 3.0 |
| 17 |
*/ |
| 18 |
protected $holds_email_values = true; |
| 19 |
|
| 20 |
protected function include_form_builder_file() { |
| 21 |
return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/dropdown-field.php'; |
| 22 |
} |
| 23 |
|
| 24 |
protected function field_settings_for_type() { |
| 25 |
return array( |
| 26 |
'size' => true, |
| 27 |
); |
| 28 |
} |
| 29 |
|
| 30 |
protected function new_field_settings() { |
| 31 |
return array( |
| 32 |
'options' => serialize( |
| 33 |
array( |
| 34 |
'', |
| 35 |
__( 'Option 1', 'formidable' ), |
| 36 |
) |
| 37 |
), |
| 38 |
); |
| 39 |
} |
| 40 |
|
| 41 |
protected function include_front_form_file() { |
| 42 |
return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php'; |
| 43 |
} |
| 44 |
|
| 45 |
protected function show_readonly_hidden() { |
| 46 |
return true; |
| 47 |
} |
| 48 |
|
| 49 |
protected function prepare_import_value( $value, $atts ) { |
| 50 |
if ( FrmField::is_option_true( $this->field, 'multiple' ) ) { |
| 51 |
$value = $this->get_multi_opts_for_import( $value ); |
| 52 |
} |
| 53 |
return $value; |
| 54 |
} |
| 55 |
} |
| 56 |
|