@@ -182,6 +182,9 @@ |
||
| 182 | 182 | $values = apply_filters( 'frm_prepare_entry_array', $values, $atts ); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | + /** |
|
| 186 | + * @param string $val |
|
| 187 | + */ |
|
| 185 | 188 | private static function get_field_value( $atts, &$val ) { |
| 186 | 189 | $f = $atts['field']; |
| 187 | 190 | if ( $atts['entry'] ) { |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * Flatten multi-dimensional array for multi-file upload fields |
|
| 200 | - * @since 2.0.9 |
|
| 201 | - */ |
|
| 199 | + * Flatten multi-dimensional array for multi-file upload fields |
|
| 200 | + * @since 2.0.9 |
|
| 201 | + */ |
|
| 202 | 202 | public static function flatten_multi_file_upload( $field, &$val ) { |
| 203 | 203 | if ( $field->type == 'file' && FrmField::is_option_true( $field, 'multiple' ) ) { |
| 204 | 204 | $val = FrmAppHelper::array_flatten( $val ); |
@@ -218,10 +218,10 @@ discard block |
||
| 218 | 218 | self::maybe_strip_html( $atts['plain_text'], $val ); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - /** |
|
| 222 | - * Replace returns with HTML line breaks for display |
|
| 223 | - * @since 2.0.9 |
|
| 224 | - */ |
|
| 221 | + /** |
|
| 222 | + * Replace returns with HTML line breaks for display |
|
| 223 | + * @since 2.0.9 |
|
| 224 | + */ |
|
| 225 | 225 | public static function textarea_display_value( $type, $plain_text, &$value ) { |
| 226 | 226 | if ( $type == 'textarea' && ! $plain_text ) { |
| 227 | 227 | $value = str_replace( array( "\r\n", "\r", "\n" ), ' <br/>', $value ); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if ( ! self::skip_field( $atts, $f ) ) { |
| 53 | 53 | self::fill_entry_values( $atts, $f, $values ); |
| 54 | 54 | } |
| 55 | - unset($f); |
|
| 55 | + unset( $f ); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | self::fill_entry_user_info( $atts, $values ); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | 'type' => $f->type, |
| 122 | 122 | ); |
| 123 | 123 | |
| 124 | - $values[ $f->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f ); |
|
| 124 | + $values[$f->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f ); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | public static function fill_entry_values( $atts, $f, array &$values ) { |
@@ -153,22 +153,22 @@ discard block |
||
| 153 | 153 | self::prepare_field_output( $atts, $val ); |
| 154 | 154 | |
| 155 | 155 | if ( $atts['format'] != 'text' ) { |
| 156 | - $values[ $f->field_key ] = $val; |
|
| 156 | + $values[$f->field_key] = $val; |
|
| 157 | 157 | if ( $atts['entry'] && $f->type != 'textarea' ) { |
| 158 | - $prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] ); |
|
| 158 | + $prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] ); |
|
| 159 | 159 | if ( $prev_val != $val ) { |
| 160 | - $values[ $f->field_key . '-value' ] = $prev_val; |
|
| 160 | + $values[$f->field_key . '-value'] = $prev_val; |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | } else { |
| 164 | - $values[ $f->id ] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type ); |
|
| 164 | + $values[$f->id] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type ); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | private static function fill_missing_fields( $atts, &$values ) { |
| 169 | - if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $atts['field']->id ] ) ) { |
|
| 169 | + if ( $atts['entry'] && ! isset( $atts['entry']->metas[$atts['field']->id] ) ) { |
|
| 170 | 170 | // In case include_blank is set |
| 171 | - $atts['entry']->metas[ $atts['field']->id ] = ''; |
|
| 171 | + $atts['entry']->metas[$atts['field']->id] = ''; |
|
| 172 | 172 | $atts['entry'] = apply_filters( 'frm_prepare_entry_content', $atts['entry'], array( 'field' => $atts['field'] ) ); |
| 173 | 173 | self::fill_values_from_entry( $atts, $values ); |
| 174 | 174 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | private static function get_field_value( $atts, &$val ) { |
| 182 | 182 | $f = $atts['field']; |
| 183 | 183 | if ( $atts['entry'] ) { |
| 184 | - $prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] ); |
|
| 184 | + $prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] ); |
|
| 185 | 185 | $meta = array( 'item_id' => $atts['id'], 'field_id' => $f->id, 'meta_value' => $prev_val, 'field_type' => $f->type ); |
| 186 | 186 | |
| 187 | 187 | //This filter applies to the default-message shortcode and frm-show-entry shortcode only |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | return; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - $data = self::get_entry_description_data( $atts ); |
|
| 266 | + $data = self::get_entry_description_data( $atts ); |
|
| 267 | 267 | |
| 268 | 268 | if ( $atts['default_email'] ) { |
| 269 | 269 | $atts['entry']->ip = '[ip]'; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | preg_match_all( $pattern, $u_agent, $matches ); // get the matching numbers |
| 351 | 351 | |
| 352 | 352 | // see how many we have |
| 353 | - $i = count($matches['browser']); |
|
| 353 | + $i = count( $matches['browser'] ); |
|
| 354 | 354 | if ( $i != 1 ) { |
| 355 | 355 | //we will have two since we are not using 'other' argument yet |
| 356 | 356 | //see if version is before or after the name |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | self::convert_entry_to_content( $values, $atts, $content ); |
| 376 | 376 | |
| 377 | 377 | if ( 'text' == $atts['format'] ) { |
| 378 | - $content = implode('', $content); |
|
| 378 | + $content = implode( '', $content ); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | if ( $atts['clickable'] ) { |
@@ -428,11 +428,11 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | // merge defaults, global settings, and shortcode options |
| 430 | 430 | foreach ( $default_settings as $key => $setting ) { |
| 431 | - if ( $atts[ $key ] != '' ) { |
|
| 431 | + if ( $atts[$key] != '' ) { |
|
| 432 | 432 | continue; |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | - $atts[ $key ] = $setting; |
|
| 435 | + $atts[$key] = $setting; |
|
| 436 | 436 | unset( $key, $setting ); |
| 437 | 437 | } |
| 438 | 438 | } |