| @@ -11,9 +11,9 @@ | ||
| 11 | 11 | $this->icon = 'calendar-o'; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | - * Render the date field | |
| 15 | + * Render the text field | |
| 16 | 16 | * |
| 17 | 17 | * @param array $field_settings |
| 18 | 18 | * @param int $form_id |
| 19 | 19 | * |
| @@ -19,31 +19,14 @@ | ||
| 19 | 19 | * |
| 20 | 20 | * @return void |
| 21 | 21 | */ |
| 22 | 22 | public function render( $field_settings, $form_id ) { |
| 23 | - $use_theme_css = isset( $form_settings['use_theme_css'] ) ? $form_settings['use_theme_css'] : 'wpuf-style'; | |
| 24 | - $value = ''; | |
| 25 | - ?> | |
| 23 | + $value = ''; ?> | |
| 26 | 24 | <li <?php $this->print_list_attributes( $field_settings ); ?>> |
| 27 | 25 | <?php $this->print_label( $field_settings ); ?> |
| 28 | 26 | |
| 29 | 27 | <div class="wpuf-fields"> |
| 30 | - <input | |
| 31 | - id="wpuf-date-<?php echo esc_attr( $field_settings['name'] ); ?>" | |
| 32 | - type="text" | |
| 33 | - <?php | |
| 34 | - $field_settings['enforce_format'] = ! isset( $field_settings['enforce_format'] ) ? '' : $field_settings['enforce_format']; | |
| 35 | - echo esc_attr( $field_settings['enforce_format'] !== 'yes' ) ? '' : 'readonly'; | |
| 36 | - ?> | |
| 37 | - class="datepicker <?php echo ' wpuf_'.esc_attr( $field_settings['name'] ).'_'. esc_attr($form_id); ?>" | |
| 38 | - data-required="<?php echo esc_attr($field_settings['required']) ?>" | |
| 39 | - data-type="text" | |
| 40 | - data-style="<?php echo esc_attr( $use_theme_css ); ?>" | |
| 41 | - name="<?php echo esc_attr( $field_settings['name'] ); ?>" | |
| 42 | - placeholder="<?php echo esc_attr( $field_settings['format'] ); ?>" | |
| 43 | - value="<?php echo esc_attr( $value ) ?>" | |
| 44 | - size="30" | |
| 45 | - /> | |
| 28 | + <input id="wpuf-date-<?php echo esc_attr( $field_settings['name'] ); ?>" type="text" class="datepicker <?php echo ' wpuf_'.esc_attr( $field_settings['name'] ).'_'. esc_attr($form_id); ?>" data-required="<?php echo esc_attr($field_settings['required']) ?>" data-type="text" name="<?php echo esc_attr( $field_settings['name'] ); ?>" placeholder="<?php echo esc_attr( $field_settings['format'] ); ?>" value="<?php echo esc_attr( $value ) ?>" size="30" /> | |
| 46 | 29 | <?php $this->help_text( $field_settings ); ?> |
| 47 | 30 | </div> |
| 48 | 31 | </li> |
| 49 | 32 | <?php |
| @@ -74,13 +57,13 @@ | ||
| 74 | 57 | |
| 75 | 58 | $settings = [ |
| 76 | 59 | [ |
| 77 | 60 | 'name' => 'format', |
| 78 | - 'title' => esc_html__( 'Date Format', 'weforms' ), | |
| 61 | + 'title' => __( 'Date Format', 'weforms' ), | |
| 79 | 62 | 'type' => 'text', |
| 80 | 63 | 'section' => 'advanced', |
| 81 | 64 | 'priority' => 23, |
| 82 | - 'help_text' => esc_html__( 'The date format', 'weforms' ), | |
| 65 | + 'help_text' => __( 'The date format', 'weforms' ), | |
| 83 | 66 | ], |
| 84 | 67 | [ |
| 85 | 68 | 'name' => 'time', |
| 86 | 69 | 'title' => '', |
| @@ -86,9 +69,9 @@ | ||
| 86 | 69 | 'title' => '', |
| 87 | 70 | 'type' => 'checkbox', |
| 88 | 71 | 'is_single_opt' => true, |
| 89 | 72 | 'options' => [ |
| 90 | - 'yes' => esc_html__( 'Enable time input', 'weforms' ), | |
| 73 | + 'yes' => __( 'Enable time input', 'weforms' ), | |
| 91 | 74 | ], |
| 92 | 75 | 'section' => 'advanced', |
| 93 | 76 | 'priority' => 24, |
| 94 | 77 | 'help_text' => '', |
| @@ -98,27 +81,14 @@ | ||
| 98 | 81 | 'title' => '', |
| 99 | 82 | 'type' => 'checkbox', |
| 100 | 83 | 'is_single_opt' => true, |
| 101 | 84 | 'options' => [ |
| 102 | - 'yes' => esc_html__( 'Set this as publish time input', 'weforms' ), | |
| 85 | + 'yes' => __( 'Set this as publish time input', 'weforms' ), | |
| 103 | 86 | ], |
| 104 | 87 | 'section' => 'advanced', |
| 105 | 88 | 'priority' => 24, |
| 106 | 89 | 'help_text' => '', |
| 107 | 90 | ], |
| 108 | - [ | |
| 109 | - 'name' => 'enforce_format', | |
| 110 | - 'title' => __( 'Toggle Keyboard input for Date', 'weforms' ), | |
| 111 | - 'type' => 'checkbox', | |
| 112 | - 'section' => 'advanced', | |
| 113 | - 'is_single_opt' => true, | |
| 114 | - 'options' => [ | |
| 115 | - 'yes' => esc_html__( 'Force Datepicker Input', 'weforms' ), | |
| 116 | - ], | |
| 117 | - 'default' => 'yes', | |
| 118 | - 'priority' => 24, | |
| 119 | - 'help_text' => esc_html__( 'Disables Keyboard Input and uses the Datepicker Format', 'weforms' ), | |
| 120 | - ], | |
| 121 | 91 | ]; |
| 122 | 92 | |
| 123 | 93 | return array_merge( $default_options, $settings ); |
| 124 | 94 | } |
| @@ -133,9 +103,8 @@ | ||
| 133 | 103 | $props = [ |
| 134 | 104 | 'format' => 'dd/mm/yy', |
| 135 | 105 | 'time' => '', |
| 136 | 106 | 'is_publish_time' => '', |
| 137 | - 'enforce_format' => '', | |
| 138 | 107 | ]; |
| 139 | 108 | |
| 140 | 109 | return array_merge( $defaults, $props ); |
| 141 | 110 | } |