| @@ -9,19 +9,16 @@ | ||
| 9 | 9 | class FrmFieldPhone extends FrmFieldType { |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @var string |
| 13 | + * | |
| 13 | 14 | * @since 3.0 |
| 14 | 15 | */ |
| 15 | 16 | protected $type = 'phone'; |
| 16 | 17 | |
| 17 | 18 | /** |
| 18 | - * @var string | |
| 19 | - */ | |
| 20 | - protected $display_type = 'text'; | |
| 21 | - | |
| 22 | - /** | |
| 23 | 19 | * @var bool |
| 20 | + * | |
| 24 | 21 | * @since 3.0 |
| 25 | 22 | */ |
| 26 | 23 | protected $holds_email_values = true; |
| 27 | 24 | |
| @@ -37,23 +34,60 @@ | ||
| 37 | 34 | return array( |
| 38 | 35 | 'size' => true, |
| 39 | 36 | 'clear_on_focus' => true, |
| 40 | 37 | 'invalid' => true, |
| 41 | - 'format' => true, | |
| 42 | 38 | ); |
| 43 | 39 | } |
| 44 | 40 | |
| 45 | 41 | /** |
| 42 | + * @since 6.9 | |
| 43 | + * | |
| 44 | + * @param array $args Includes 'field', 'display', and 'values'. | |
| 45 | + * | |
| 46 | + * @return void | |
| 47 | + */ | |
| 48 | + public function show_primary_options( $args ) { | |
| 49 | + $field = $args['field']; | |
| 50 | + | |
| 51 | + include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/phone/phone-type.php'; | |
| 52 | + FrmFieldsController::show_format_option( $field, true ); | |
| 53 | + | |
| 54 | + parent::show_primary_options( $args ); | |
| 55 | + } | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * Retrieves the HTML for an 'International' option in a dropdown. | |
| 59 | + * | |
| 60 | + * @since 6.9 | |
| 61 | + * | |
| 62 | + * @return void Outputs the HTML option tag directly. | |
| 63 | + */ | |
| 64 | + protected function print_international_option() { | |
| 65 | + // phpcs:disable Generic.WhiteSpace.ScopeIndent | |
| 66 | + ?> | |
| 67 | + <option | |
| 68 | + value="" | |
| 69 | + class="frm_show_upgrade frm_noallow" | |
| 70 | + data-upgrade="<?php esc_attr_e( 'International phone field', 'formidable' ); ?>" | |
| 71 | + data-medium="international-phone-field" | |
| 72 | + > | |
| 73 | + <?php esc_html_e( 'International', 'formidable' ); ?> | |
| 74 | + </option> | |
| 75 | + <?php | |
| 76 | + // phpcs:enable Generic.WhiteSpace.ScopeIndent | |
| 77 | + } | |
| 78 | + | |
| 79 | + /** | |
| 46 | 80 | * @return string |
| 47 | 81 | */ |
| 48 | 82 | protected function html5_input_type() { |
| 49 | - $frm_settings = FrmAppHelper::get_settings(); | |
| 50 | - | |
| 51 | - return $frm_settings->use_html ? 'tel' : 'text'; | |
| 83 | + return 'tel'; | |
| 52 | 84 | } |
| 53 | 85 | |
| 54 | 86 | /** |
| 55 | 87 | * @since 4.0.04 |
| 88 | + * | |
| 89 | + * @param array|string $value | |
| 56 | 90 | * |
| 57 | 91 | * @return void |
| 58 | 92 | */ |
| 59 | 93 | public function sanitize_value( &$value ) { |