@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | ) ); |
116 | 116 | |
117 | 117 | // This is just HTML we don't need. |
118 | - unset( $response['message'] ); |
|
118 | + unset( $response[ 'message' ] ); |
|
119 | 119 | |
120 | - switch ( intval( $response['license_limit'] ) ) { |
|
120 | + switch ( intval( $response[ 'license_limit' ] ) ) { |
|
121 | 121 | case 1: |
122 | 122 | $package = 'Sol'; |
123 | 123 | break; |
@@ -128,24 +128,24 @@ discard block |
||
128 | 128 | $package = 'Interstellar'; |
129 | 129 | break; |
130 | 130 | default: |
131 | - $package = sprintf( '%d-Site License', $response['license_limit'] ); |
|
131 | + $package = sprintf( '%d-Site License', $response[ 'license_limit' ] ); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $data = array( |
135 | 135 | 'email' => GravityView_Settings::getSetting( 'support-email' ), |
136 | - 'name' => $response['customer_name'], |
|
137 | - 'Valid License?' => ucwords( $response['license'] ), |
|
138 | - 'License Key' => $response['license_key'], |
|
136 | + 'name' => $response[ 'customer_name' ], |
|
137 | + 'Valid License?' => ucwords( $response[ 'license' ] ), |
|
138 | + 'License Key' => $response[ 'license_key' ], |
|
139 | 139 | 'License Level' => $package, |
140 | 140 | 'Site Admin Email' => get_bloginfo( 'admin_email' ), |
141 | 141 | 'Support Email' => GravityView_Settings::getSetting( 'support-email' ), |
142 | - 'License Limit' => $response['license_limit'], |
|
143 | - 'Site Count' => $response['site_count'], |
|
144 | - 'License Expires' => $response['expires'], |
|
145 | - 'Activations Left' => $response['activations_left'], |
|
146 | - 'Payment ID' => $response['payment_id'], |
|
147 | - 'Payment Name' => $response['customer_name'], |
|
148 | - 'Payment Email' => $response['customer_email'], |
|
142 | + 'License Limit' => $response[ 'license_limit' ], |
|
143 | + 'Site Count' => $response[ 'site_count' ], |
|
144 | + 'License Expires' => $response[ 'expires' ], |
|
145 | + 'Activations Left' => $response[ 'activations_left' ], |
|
146 | + 'Payment ID' => $response[ 'payment_id' ], |
|
147 | + 'Payment Name' => $response[ 'customer_name' ], |
|
148 | + 'Payment Email' => $response[ 'customer_email' ], |
|
149 | 149 | 'WordPress Version' => get_bloginfo( 'version', 'display' ), |
150 | 150 | 'PHP Version' => phpversion(), |
151 | 151 | 'GravityView Version' => GravityView_Plugin::version, |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | |
193 | 193 | $plugin_data = get_plugin_data( $active_plugin ); |
194 | 194 | |
195 | - $extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] ); |
|
195 | + $extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] ); |
|
196 | 196 | } |
197 | 197 | |
198 | - if( ! empty( $extensions ) ) { |
|
198 | + if ( ! empty( $extensions ) ) { |
|
199 | 199 | set_site_transient( self::related_plugins_key, $extensions, HOUR_IN_SECONDS ); |
200 | 200 | } else { |
201 | 201 | return 'There was an error fetching related plugins.'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 ); |
12 | 12 | |
13 | 13 | // Add script to enable edit link |
14 | - add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script') ); |
|
14 | + add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script' ) ); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function add_edit_script() { |
27 | 27 | |
28 | 28 | // We're on a single entry page, or at least not the Entries page. |
29 | - if( !empty( $_GET['view'] ) && $_GET['view'] !== 'entries' ) { return; } |
|
29 | + if ( ! empty( $_GET[ 'view' ] ) && $_GET[ 'view' ] !== 'entries' ) { return; } |
|
30 | 30 | ?> |
31 | 31 | <script> |
32 | 32 | jQuery( document ).ready( function( $ ) { |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | 'page' => 'gf_entries', |
57 | 57 | 'view' => 'entry', |
58 | 58 | 'id' => (int)$form_id, |
59 | - 'lid' => (int)$lead["id"], |
|
59 | + 'lid' => (int)$lead[ "id" ], |
|
60 | 60 | 'screen_mode' => 'edit', |
61 | 61 | ); |
62 | 62 | ?> |
63 | 63 | |
64 | 64 | <span class="edit edit_entry"> |
65 | 65 | | |
66 | - <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview'); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page='.$query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a> |
|
66 | + <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview' ); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page=' . $query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a> |
|
67 | 67 | </span> |
68 | 68 | <?php |
69 | 69 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @copydoc GravityView_Entry_Link_Shortcode::shortcode |
73 | 73 | */ |
74 | 74 | public function edit_shortcode( $atts, $content = null, $context = 'gv_edit_entry_link' ) { |
75 | - $atts['action'] = 'edit'; |
|
75 | + $atts[ 'action' ] = 'edit'; |
|
76 | 76 | |
77 | 77 | return $this->shortcode( $atts, $content, $context ); |
78 | 78 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @copydoc GravityView_Entry_Link_Shortcode::shortcode |
86 | 86 | */ |
87 | 87 | public function delete_shortcode( $atts, $content = null, $context = 'gv_delete_entry_link' ) { |
88 | - $atts['action'] = 'delete'; |
|
88 | + $atts[ 'action' ] = 'delete'; |
|
89 | 89 | |
90 | 90 | return $this->shortcode( $atts, $content, $context ); |
91 | 91 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $this->settings = shortcode_atts( self::$defaults, $atts, $context ); |
128 | 128 | |
129 | - $this->view_id = empty( $this->settings['view_id'] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings['view_id'] ); |
|
129 | + $this->view_id = empty( $this->settings[ 'view_id' ] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings[ 'view_id' ] ); |
|
130 | 130 | |
131 | 131 | if ( empty( $this->view_id ) ) { |
132 | 132 | do_action( 'gravityview_log_error', __METHOD__ . ' A View ID was not defined and we are not inside a View' ); |
@@ -134,12 +134,12 @@ discard block |
||
134 | 134 | return null; |
135 | 135 | } |
136 | 136 | |
137 | - $this->entry = $this->get_entry( $this->settings['entry_id'] ); |
|
137 | + $this->entry = $this->get_entry( $this->settings[ 'entry_id' ] ); |
|
138 | 138 | |
139 | 139 | do_action( 'gravityview_log_debug', __METHOD__ . ' ' . $context . ' $atts: ', $atts ); |
140 | 140 | |
141 | 141 | if ( ! $this->has_cap() ) { |
142 | - do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the capability to ' . esc_attr( $this->settings['action'] ) . ' this entry: ' . $this->entry['id'] ); |
|
142 | + do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the capability to ' . esc_attr( $this->settings[ 'action' ] ) . ' this entry: ' . $this->entry[ 'id' ] ); |
|
143 | 143 | |
144 | 144 | return null; |
145 | 145 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | // Get just the URL, not the tag |
156 | - if ( 'url' === $this->settings['return'] ) { |
|
156 | + if ( 'url' === $this->settings[ 'return' ] ) { |
|
157 | 157 | return $url; |
158 | 158 | } |
159 | 159 | |
@@ -174,13 +174,13 @@ discard block |
||
174 | 174 | */ |
175 | 175 | private function get_link_atts() { |
176 | 176 | |
177 | - wp_parse_str( $this->settings['link_atts'], $link_atts ); |
|
177 | + wp_parse_str( $this->settings[ 'link_atts' ], $link_atts ); |
|
178 | 178 | |
179 | - if ( 'delete' === $this->settings['action'] ) { |
|
180 | - $link_atts['onclick'] = isset( $link_atts['onclick'] ) ? $link_atts['onclick'] : GravityView_Delete_Entry::get_confirm_dialog(); |
|
179 | + if ( 'delete' === $this->settings[ 'action' ] ) { |
|
180 | + $link_atts[ 'onclick' ] = isset( $link_atts[ 'onclick' ] ) ? $link_atts[ 'onclick' ] : GravityView_Delete_Entry::get_confirm_dialog(); |
|
181 | 181 | } |
182 | 182 | |
183 | - return (array) $link_atts; |
|
183 | + return (array)$link_atts; |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | return $content; |
201 | 201 | } |
202 | 202 | |
203 | - switch ( $this->settings['action'] ) { |
|
203 | + switch ( $this->settings[ 'action' ] ) { |
|
204 | 204 | case 'edit': |
205 | 205 | $anchor_text = __( 'Edit Entry', 'gravityview' ); |
206 | 206 | break; |
@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | private function get_url() { |
229 | 229 | |
230 | 230 | // if post_id is not defined, default to view_id |
231 | - $post_id = empty( $this->settings['post_id'] ) ? $this->view_id : absint( $this->settings['post_id'] ); |
|
231 | + $post_id = empty( $this->settings[ 'post_id' ] ) ? $this->view_id : absint( $this->settings[ 'post_id' ] ); |
|
232 | 232 | |
233 | - switch ( $this->settings['action'] ) { |
|
233 | + switch ( $this->settings[ 'action' ] ) { |
|
234 | 234 | case 'edit': |
235 | 235 | $url = GravityView_Edit_Entry::get_edit_link( $this->entry, $this->view_id, $post_id ); |
236 | 236 | break; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | private function has_cap() { |
257 | 257 | |
258 | - switch ( $this->settings['action'] ) { |
|
258 | + switch ( $this->settings[ 'action' ] ) { |
|
259 | 259 | case 'edit': |
260 | 260 | $has_cap = GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry, $this->view_id ); |
261 | 261 | break; |
@@ -320,9 +320,9 @@ discard block |
||
320 | 320 | */ |
321 | 321 | private function maybe_add_field_values_query_args( $url ) { |
322 | 322 | |
323 | - if ( $url && ! empty( $this->settings['field_values'] ) ) { |
|
323 | + if ( $url && ! empty( $this->settings[ 'field_values' ] ) ) { |
|
324 | 324 | |
325 | - wp_parse_str( $this->settings['field_values'], $field_values ); |
|
325 | + wp_parse_str( $this->settings[ 'field_values' ], $field_values ); |
|
326 | 326 | |
327 | 327 | $url = add_query_arg( $field_values, $url ); |
328 | 328 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | function load() { |
26 | 26 | |
27 | - if( !is_admin() ) { |
|
27 | + if ( ! is_admin() ) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 ); |
39 | 39 | |
40 | 40 | // add tooltips |
41 | - add_filter( 'gravityview_tooltips', array( $this, 'tooltips') ); |
|
41 | + add_filter( 'gravityview_tooltips', array( $this, 'tooltips' ) ); |
|
42 | 42 | |
43 | 43 | // custom fields' options for zone EDIT |
44 | 44 | add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 5 ); |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
54 | 54 | |
55 | - if( $zone !== 'edit' ) { |
|
55 | + if ( $zone !== 'edit' ) { |
|
56 | 56 | |
57 | - $entry_default_fields['edit_link'] = array( |
|
58 | - 'label' => __('Edit Entry', 'gravityview'), |
|
57 | + $entry_default_fields[ 'edit_link' ] = array( |
|
58 | + 'label' => __( 'Edit Entry', 'gravityview' ), |
|
59 | 59 | 'type' => 'edit_link', |
60 | - 'desc' => __('A link to edit the entry. Visible based on View settings.', 'gravityview'), |
|
60 | + 'desc' => __( 'A link to edit the entry. Visible based on View settings.', 'gravityview' ), |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | } |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | $caps = $visibility_caps; |
82 | 82 | |
83 | 83 | // If we're configuring fields in the edit context, we want a limited selection |
84 | - if( $context === 'edit' ) { |
|
84 | + if ( $context === 'edit' ) { |
|
85 | 85 | |
86 | 86 | // Remove other built-in caps. |
87 | - unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] ); |
|
87 | + unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] ); |
|
88 | 88 | |
89 | - $caps['read'] = _x('Entry Creator','User capability', 'gravityview'); |
|
89 | + $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' ); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | return $caps; |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
105 | 105 | |
106 | 106 | // Always a link, never a filter |
107 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
107 | + unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] ); |
|
108 | 108 | |
109 | 109 | // Edit Entry link should only appear to visitors capable of editing entries |
110 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
110 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
111 | 111 | |
112 | - $add_option['edit_link'] = array( |
|
112 | + $add_option[ 'edit_link' ] = array( |
|
113 | 113 | 'type' => 'text', |
114 | 114 | 'label' => __( 'Edit Link Text', 'gravityview' ), |
115 | 115 | 'desc' => NULL, |
116 | - 'value' => __('Edit Entry', 'gravityview'), |
|
116 | + 'value' => __( 'Edit Entry', 'gravityview' ), |
|
117 | 117 | 'merge_tags' => true, |
118 | 118 | ); |
119 | 119 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | |
130 | 130 | $return = $tooltips; |
131 | 131 | |
132 | - $return['allow_edit_cap'] = array( |
|
133 | - 'title' => __('Limiting Edit Access', 'gravityview'), |
|
134 | - 'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'), |
|
132 | + $return[ 'allow_edit_cap' ] = array( |
|
133 | + 'title' => __( 'Limiting Edit Access', 'gravityview' ), |
|
134 | + 'value' => __( 'Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview' ), |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | return $return; |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
150 | 150 | |
151 | 151 | // We only want to modify the settings for the edit context |
152 | - if( 'edit' !== $context ) { |
|
152 | + if ( 'edit' !== $context ) { |
|
153 | 153 | |
154 | 154 | /** |
155 | 155 | * @since 1.8.4 |
156 | 156 | */ |
157 | - $field_options['new_window'] = array( |
|
157 | + $field_options[ 'new_window' ] = array( |
|
158 | 158 | 'type' => 'checkbox', |
159 | 159 | 'label' => __( 'Open link in a new tab or window?', 'gravityview' ), |
160 | 160 | 'value' => false, |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | // Entry field is only for logged in users |
167 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
167 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
168 | 168 | |
169 | 169 | $add_options = array( |
170 | 170 | 'allow_edit_cap' => array( |
@@ -6,17 +6,17 @@ |
||
6 | 6 | ?><script type="text/javascript"> |
7 | 7 | |
8 | 8 | function DeleteFile(leadId, fieldId, deleteButton){ |
9 | - if(confirm('<?php echo esc_js( __("Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview') ); ?>')){ |
|
9 | + if(confirm('<?php echo esc_js( __( "Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview' ) ); ?>')){ |
|
10 | 10 | var fileIndex = jQuery(deleteButton).parent().index(); |
11 | - var mysack = new sack("<?php echo admin_url("admin-ajax.php")?>"); |
|
11 | + var mysack = new sack("<?php echo admin_url( "admin-ajax.php" )?>"); |
|
12 | 12 | mysack.execute = 1; |
13 | 13 | mysack.method = 'POST'; |
14 | 14 | mysack.setVar( "action", "rg_delete_file" ); |
15 | - mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce("rg_delete_file") ?>" ); |
|
15 | + mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce( "rg_delete_file" ) ?>" ); |
|
16 | 16 | mysack.setVar( "lead_id", leadId ); |
17 | 17 | mysack.setVar( "field_id", fieldId ); |
18 | 18 | mysack.setVar( "file_index", fileIndex ); |
19 | - mysack.onError = function() { alert('<?php echo esc_js(__('Ajax error while deleting field.', 'gravityview')) ?>' )}; |
|
19 | + mysack.onError = function() { alert('<?php echo esc_js( __( 'Ajax error while deleting field.', 'gravityview' ) ) ?>' )}; |
|
20 | 20 | mysack.runAJAX(); |
21 | 21 | |
22 | 22 | return true; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | do_action( 'gravityview/edit-entry/publishing-action/before', $object->form, $object->entry, $object->view_id ); |
28 | 28 | |
29 | 29 | ?> |
30 | - <input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" tabindex="4" value="<?php esc_attr_e( 'Update', 'gravityview'); ?>" name="save" /> |
|
30 | + <input id="gform_submit_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" tabindex="4" value="<?php esc_attr_e( 'Update', 'gravityview' ); ?>" name="save" /> |
|
31 | 31 | |
32 | 32 | <a class="btn btn-sm button button-small gv-button-cancel" tabindex="5" href="<?php echo esc_url( $back_link ); ?>"><?php esc_attr_e( 'Cancel', 'gravityview' ); ?></a> |
33 | 33 | <?php |
@@ -43,5 +43,5 @@ discard block |
||
43 | 43 | |
44 | 44 | ?> |
45 | 45 | <input type="hidden" name="action" value="update" /> |
46 | - <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" /> |
|
46 | + <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" /> |
|
47 | 47 | </div> |
@@ -7,13 +7,13 @@ |
||
7 | 7 | extract( $gravityview_view->getCurrentField() ); |
8 | 8 | |
9 | 9 | // Only show the link to logged-in users. |
10 | -if( !GravityView_Edit_Entry::check_user_cap_edit_entry( $entry ) ) { |
|
10 | +if ( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $entry ) ) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
14 | -$link_text = empty( $field_settings['edit_link'] ) ? __('Edit Entry', 'gravityview') : $field_settings['edit_link']; |
|
14 | +$link_text = empty( $field_settings[ 'edit_link' ] ) ? __( 'Edit Entry', 'gravityview' ) : $field_settings[ 'edit_link' ]; |
|
15 | 15 | |
16 | -$link_atts = empty( $field_settings['new_window'] ) ? '' : 'target="_blank"'; |
|
16 | +$link_atts = empty( $field_settings[ 'new_window' ] ) ? '' : 'target="_blank"'; |
|
17 | 17 | |
18 | 18 | $output = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ) ); |
19 | 19 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | self::$file = plugin_dir_path( __FILE__ ); |
38 | 38 | |
39 | - if( is_admin() ) { |
|
39 | + if ( is_admin() ) { |
|
40 | 40 | $this->load_components( 'admin' ); |
41 | 41 | } |
42 | 42 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->load_components( 'render' ); |
45 | 45 | |
46 | 46 | // If GF User Registration Add-on exists |
47 | - if( class_exists( 'GFUser' ) ) { |
|
47 | + if ( class_exists( 'GFUser' ) ) { |
|
48 | 48 | $this->load_components( 'user-registration' ); |
49 | 49 | } |
50 | 50 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | static function getInstance() { |
59 | 59 | |
60 | - if( empty( self::$instance ) ) { |
|
60 | + if ( empty( self::$instance ) ) { |
|
61 | 61 | self::$instance = new GravityView_Edit_Entry; |
62 | 62 | } |
63 | 63 | |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | private function add_hooks() { |
84 | 84 | |
85 | 85 | // Add front-end access to Gravity Forms delete file action |
86 | - add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'RGForms', 'delete_file') ); |
|
86 | + add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'RGForms', 'delete_file' ) ); |
|
87 | 87 | |
88 | 88 | // Make sure this hook is run for non-admins |
89 | - add_action( 'wp_ajax_rg_delete_file', array( 'RGForms', 'delete_file') ); |
|
89 | + add_action( 'wp_ajax_rg_delete_file', array( 'RGForms', 'delete_file' ) ); |
|
90 | 90 | |
91 | 91 | add_filter( 'gravityview_blacklist_field_types', array( $this, 'modify_field_blacklist' ), 10, 2 ); |
92 | 92 | |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | */ |
102 | 102 | private function addon_specific_hooks() { |
103 | 103 | |
104 | - if( class_exists( 'GFSignature' ) && is_callable( array( 'GFSignature', 'get_instance' ) ) ) { |
|
105 | - add_filter('gform_admin_pre_render', array( GFSignature::get_instance(), 'edit_lead_script')); |
|
104 | + if ( class_exists( 'GFSignature' ) && is_callable( array( 'GFSignature', 'get_instance' ) ) ) { |
|
105 | + add_filter( 'gform_admin_pre_render', array( GFSignature::get_instance(), 'edit_lead_script' ) ); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public static function get_edit_link( $entry, $view_id, $post_id = null, $field_values = '' ) { |
150 | 150 | |
151 | - $nonce_key = self::get_nonce_key( $view_id, $entry['form_id'], $entry['id'] ); |
|
151 | + $nonce_key = self::get_nonce_key( $view_id, $entry[ 'form_id' ], $entry[ 'id' ] ); |
|
152 | 152 | |
153 | 153 | $base = gv_entry_link( $entry, $post_id ); |
154 | 154 | |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | * Allow passing params to dynamically populate entry with values |
163 | 163 | * @since 1.9.2 |
164 | 164 | */ |
165 | - if( !empty( $field_values ) ) { |
|
165 | + if ( ! empty( $field_values ) ) { |
|
166 | 166 | |
167 | - if( is_array( $field_values ) ) { |
|
167 | + if ( is_array( $field_values ) ) { |
|
168 | 168 | // If already an array, no parse_str() needed |
169 | 169 | $params = $field_values; |
170 | 170 | } else { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function modify_field_blacklist( $fields = array(), $context = NULL ) { |
188 | 188 | |
189 | - if( empty( $context ) || $context !== 'edit' ) { |
|
189 | + if ( empty( $context ) || $context !== 'edit' ) { |
|
190 | 190 | return $fields; |
191 | 191 | } |
192 | 192 | |
@@ -228,24 +228,24 @@ discard block |
||
228 | 228 | // If they can edit any entries (as defined in Gravity Forms) |
229 | 229 | // Or if they can edit other people's entries |
230 | 230 | // Then we're good. |
231 | - if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry['id'] ) ) { |
|
231 | + if ( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry[ 'id' ] ) ) { |
|
232 | 232 | |
233 | - do_action('gravityview_log_debug', __METHOD__ . ' - User has ability to edit all entries.'); |
|
233 | + do_action( 'gravityview_log_debug', __METHOD__ . ' - User has ability to edit all entries.' ); |
|
234 | 234 | |
235 | 235 | $user_can_edit = true; |
236 | 236 | |
237 | - } else if( !isset( $entry['created_by'] ) ) { |
|
237 | + } else if ( ! isset( $entry[ 'created_by' ] ) ) { |
|
238 | 238 | |
239 | - do_action('gravityview_log_error', 'GravityView_Edit_Entry[check_user_cap_edit_entry] Entry `created_by` doesn\'t exist.'); |
|
239 | + do_action( 'gravityview_log_error', 'GravityView_Edit_Entry[check_user_cap_edit_entry] Entry `created_by` doesn\'t exist.' ); |
|
240 | 240 | |
241 | 241 | $user_can_edit = false; |
242 | 242 | |
243 | 243 | } else { |
244 | 244 | |
245 | 245 | // get user_edit setting |
246 | - if( empty( $view_id ) || $view_id == GravityView_View::getInstance()->getViewId() ) { |
|
246 | + if ( empty( $view_id ) || $view_id == GravityView_View::getInstance()->getViewId() ) { |
|
247 | 247 | // if View ID not specified or is the current view |
248 | - $user_edit = GravityView_View::getInstance()->getAtts('user_edit'); |
|
248 | + $user_edit = GravityView_View::getInstance()->getAtts( 'user_edit' ); |
|
249 | 249 | } else { |
250 | 250 | // in case is specified and not the current view |
251 | 251 | $user_edit = GVCommon::get_template_setting( $view_id, 'user_edit' ); |
@@ -254,21 +254,21 @@ discard block |
||
254 | 254 | $current_user = wp_get_current_user(); |
255 | 255 | |
256 | 256 | // User edit is disabled |
257 | - if( empty( $user_edit ) ) { |
|
257 | + if ( empty( $user_edit ) ) { |
|
258 | 258 | |
259 | - do_action('gravityview_log_debug', 'GravityView_Edit_Entry[check_user_cap_edit_entry] User Edit is disabled. Returning false.' ); |
|
259 | + do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[check_user_cap_edit_entry] User Edit is disabled. Returning false.' ); |
|
260 | 260 | |
261 | 261 | $user_can_edit = false; |
262 | 262 | } |
263 | 263 | |
264 | 264 | // User edit is enabled and the logged-in user is the same as the user who created the entry. We're good. |
265 | - else if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) { |
|
265 | + else if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry[ 'created_by' ] ) ) { |
|
266 | 266 | |
267 | - do_action('gravityview_log_debug', sprintf( 'GravityView_Edit_Entry[check_user_cap_edit_entry] User %s created the entry.', $current_user->ID ) ); |
|
267 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_Edit_Entry[check_user_cap_edit_entry] User %s created the entry.', $current_user->ID ) ); |
|
268 | 268 | |
269 | 269 | $user_can_edit = true; |
270 | 270 | |
271 | - } else if( ! is_user_logged_in() ) { |
|
271 | + } else if ( ! is_user_logged_in() ) { |
|
272 | 272 | |
273 | 273 | do_action( 'gravityview_log_debug', __METHOD__ . ' No user defined; edit entry requires logged in user' ); |
274 | 274 | } |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @since 1.11 |
44 | 44 | * @param boolean $boolean Whether to trigger update on user registration (default: true) |
45 | 45 | */ |
46 | - if( apply_filters( 'gravityview/edit_entry/user_registration/trigger_update', true ) ) { |
|
47 | - add_action( 'gravityview/edit_entry/after_update' , array( $this, 'update_user' ), 10, 2 ); |
|
46 | + if ( apply_filters( 'gravityview/edit_entry/user_registration/trigger_update', true ) ) { |
|
47 | + add_action( 'gravityview/edit_entry/after_update', array( $this, 'update_user' ), 10, 2 ); |
|
48 | 48 | |
49 | 49 | // last resort in case the current user display name don't match any of the defaults |
50 | 50 | add_action( 'gform_user_updated', array( $this, 'restore_display_name' ), 10, 4 ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function update_user( $form = array(), $entry_id = 0 ) { |
64 | 64 | |
65 | - if( !class_exists( 'GFAPI' ) || !class_exists( 'GFUser' ) || empty( $entry_id ) ) { |
|
65 | + if ( ! class_exists( 'GFAPI' ) || ! class_exists( 'GFUser' ) || empty( $entry_id ) ) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
@@ -91,15 +91,15 @@ discard block |
||
91 | 91 | */ |
92 | 92 | $preserve_role = apply_filters( 'gravityview/edit_entry/user_registration/preserve_role', true, $config, $form, $entry ); |
93 | 93 | |
94 | - if( $preserve_role ) { |
|
95 | - $config['meta']['role'] = 'gfur_preserve_role'; |
|
94 | + if ( $preserve_role ) { |
|
95 | + $config[ 'meta' ][ 'role' ] = 'gfur_preserve_role'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Make sure the current display name is not changed with the update user method. |
100 | 100 | * @since 1.15 |
101 | 101 | */ |
102 | - $config['meta']['displayname'] = $this->match_current_display_name( $entry['created_by'] ); |
|
102 | + $config[ 'meta' ][ 'displayname' ] = $this->match_current_display_name( $entry[ 'created_by' ] ); |
|
103 | 103 | |
104 | 104 | |
105 | 105 | /** |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | */ |
112 | 112 | $config = apply_filters( 'gravityview/edit_entry/user_registration/config', $config, $form, $entry ); |
113 | 113 | |
114 | - $is_create_feed = ( $config && rgars( $config, 'meta/feed_type') === 'create' ); |
|
114 | + $is_create_feed = ( $config && rgars( $config, 'meta/feed_type' ) === 'create' ); |
|
115 | 115 | |
116 | 116 | // Only update if it's a create feed |
117 | - if( ! $is_create_feed ) { |
|
117 | + if ( ! $is_create_feed ) { |
|
118 | 118 | return; |
119 | 119 | } |
120 | 120 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | // In case we can't find the current display name format, or it is the 'nickname' format (which Gravity Forms doesn't support) |
150 | 150 | // trigger last resort method at the 'gform_user_updated' hook |
151 | - if( false === $format || 'nickname' === $format ) { |
|
151 | + if ( false === $format || 'nickname' === $format ) { |
|
152 | 152 | $this->_user_before_update = $user; |
153 | 153 | $format = 'nickname'; |
154 | 154 | } |
@@ -168,18 +168,18 @@ discard block |
||
168 | 168 | public function generate_display_names( $profileuser ) { |
169 | 169 | |
170 | 170 | $public_display = array(); |
171 | - $public_display['nickname'] = $profileuser->nickname; |
|
172 | - $public_display['username'] = $profileuser->user_login; |
|
171 | + $public_display[ 'nickname' ] = $profileuser->nickname; |
|
172 | + $public_display[ 'username' ] = $profileuser->user_login; |
|
173 | 173 | |
174 | - if ( !empty($profileuser->first_name) ) |
|
175 | - $public_display['firstname'] = $profileuser->first_name; |
|
174 | + if ( ! empty( $profileuser->first_name ) ) |
|
175 | + $public_display[ 'firstname' ] = $profileuser->first_name; |
|
176 | 176 | |
177 | - if ( !empty($profileuser->last_name) ) |
|
178 | - $public_display['lastname'] = $profileuser->last_name; |
|
177 | + if ( ! empty( $profileuser->last_name ) ) |
|
178 | + $public_display[ 'lastname' ] = $profileuser->last_name; |
|
179 | 179 | |
180 | - if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) { |
|
181 | - $public_display['firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name; |
|
182 | - $public_display['lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name; |
|
180 | + if ( ! empty( $profileuser->first_name ) && ! empty( $profileuser->last_name ) ) { |
|
181 | + $public_display[ 'firstlast' ] = $profileuser->first_name . ' ' . $profileuser->last_name; |
|
182 | + $public_display[ 'lastfirst' ] = $profileuser->last_name . ' ' . $profileuser->first_name; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | $public_display = array_map( 'trim', $public_display ); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | $restore_display_name = apply_filters( 'gravityview/edit_entry/restore_display_name', true ); |
211 | 211 | |
212 | - $is_update_feed = ( $config && rgars( $config, 'meta/feed_type') === 'update' ); |
|
212 | + $is_update_feed = ( $config && rgars( $config, 'meta/feed_type' ) === 'update' ); |
|
213 | 213 | |
214 | 214 | /** |
215 | 215 | * Don't restore display name: |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * - or we don't need as we found the correct format before updating user. |
219 | 219 | * @since 1.14.4 |
220 | 220 | */ |
221 | - if( ! $restore_display_name || $is_update_feed || is_null( $this->_user_before_update ) ) { |
|
221 | + if ( ! $restore_display_name || $is_update_feed || is_null( $this->_user_before_update ) ) { |
|
222 | 222 | return; |
223 | 223 | } |
224 | 224 | |
@@ -244,10 +244,10 @@ discard block |
||
244 | 244 | |
245 | 245 | $updated = wp_update_user( $restored_user ); |
246 | 246 | |
247 | - if( is_wp_error( $updated ) ) { |
|
248 | - do_action('gravityview_log_error', __METHOD__ . sprintf( ' - There was an error updating user #%d details', $user_id ), $updated ); |
|
247 | + if ( is_wp_error( $updated ) ) { |
|
248 | + do_action( 'gravityview_log_error', __METHOD__ . sprintf( ' - There was an error updating user #%d details', $user_id ), $updated ); |
|
249 | 249 | } else { |
250 | - do_action('gravityview_log_debug', __METHOD__ . sprintf( ' - User #%d details restored', $user_id ) ); |
|
250 | + do_action( 'gravityview_log_debug', __METHOD__ . sprintf( ' - User #%d details restored', $user_id ) ); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | $this->_user_before_update = null; |