| @@ -75,10 +75,8 @@ | ||
| 75 | 75 | * |
| 76 | 76 | * @since 2.04 |
| 77 | 77 | * |
| 78 | 78 | * @param int|string $entry_id |
| 79 | - * | |
| 80 | - * @return void | |
| 81 | 79 | */ |
| 82 | 80 | protected function init_entry( $entry_id ) { |
| 83 | 81 | $this->entry = FrmEntry::getOne( $entry_id, true ); |
| 84 | 82 | } |
| @@ -83,23 +81,11 @@ | ||
| 83 | 81 | $this->entry = FrmEntry::getOne( $entry_id, true ); |
| 84 | 82 | } |
| 85 | 83 | |
| 86 | 84 | /** |
| 87 | - * Gets entry property. | |
| 88 | - * | |
| 89 | - * @since 5.0.16 | |
| 90 | - * @return stdClass | |
| 91 | - */ | |
| 92 | - public function get_entry() { | |
| 93 | - return $this->entry; | |
| 94 | - } | |
| 95 | - | |
| 96 | - /** | |
| 97 | 85 | * Set the form_id property |
| 98 | 86 | * |
| 99 | 87 | * @since 2.04 |
| 100 | - * | |
| 101 | - * @return void | |
| 102 | 88 | */ |
| 103 | 89 | protected function init_form_id() { |
| 104 | 90 | $this->form_id = (int) $this->entry->form_id; |
| 105 | 91 | } |
| @@ -109,10 +95,8 @@ | ||
| 109 | 95 | * |
| 110 | 96 | * @since 2.04 |
| 111 | 97 | * |
| 112 | 98 | * @param array $atts |
| 113 | - * | |
| 114 | - * @return void | |
| 115 | 99 | */ |
| 116 | 100 | protected function init_include_fields( $atts ) { |
| 117 | 101 | |
| 118 | 102 | // For reverse compatibility with the fields parameter |
| @@ -134,18 +118,8 @@ | ||
| 134 | 118 | } |
| 135 | 119 | } |
| 136 | 120 | |
| 137 | 121 | $this->include_fields = $this->prepare_array_property( 'include_fields', $atts ); |
| 138 | - | |
| 139 | - /** | |
| 140 | - * Allows modifying the IDs of include_fields used in the entry values. | |
| 141 | - * | |
| 142 | - * @since 5.0.04 | |
| 143 | - * | |
| 144 | - * @param array $field_ids The list of field IDs. | |
| 145 | - * @param array $atts The arguments. See {@see FrmEntriesController::show_entry_shortcode()}. | |
| 146 | - */ | |
| 147 | - $this->include_fields = apply_filters( 'frm_entry_values_include_fields', $this->include_fields, $atts ); | |
| 148 | 122 | } |
| 149 | 123 | |
| 150 | 124 | /** |
| 151 | 125 | * Set the exclude_fields property |
| @@ -152,23 +126,11 @@ | ||
| 152 | 126 | * |
| 153 | 127 | * @since 2.04 |
| 154 | 128 | * |
| 155 | 129 | * @param array $atts |
| 156 | - * | |
| 157 | - * @return void | |
| 158 | 130 | */ |
| 159 | 131 | protected function init_exclude_fields( $atts ) { |
| 160 | 132 | $this->exclude_fields = $this->prepare_array_property( 'exclude_fields', $atts ); |
| 161 | - | |
| 162 | - /** | |
| 163 | - * Allows modifying the IDs of exclude_fields used in the entry values. | |
| 164 | - * | |
| 165 | - * @since 5.0.04 | |
| 166 | - * | |
| 167 | - * @param array $field_ids The list of field IDs. | |
| 168 | - * @param array $atts The arguments. See {@see FrmEntriesController::show_entry_shortcode()}. | |
| 169 | - */ | |
| 170 | - $this->exclude_fields = apply_filters( 'frm_entry_values_exclude_fields', $this->exclude_fields, $atts ); | |
| 171 | 133 | } |
| 172 | 134 | |
| 173 | 135 | /** |
| 174 | 136 | * Prepare an array property value, such as include_fields and exclude_fields |
| @@ -198,30 +160,11 @@ | ||
| 198 | 160 | /** |
| 199 | 161 | * Set the fields property |
| 200 | 162 | * |
| 201 | 163 | * @since 2.04 |
| 202 | - * | |
| 203 | - * @return void | |
| 204 | 164 | */ |
| 205 | 165 | protected function init_fields() { |
| 206 | 166 | $this->fields = FrmField::get_all_for_form( $this->form_id, '', 'exclude', 'exclude' ); |
| 207 | - | |
| 208 | - /** | |
| 209 | - * Allows modifying the list of all field in the form that is used in the entry values. | |
| 210 | - * | |
| 211 | - * @since 5.0.04 | |
| 212 | - * | |
| 213 | - * @param array $fields The list of fields. | |
| 214 | - * @param array $args The arguments. Contains `form_id`, `entry`. | |
| 215 | - */ | |
| 216 | - $this->fields = apply_filters( | |
| 217 | - 'frm_entry_values_fields', | |
| 218 | - $this->fields, | |
| 219 | - array( | |
| 220 | - 'form_id' => $this->form_id, | |
| 221 | - 'entry' => $this->entry, | |
| 222 | - ) | |
| 223 | - ); | |
| 224 | 167 | } |
| 225 | 168 | |
| 226 | 169 | /** |
| 227 | 170 | * Set the field_values property |
| @@ -226,10 +169,8 @@ | ||
| 226 | 169 | /** |
| 227 | 170 | * Set the field_values property |
| 228 | 171 | * |
| 229 | 172 | * @since 2.04 |
| 230 | - * | |
| 231 | - * @return void | |
| 232 | 173 | */ |
| 233 | 174 | protected function init_field_values() { |
| 234 | 175 | foreach ( $this->fields as $field ) { |
| 235 | 176 | if ( $this->is_field_included( $field ) ) { |
| @@ -252,10 +193,8 @@ | ||
| 252 | 193 | /** |
| 253 | 194 | * Set the user_info property |
| 254 | 195 | * |
| 255 | 196 | * @since 2.04 |
| 256 | - * | |
| 257 | - * @return void | |
| 258 | 197 | */ |
| 259 | 198 | protected function init_user_info() { |
| 260 | 199 | if ( isset( $this->entry->description ) ) { |
| 261 | 200 | $entry_description = (array) $this->entry->description; |
| @@ -265,31 +204,23 @@ | ||
| 265 | 204 | 'referrer' => '', |
| 266 | 205 | ); |
| 267 | 206 | } |
| 268 | 207 | |
| 269 | - $ip = array( | |
| 208 | + $ip = array( | |
| 270 | 209 | 'label' => __( 'IP Address', 'formidable' ), |
| 271 | 210 | 'value' => $this->entry->ip, |
| 272 | 211 | ); |
| 212 | + | |
| 273 | 213 | $browser = array( |
| 274 | 214 | 'label' => __( 'User-Agent (Browser/OS)', 'formidable' ), |
| 275 | - 'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '', | |
| 215 | + 'value' => FrmEntriesHelper::get_browser( $entry_description['browser'] ), | |
| 276 | 216 | ); |
| 217 | + | |
| 277 | 218 | $referrer = array( |
| 278 | 219 | 'label' => __( 'Referrer', 'formidable' ), |
| 279 | - 'value' => isset( $entry_description['referrer'] ) ? $entry_description['referrer'] : '', | |
| 220 | + 'value' => $entry_description['referrer'], | |
| 280 | 221 | ); |
| 281 | 222 | |
| 282 | - /** | |
| 283 | - * Allow the referrer to be modified. | |
| 284 | - * | |
| 285 | - * @since 5.5.1 | |
| 286 | - * | |
| 287 | - * @param array $referrer | |
| 288 | - * @param array @entry_description | |
| 289 | - */ | |
| 290 | - $referrer = apply_filters( 'frm_user_info_referrer', $referrer, $entry_description, $this->entry ); | |
| 291 | - | |
| 292 | 223 | $this->user_info = array( |
| 293 | 224 | 'ip' => $ip, |
| 294 | 225 | 'browser' => $browser, |
| 295 | 226 | 'referrer' => $referrer, |
| @@ -351,10 +282,8 @@ | ||
| 351 | 282 | * |
| 352 | 283 | * @since 2.04 |
| 353 | 284 | * |
| 354 | 285 | * @param stdClass $field |
| 355 | - * | |
| 356 | - * @return void | |
| 357 | 286 | */ |
| 358 | 287 | protected function add_field_values( $field ) { |
| 359 | 288 | $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
| 360 | 289 | } |