@@ -11,10 +11,10 @@ |
||
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <div class="gv-search-box gv-search-date"> |
| 14 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
| 15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
| 14 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
| 15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
| 16 | 16 | <?php } ?> |
| 17 | 17 | <p> |
| 18 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
| 18 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
| 19 | 19 | </p> |
| 20 | 20 | </div> |
| 21 | 21 | \ No newline at end of file |
@@ -10,10 +10,10 @@ |
||
| 10 | 10 | |
| 11 | 11 | ?> |
| 12 | 12 | <div class="gv-search-box gv-search-field-text"> |
| 13 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
| 14 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
| 13 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
| 14 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
| 15 | 15 | <?php } ?> |
| 16 | 16 | <p> |
| 17 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"> |
|
| 17 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"> |
|
| 18 | 18 | </p> |
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div class="gv-search-box gv-search-field-single_checkbox"> |
| 15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio"> |
|
| 16 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>> |
|
| 17 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { echo esc_html( $search_field['label'] ); } ?> |
|
| 15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" class="gv-check-radio"> |
|
| 16 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" <?php checked( '1', $search_field[ 'value' ], true ); ?>> |
|
| 17 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { echo esc_html( $search_field[ 'label' ] ); } ?> |
|
| 18 | 18 | </label> |
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file |
@@ -42,16 +42,16 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $args = wp_parse_args( $args, $defaults ); |
| 44 | 44 | |
| 45 | - $forms = gravityview_get_forms( (bool) $args['active'], (bool) $args['trash'] ); |
|
| 45 | + $forms = gravityview_get_forms( (bool)$args[ 'active' ], (bool)$args[ 'trash' ] ); |
|
| 46 | 46 | |
| 47 | - if( array() === $args['options'] ) { |
|
| 47 | + if ( array() === $args[ 'options' ] ) { |
|
| 48 | 48 | foreach ( $forms as $form ) { |
| 49 | 49 | |
| 50 | - if ( in_array( $form['id'], $args['exclude'] ) ) { |
|
| 50 | + if ( in_array( $form[ 'id' ], $args[ 'exclude' ] ) ) { |
|
| 51 | 51 | continue; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $args['options'][ $form['id'] ] = esc_html( $form['title'] ); |
|
| 54 | + $args[ 'options' ][ $form[ 'id' ] ] = esc_html( $form[ 'title' ] ); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -83,15 +83,15 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $args = wp_parse_args( $args, $defaults ); |
| 85 | 85 | |
| 86 | - if( empty( $args['form_id'] ) ) { |
|
| 86 | + if ( empty( $args[ 'form_id' ] ) ) { |
|
| 87 | 87 | return ''; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $fields = GVCommon::get_sortable_fields_array( $args['form_id'] ); |
|
| 90 | + $fields = GVCommon::get_sortable_fields_array( $args[ 'form_id' ] ); |
|
| 91 | 91 | |
| 92 | - if( array() === $args['options'] ) { |
|
| 92 | + if ( array() === $args[ 'options' ] ) { |
|
| 93 | 93 | foreach ( $fields as $field_id => $field ) { |
| 94 | - $args['options'][ $field_id ] = esc_html( $field['label'] ); |
|
| 94 | + $args[ 'options' ][ $field_id ] = esc_html( $field[ 'label' ] ); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -127,43 +127,43 @@ discard block |
||
| 127 | 127 | $args = wp_parse_args( $args, $defaults ); |
| 128 | 128 | |
| 129 | 129 | $data_elements = ''; |
| 130 | - foreach ( $args['data'] as $key => $value ) { |
|
| 130 | + foreach ( $args[ 'data' ] as $key => $value ) { |
|
| 131 | 131 | $data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if( $args['multiple'] ) { |
|
| 134 | + if ( $args[ 'multiple' ] ) { |
|
| 135 | 135 | $multiple = ' MULTIPLE'; |
| 136 | 136 | } else { |
| 137 | 137 | $multiple = ''; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if( $args['placeholder'] ) { |
|
| 141 | - $placeholder = $args['placeholder']; |
|
| 140 | + if ( $args[ 'placeholder' ] ) { |
|
| 141 | + $placeholder = $args[ 'placeholder' ]; |
|
| 142 | 142 | } else { |
| 143 | 143 | $placeholder = ''; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $disabled = $args['disabled'] ? ' disabled="disabled"' : ''; |
|
| 147 | - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); |
|
| 148 | - $output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>'; |
|
| 146 | + $disabled = $args[ 'disabled' ] ? ' disabled="disabled"' : ''; |
|
| 147 | + $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args[ 'class' ] ) ) ); |
|
| 148 | + $output = '<select name="' . esc_attr( $args[ 'name' ] ) . '" id="' . esc_attr( str_replace( '-', '_', $args[ 'id' ] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>'; |
|
| 149 | 149 | |
| 150 | - if ( ! empty( $args['options'] ) ) { |
|
| 150 | + if ( ! empty( $args[ 'options' ] ) ) { |
|
| 151 | 151 | |
| 152 | - if ( $args['show_option_none'] ) { |
|
| 153 | - if( $args['multiple'] ) { |
|
| 154 | - $selected = selected( true, in_array( -1, $args['selected'] ), false ); |
|
| 152 | + if ( $args[ 'show_option_none' ] ) { |
|
| 153 | + if ( $args[ 'multiple' ] ) { |
|
| 154 | + $selected = selected( true, in_array( -1, $args[ 'selected' ] ), false ); |
|
| 155 | 155 | } else { |
| 156 | - $selected = selected( $args['selected'], -1, false ); |
|
| 156 | + $selected = selected( $args[ 'selected' ], -1, false ); |
|
| 157 | 157 | } |
| 158 | - $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>'; |
|
| 158 | + $output .= '<option value="-1"' . $selected . '>' . esc_html( $args[ 'show_option_none' ] ) . '</option>'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - foreach( $args['options'] as $key => $option ) { |
|
| 161 | + foreach ( $args[ 'options' ] as $key => $option ) { |
|
| 162 | 162 | |
| 163 | - if( $args['multiple'] && is_array( $args['selected'] ) ) { |
|
| 164 | - $selected = selected( true, in_array( $key, $args['selected'], true ), false ); |
|
| 163 | + if ( $args[ 'multiple' ] && is_array( $args[ 'selected' ] ) ) { |
|
| 164 | + $selected = selected( true, in_array( $key, $args[ 'selected' ], true ), false ); |
|
| 165 | 165 | } else { |
| 166 | - $selected = selected( $args['selected'], $key, false ); |
|
| 166 | + $selected = selected( $args[ 'selected' ], $key, false ); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>'; |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | function parse_um_profile_post_content( $args = array() ) { |
| 44 | 44 | global $ultimatemember; |
| 45 | 45 | |
| 46 | - if( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) { |
|
| 46 | + if ( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) { |
|
| 47 | 47 | return; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // @todo Support Ultimate Member 2.0 - for now, prevent fatal error |
| 51 | - if( ! isset( $ultimatemember->profile ) ) { |
|
| 51 | + if ( ! isset( $ultimatemember->profile ) ) { |
|
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - GravityView_View_Data::getInstance()->parse_post_content( $active_tab[0]->post_content ); |
|
| 67 | + GravityView_View_Data::getInstance()->parse_post_content( $active_tab[ 0 ]->post_content ); |
|
| 68 | 68 | |
| 69 | 69 | wp_reset_postdata(); |
| 70 | 70 | } |
@@ -141,7 +141,7 @@ |
||
| 141 | 141 | global $wpdb; |
| 142 | 142 | |
| 143 | 143 | if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) |
| 144 | - && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) { |
|
| 144 | + && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) { |
|
| 145 | 145 | $notes_table = GFFormsModel::get_entry_notes_table_name(); |
| 146 | 146 | } else { |
| 147 | 147 | $notes_table = GFFormsModel::get_lead_notes_table_name(); |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | // Make sure the keys are all set |
| 68 | 68 | $note = wp_parse_args( $note, $default_note ); |
| 69 | 69 | |
| 70 | - GFFormsModel::add_note( intval( $note['lead_id'] ), intval( $note['user_id'] ), esc_attr( $note['user_name'] ), $note['note'], esc_attr( $note['note_type'] ) ); |
|
| 70 | + GFFormsModel::add_note( intval( $note[ 'lead_id' ] ), intval( $note[ 'user_id' ] ), esc_attr( $note[ 'user_name' ] ), $note[ 'note' ], esc_attr( $note[ 'note_type' ] ) ); |
|
| 71 | 71 | |
| 72 | 72 | // If last_error is empty string, there was no error. |
| 73 | - if( empty( $wpdb->last_error ) ) { |
|
| 73 | + if ( empty( $wpdb->last_error ) ) { |
|
| 74 | 74 | $return = $wpdb->insert_id; |
| 75 | 75 | } else { |
| 76 | 76 | $return = new WP_Error( 'gravityview-add-note', $wpdb->last_error ); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public static function delete_notes( $note_ids = array() ) { |
| 98 | 98 | |
| 99 | - if( !is_array( $note_ids ) ) { |
|
| 99 | + if ( ! is_array( $note_ids ) ) { |
|
| 100 | 100 | |
| 101 | 101 | gravityview()->log->error( 'Note IDs not an array. Not processing delete request.', array( 'data' => $note_ids ) ); |
| 102 | 102 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ) |
| 158 | 158 | ); |
| 159 | 159 | |
| 160 | - return $results ? $results[0] : false; |
|
| 160 | + return $results ? $results[ 0 ] : false; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public static function filter_avatar( $avatar = '', $note = null ) { |
| 172 | 172 | |
| 173 | - if( 'gravityview' === $note->note_type && -1 === (int)$note->user_id ) { |
|
| 174 | - $avatar = sprintf( '<img src="%s" width="48" height="48" alt="GravityView" class="avatar avatar-48 gravityview-avatar" />', esc_url_raw( plugins_url( 'assets/images/floaty-avatar.png', GRAVITYVIEW_FILE ) ) ); |
|
| 173 | + if ( 'gravityview' === $note->note_type && -1 === (int)$note->user_id ) { |
|
| 174 | + $avatar = sprintf( '<img src="%s" width="48" height="48" alt="GravityView" class="avatar avatar-48 gravityview-avatar" />', esc_url_raw( plugins_url( 'assets/images/floaty-avatar.png', GRAVITYVIEW_FILE ) ) ); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $avatar; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | printf( '<body style="padding: 0; margin: 0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">' ); |
| 26 | 26 | printf( '<img src="' . plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ) . '" alt="The GravityView Astronaut Says:" style="float: left; height: 60px; margin-right : 10px;" />' ); |
| 27 | 27 | printf( __( "%sGravityView requires PHP Version %s or newer.%s \n\nYou're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ), |
| 28 | - '<h3 style="font-size:16px; margin: 0 0 8px 0;">', GV_MIN_PHP_VERSION , "</h3>\n\n", $version ); |
|
| 28 | + '<h3 style="font-size:16px; margin: 0 0 8px 0;">', GV_MIN_PHP_VERSION, "</h3>\n\n", $version ); |
|
| 29 | 29 | printf( '</body>' ); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** The future branch of GravityView requires PHP 5.3+ namespaces and SPL. */ |
| 37 | -if ( version_compare( phpversion(), '5.3.0' , '<' ) ) { |
|
| 37 | +if ( version_compare( phpversion(), '5.3.0', '<' ) ) { |
|
| 38 | 38 | require GRAVITYVIEW_DIR . 'future/_stubs.php'; |
| 39 | 39 | |
| 40 | 40 | /** All looks fine. */ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public static function remove() { |
| 78 | 78 | $shortcode = new static(); |
| 79 | - unset( self::$shortcodes[$shortcode->name] ); |
|
| 79 | + unset( self::$shortcodes[ $shortcode->name ] ); |
|
| 80 | 80 | remove_shortcode( $shortcode->name ); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); |
| 109 | 109 | |
| 110 | 110 | foreach ( $matches as $shortcode ) { |
| 111 | - $shortcode_name = $shortcode[2]; |
|
| 111 | + $shortcode_name = $shortcode[ 2 ]; |
|
| 112 | 112 | |
| 113 | - $shortcode_atts = shortcode_parse_atts( $shortcode[3] ); |
|
| 114 | - $shortcode_content = $shortcode[5]; |
|
| 113 | + $shortcode_atts = shortcode_parse_atts( $shortcode[ 3 ] ); |
|
| 114 | + $shortcode_content = $shortcode[ 5 ]; |
|
| 115 | 115 | |
| 116 | 116 | /** This is a registered GravityView shortcode. */ |
| 117 | - if ( !empty( self::$shortcodes[$shortcode_name] ) ) { |
|
| 118 | - $shortcode = clone self::$shortcodes[$shortcode_name]; |
|
| 117 | + if ( ! empty( self::$shortcodes[ $shortcode_name ] ) ) { |
|
| 118 | + $shortcode = clone self::$shortcodes[ $shortcode_name ]; |
|
| 119 | 119 | } else { |
| 120 | 120 | /** This is some generic shortcode. */ |
| 121 | 121 | $shortcode = new self; |
@@ -27,17 +27,17 @@ discard block |
||
| 27 | 27 | * @return \GV\GF_Field|null The field implementation or null on error. |
| 28 | 28 | */ |
| 29 | 29 | public static function from_configuration( $configuration ) { |
| 30 | - if ( empty( $configuration['id'] ) || ! is_numeric( $configuration['id'] ) ) { |
|
| 30 | + if ( empty( $configuration[ 'id' ] ) || ! is_numeric( $configuration[ 'id' ] ) ) { |
|
| 31 | 31 | gravityview()->log->error( 'Invalid configuration[id] supplied.' ); |
| 32 | 32 | return null; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ( empty( $configuration['form_id'] ) || ! $form = \GV\GF_Form::by_id( $configuration['form_id'] ) ) { |
|
| 35 | + if ( empty( $configuration[ 'form_id' ] ) || ! $form = \GV\GF_Form::by_id( $configuration[ 'form_id' ] ) ) { |
|
| 36 | 36 | gravityview()->log->error( 'Invalid configuration[form_id] supplied.' ); |
| 37 | 37 | return null; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $field = self::by_id( $form, $configuration['id'] ); |
|
| 40 | + $field = self::by_id( $form, $configuration[ 'id' ] ); |
|
| 41 | 41 | |
| 42 | 42 | if ( ! $field ) { |
| 43 | 43 | gravityview()->log->error( 'Invalid configuration[id] supplied.' ); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | /** This is a complex Gravity Forms input. */ |
| 113 | 113 | if ( $input = \GFFormsModel::get_input( $this->field, $this->ID ) ) { |
| 114 | - $label = ! empty( $input['customLabel'] ) ? $input['customLabel'] : $input['label']; |
|
| 114 | + $label = ! empty( $input[ 'customLabel' ] ) ? $input[ 'customLabel' ] : $input[ 'label' ]; |
|
| 115 | 115 | } else { |
| 116 | 116 | /** This is a field with one label. */ |
| 117 | 117 | $label = $this->field->get_field_label( true, $this->label ); |