@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; |
|
59 | + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET[ 'gform_debug' ] ) ? '' : '.min'; |
|
60 | 60 | $locking_path = GFCommon::get_base_url() . '/includes/locking/'; |
61 | 61 | |
62 | 62 | wp_enqueue_script( 'gforms_locking', $locking_path . "js/locking{$min}.js", array( 'jquery', 'heartbeat' ), GFCommon::$version ); |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | $translations = array_map( 'wp_strip_all_tags', $this->get_strings() ); |
66 | 66 | |
67 | 67 | $strings = array( |
68 | - 'noResponse' => $translations['no_response'], |
|
69 | - 'requestAgain' => $translations['request_again'], |
|
70 | - 'requestError' => $translations['request_error'], |
|
71 | - 'gainedControl' => $translations['gained_control'], |
|
72 | - 'rejected' => $translations['request_rejected'], |
|
73 | - 'pending' => $translations['request_pending'], |
|
68 | + 'noResponse' => $translations[ 'no_response' ], |
|
69 | + 'requestAgain' => $translations[ 'request_again' ], |
|
70 | + 'requestError' => $translations[ 'request_error' ], |
|
71 | + 'gainedControl' => $translations[ 'gained_control' ], |
|
72 | + 'rejected' => $translations[ 'request_rejected' ], |
|
73 | + 'pending' => $translations[ 'request_pending' ], |
|
74 | 74 | ); |
75 | 75 | |
76 | - $lock_user_id = $this->check_lock( $entry['id'] ); |
|
76 | + $lock_user_id = $this->check_lock( $entry[ 'id' ] ); |
|
77 | 77 | |
78 | 78 | $vars = array( |
79 | 79 | 'hasLock' => ! $lock_user_id ? 1 : 0, |
80 | 80 | 'lockUI' => $this->get_lock_ui( $lock_user_id ), |
81 | - 'objectID' => $entry['id'], |
|
81 | + 'objectID' => $entry[ 'id' ], |
|
82 | 82 | 'objectType' => 'entry', |
83 | 83 | 'strings' => $strings, |
84 | 84 | ); |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | |
207 | 207 | $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); |
208 | 208 | |
209 | - if ( isset( $_GET['get-edit-lock'] ) ) { |
|
209 | + if ( isset( $_GET[ 'get-edit-lock' ] ) ) { |
|
210 | 210 | $this->set_lock( $entry_id ); |
211 | 211 | echo '<script>window.location = ' . json_encode( remove_query_arg( 'get-edit-lock', $current_url ) ) . ';</script>'; |
212 | 212 | exit(); |
213 | - } else if ( isset( $_GET['release-edit-lock'] ) ) { |
|
213 | + } else if ( isset( $_GET[ 'release-edit-lock' ] ) ) { |
|
214 | 214 | $this->delete_lock_meta( $entry_id ); |
215 | 215 | $current_url = remove_query_arg( 'edit', $current_url ); |
216 | 216 | echo '<script>window.location = ' . json_encode( remove_query_arg( 'release-edit-lock', $current_url ) ) . ';</script>'; |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | |
8 | 8 | function __construct() { |
9 | 9 | |
10 | - add_action( 'gravityview_log_error', array( $this, 'log_error'), 10, 2 ); |
|
10 | + add_action( 'gravityview_log_error', array( $this, 'log_error' ), 10, 2 ); |
|
11 | 11 | |
12 | - add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
|
12 | + add_action( 'gravityview_log_debug', array( $this, 'log_debug' ), 10, 2 ); |
|
13 | 13 | |
14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
15 | 15 | add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | include_once( GRAVITYVIEW_DIR . 'includes/class-debug-bar.php' ); |
35 | 35 | } |
36 | 36 | |
37 | - $panels[] = new GravityView_Debug_Bar; |
|
37 | + $panels[ ] = new GravityView_Debug_Bar; |
|
38 | 38 | |
39 | 39 | return $panels; |
40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param array $supported_plugins List of plugins |
45 | 45 | */ |
46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
47 | + $supported_plugins[ 'gravityview' ] = 'GravityView'; |
|
48 | 48 | return $supported_plugins; |
49 | 49 | } |
50 | 50 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @return string "print_r" or "var_export" |
73 | 73 | */ |
74 | 74 | static function get_print_function() { |
75 | - if( ob_get_level() > 0 ) { |
|
75 | + if ( ob_get_level() > 0 ) { |
|
76 | 76 | $function = 'var_export'; |
77 | 77 | } else { |
78 | 78 | $function = 'print_r'; |
@@ -90,17 +90,17 @@ discard block |
||
90 | 90 | 'data' => $data, |
91 | 91 | ); |
92 | 92 | |
93 | - if( !in_array( $notice, self::$notices ) ) { |
|
94 | - self::$notices[] = $notice; |
|
93 | + if ( ! in_array( $notice, self::$notices ) ) { |
|
94 | + self::$notices[ ] = $notice; |
|
95 | 95 | } |
96 | 96 | |
97 | - if ( class_exists("GFLogging") ) { |
|
97 | + if ( class_exists( "GFLogging" ) ) { |
|
98 | 98 | GFLogging::include_logger(); |
99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $data, true ), KLogger::DEBUG ); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - static function log_error( $message = '', $data = null ) { |
|
103 | + static function log_error( $message = '', $data = null ) { |
|
104 | 104 | |
105 | 105 | $function = self::get_print_function(); |
106 | 106 | |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | 'backtrace' => function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) : '', |
111 | 111 | ); |
112 | 112 | |
113 | - if( !in_array( $error, self::$errors ) ) { |
|
114 | - self::$errors[] = $error; |
|
113 | + if ( ! in_array( $error, self::$errors ) ) { |
|
114 | + self::$errors[ ] = $error; |
|
115 | 115 | } |
116 | 116 | |
117 | - if ( class_exists("GFLogging") ) { |
|
117 | + if ( class_exists( "GFLogging" ) ) { |
|
118 | 118 | GFLogging::include_logger(); |
119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
119 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $error, true ), KLogger::ERROR ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | static function is_logging_active( $plugin = 'gravityview' ) { |
135 | 135 | |
136 | - if( ! class_exists( 'GFLogging') ) { |
|
136 | + if ( ! class_exists( 'GFLogging' ) ) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public static function get_duplicate_link( $entry, $view_id, $post_id = null ) { |
248 | 248 | |
249 | - $base = GravityView_API::directory_link( $post_id ? : $view_id, true ); |
|
249 | + $base = GravityView_API::directory_link( $post_id ? : $view_id, true ); |
|
250 | 250 | |
251 | 251 | if ( empty( $base ) ) { |
252 | 252 | gravityview()->log->error( 'Post ID does not exist: {post_id}', array( 'post_id' => $post_id ) ); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | 'action' => 'duplicate', |
258 | 258 | 'entry_id' => $entry['id'], |
259 | 259 | 'gvid' => $view_id, |
260 | - 'view_id' => $view_id, |
|
260 | + 'view_id' => $view_id, |
|
261 | 261 | ), $base ); |
262 | 262 | |
263 | 263 | return add_query_arg( 'duplicate', wp_create_nonce( self::get_nonce_key( $entry['id'] ) ), $actionurl ); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | * @since 2.5 |
461 | 461 | * @param array $duplicated_entry The duplicated entry |
462 | 462 | * @param array $entry The original entry |
463 | - */ |
|
463 | + */ |
|
464 | 464 | do_action( 'gravityview/duplicate-entry/duplicated', $duplicated_entry, $entry ); |
465 | 465 | |
466 | 466 | gravityview()->log->debug( 'Duplicate response: {duplicate_response}', array( 'duplicate_response' => $duplicate_response ) ); |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | public function duplicate_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
116 | 116 | |
117 | 117 | // Always a link, never a filter, always same window |
118 | - unset( $field_options['show_as_link'], $field_options['search_filter'], $field_options['new_window'] ); |
|
118 | + unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ], $field_options[ 'new_window' ] ); |
|
119 | 119 | |
120 | 120 | // Duplicate Entry link should only appear to visitors capable of editing entries |
121 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
121 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
122 | 122 | |
123 | - $add_option['duplicate_link'] = array( |
|
123 | + $add_option[ 'duplicate_link' ] = array( |
|
124 | 124 | 'type' => 'text', |
125 | 125 | 'label' => __( 'Duplicate Link Text', 'gravityview' ), |
126 | 126 | 'desc' => NULL, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'merge_tags' => true, |
129 | 129 | ); |
130 | 130 | |
131 | - $field_options['allow_duplicate_cap'] = array( |
|
131 | + $field_options[ 'allow_duplicate_cap' ] = array( |
|
132 | 132 | 'type' => 'select', |
133 | 133 | 'label' => __( 'Allow the following users to duplicate the entry:', 'gravityview' ), |
134 | 134 | 'choices' => GravityView_Render_Settings::get_cap_choices( $template_id, $field_id, $context, $input_type ), |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
156 | 156 | |
157 | 157 | if ( 'edit' !== $zone ) { |
158 | - $entry_default_fields['duplicate_link'] = array( |
|
158 | + $entry_default_fields[ 'duplicate_link' ] = array( |
|
159 | 159 | 'label' => __( 'Duplicate Entry', 'gravityview' ), |
160 | 160 | 'type' => 'duplicate_link', |
161 | 161 | 'desc' => __( 'A link to duplicate the entry. Respects the Duplicate Entry permissions.', 'gravityview' ), |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function add_available_field( $available_fields = array() ) { |
178 | 178 | |
179 | - $available_fields['duplicate_link'] = array( |
|
179 | + $available_fields[ 'duplicate_link' ] = array( |
|
180 | 180 | 'label_text' => __( 'Duplicate Entry', 'gravityview' ), |
181 | 181 | 'field_id' => 'duplicate_link', |
182 | 182 | 'label_type' => 'field', |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | if ( 'duplicate_link' === $field_id ) { |
210 | 210 | |
211 | 211 | // Remove other built-in caps. |
212 | - unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['duplicate_others_posts'] ); |
|
212 | + unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'duplicate_others_posts' ] ); |
|
213 | 213 | |
214 | - $caps['read'] = _x( 'Entry Creator', 'User capability', 'gravityview' ); |
|
214 | + $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' ); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | return $caps; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public static function get_duplicate_link( $entry, $view_id, $post_id = null ) { |
248 | 248 | |
249 | - $base = GravityView_API::directory_link( $post_id ? : $view_id, true ); |
|
249 | + $base = GravityView_API::directory_link( $post_id ?: $view_id, true ); |
|
250 | 250 | |
251 | 251 | if ( empty( $base ) ) { |
252 | 252 | gravityview()->log->error( 'Post ID does not exist: {post_id}', array( 'post_id' => $post_id ) ); |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | |
256 | 256 | $actionurl = add_query_arg( array( |
257 | 257 | 'action' => 'duplicate', |
258 | - 'entry_id' => $entry['id'], |
|
258 | + 'entry_id' => $entry[ 'id' ], |
|
259 | 259 | 'gvid' => $view_id, |
260 | 260 | 'view_id' => $view_id, |
261 | 261 | ), $base ); |
262 | 262 | |
263 | - return add_query_arg( 'duplicate', wp_create_nonce( self::get_nonce_key( $entry['id'] ) ), $actionurl ); |
|
263 | + return add_query_arg( 'duplicate', wp_create_nonce( self::get_nonce_key( $entry[ 'id' ] ) ), $actionurl ); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | public function process_duplicate() { |
282 | 282 | |
283 | 283 | // If the form is submitted |
284 | - if ( ! isset( $_GET['action'] ) || 'duplicate' !== $_GET['action'] || ! isset( $_GET['entry_id'] ) ) { |
|
284 | + if ( ! isset( $_GET[ 'action' ] ) || 'duplicate' !== $_GET[ 'action' ] || ! isset( $_GET[ 'entry_id' ] ) ) { |
|
285 | 285 | return; |
286 | 286 | } |
287 | 287 | |
288 | 288 | // Make sure it's a GravityView request |
289 | - $valid_nonce_key = wp_verify_nonce( \GV\Utils::_GET( 'duplicate' ), self::get_nonce_key( $_GET['entry_id'] ) ); |
|
289 | + $valid_nonce_key = wp_verify_nonce( \GV\Utils::_GET( 'duplicate' ), self::get_nonce_key( $_GET[ 'entry_id' ] ) ); |
|
290 | 290 | |
291 | 291 | if ( ! $valid_nonce_key ) { |
292 | 292 | gravityview()->log->debug( 'Duplicate entry not processed: nonce validation failed.' ); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | // Get the entry slug |
297 | - $entry_slug = esc_attr( $_GET['entry_id'] ); |
|
297 | + $entry_slug = esc_attr( $_GET[ 'entry_id' ] ); |
|
298 | 298 | |
299 | 299 | // See if there's an entry there |
300 | 300 | $entry = gravityview_get_entry( $entry_slug, true, false ); |
@@ -388,15 +388,15 @@ discard block |
||
388 | 388 | return new WP_Error( 'gravityview-duplicate-entry-missing', __( 'The entry does not exist.', 'gravityview' ) ); |
389 | 389 | } |
390 | 390 | |
391 | - $row['id'] = null; |
|
392 | - $row['date_created'] = date( 'Y-m-d H:i:s', time() ); |
|
393 | - $row['date_updated'] = $row['date_created']; |
|
394 | - $row['is_starred'] = false; |
|
395 | - $row['is_read'] = false; |
|
396 | - $row['ip'] = GFFormsModel::get_ip(); |
|
397 | - $row['source_url'] = esc_url_raw( remove_query_arg( array( 'action', 'gvid' ) ) ); |
|
398 | - $row['user_agent'] = \GV\Utils::_SERVER( 'HTTP_USER_AGENT' ); |
|
399 | - $row['created_by'] = wp_get_current_user()->ID; |
|
391 | + $row[ 'id' ] = null; |
|
392 | + $row[ 'date_created' ] = date( 'Y-m-d H:i:s', time() ); |
|
393 | + $row[ 'date_updated' ] = $row[ 'date_created' ]; |
|
394 | + $row[ 'is_starred' ] = false; |
|
395 | + $row[ 'is_read' ] = false; |
|
396 | + $row[ 'ip' ] = GFFormsModel::get_ip(); |
|
397 | + $row[ 'source_url' ] = esc_url_raw( remove_query_arg( array( 'action', 'gvid' ) ) ); |
|
398 | + $row[ 'user_agent' ] = \GV\Utils::_SERVER( 'HTTP_USER_AGENT' ); |
|
399 | + $row[ 'created_by' ] = wp_get_current_user()->ID; |
|
400 | 400 | |
401 | 401 | /** |
402 | 402 | * @filter `gravityview/entry/duplicate/details` Modify the new entry details before it's created. |
@@ -424,15 +424,15 @@ discard block |
||
424 | 424 | |
425 | 425 | $save_this_meta = array(); |
426 | 426 | foreach ( $duplicate_meta->get_output() as $m ) { |
427 | - $save_this_meta[] = array( |
|
428 | - 'meta_key' => $m['meta_key'], |
|
429 | - 'meta_value' => $m['meta_value'], |
|
430 | - 'item_index' => $m['item_index'], |
|
427 | + $save_this_meta[ ] = array( |
|
428 | + 'meta_key' => $m[ 'meta_key' ], |
|
429 | + 'meta_value' => $m[ 'meta_value' ], |
|
430 | + 'item_index' => $m[ 'item_index' ], |
|
431 | 431 | ); |
432 | 432 | } |
433 | 433 | |
434 | 434 | // Update the row ID for later usage |
435 | - $row['id'] = $duplicated_id; |
|
435 | + $row[ 'id' ] = $duplicated_id; |
|
436 | 436 | |
437 | 437 | /** |
438 | 438 | * @filter `gravityview/entry/duplicate/meta` Modify the new entry meta details. |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | $save_this_meta = apply_filters( 'gravityview/entry/duplicate/meta', $save_this_meta, $row, $entry ); |
444 | 444 | |
445 | 445 | foreach ( $save_this_meta as $data ) { |
446 | - $data['form_id'] = $entry['form_id']; |
|
447 | - $data['entry_id'] = $duplicated_id; |
|
446 | + $data[ 'form_id' ] = $entry[ 'form_id' ]; |
|
447 | + $data[ 'entry_id' ] = $duplicated_id; |
|
448 | 448 | |
449 | 449 | if ( ! $wpdb->insert( $entry_meta_table, $data ) ) { |
450 | 450 | return new WP_Error( 'gravityview-duplicate-entry-db-meta', __( 'There was an error duplicating the entry.', 'gravityview' ) ); |
@@ -478,13 +478,13 @@ discard block |
||
478 | 478 | public function verify_nonce() { |
479 | 479 | |
480 | 480 | // No duplicate entry request was made |
481 | - if ( empty( $_GET['entry_id'] ) || empty( $_GET['duplicate'] ) ) { |
|
481 | + if ( empty( $_GET[ 'entry_id' ] ) || empty( $_GET[ 'duplicate' ] ) ) { |
|
482 | 482 | return false; |
483 | 483 | } |
484 | 484 | |
485 | - $nonce_key = self::get_nonce_key( $_GET['entry_id'] ); |
|
485 | + $nonce_key = self::get_nonce_key( $_GET[ 'entry_id' ] ); |
|
486 | 486 | |
487 | - $valid = wp_verify_nonce( $_GET['duplicate'], $nonce_key ); |
|
487 | + $valid = wp_verify_nonce( $_GET[ 'duplicate' ], $nonce_key ); |
|
488 | 488 | |
489 | 489 | /** |
490 | 490 | * @filter `gravityview/duplicate-entry/verify_nonce` Override Duplicate Entry nonce validation. Return true to declare nonce valid. |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | return ''; |
521 | 521 | } |
522 | 522 | |
523 | - return 'return window.confirm(\''. esc_js( $confirm ) .'\');'; |
|
523 | + return 'return window.confirm(\'' . esc_js( $confirm ) . '\');'; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | /** |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | public static function check_user_cap_duplicate_entry( $entry, $field = array(), $view_id = 0 ) { |
575 | 575 | $current_user = wp_get_current_user(); |
576 | 576 | |
577 | - $entry_id = isset( $entry['id'] ) ? $entry['id'] : null; |
|
577 | + $entry_id = isset( $entry[ 'id' ] ) ? $entry[ 'id' ] : null; |
|
578 | 578 | |
579 | 579 | // Or if they can duplicate any entries (as defined in Gravity Forms), we're good. |
580 | 580 | if ( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gform_full_access', 'gravityview_full_access' ), $entry_id ) ) { |
@@ -589,17 +589,17 @@ discard block |
||
589 | 589 | if ( ! empty( $field ) ) { |
590 | 590 | |
591 | 591 | // If capability is not defined, something is not right! |
592 | - if ( empty( $field['allow_duplicate_cap'] ) ) { |
|
592 | + if ( empty( $field[ 'allow_duplicate_cap' ] ) ) { |
|
593 | 593 | |
594 | 594 | gravityview()->log->error( 'Cannot read duplicate entry field caps', array( 'data' => $field ) ); |
595 | 595 | |
596 | 596 | return false; |
597 | 597 | } |
598 | 598 | |
599 | - if ( GVCommon::has_cap( $field['allow_duplicate_cap'] ) ) { |
|
599 | + if ( GVCommon::has_cap( $field[ 'allow_duplicate_cap' ] ) ) { |
|
600 | 600 | |
601 | 601 | // Do not return true if cap is read, as we need to check if the current user created the entry |
602 | - if ( 'read' !== $field['allow_duplicate_cap'] ) { |
|
602 | + if ( 'read' !== $field[ 'allow_duplicate_cap' ] ) { |
|
603 | 603 | return true; |
604 | 604 | } |
605 | 605 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | |
613 | 613 | } |
614 | 614 | |
615 | - if ( ! isset( $entry['created_by'] ) ) { |
|
615 | + if ( ! isset( $entry[ 'created_by' ] ) ) { |
|
616 | 616 | |
617 | 617 | gravityview()->log->error( 'Cannot duplicate entry; entry `created_by` doesn\'t exist.' ); |
618 | 618 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | } |
638 | 638 | |
639 | 639 | // If the logged-in user is the same as the user who created the entry, we're good. |
640 | - if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) { |
|
640 | + if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry[ 'created_by' ] ) ) { |
|
641 | 641 | |
642 | 642 | gravityview()->log->debug( 'User {user_id} created the entry.', array( 'user_id' => $current_user->ID ) ); |
643 | 643 | |
@@ -662,16 +662,16 @@ discard block |
||
662 | 662 | */ |
663 | 663 | public function display_message( $current_view_id = 0 ) { |
664 | 664 | |
665 | - if ( empty( $_GET['status'] ) || ! self::verify_nonce() ) { |
|
665 | + if ( empty( $_GET[ 'status' ] ) || ! self::verify_nonce() ) { |
|
666 | 666 | return; |
667 | 667 | } |
668 | 668 | |
669 | 669 | // Entry wasn't duplicated from current View |
670 | - if ( isset( $_GET['view_id'] ) && ( intval( $_GET['view_id'] ) !== intval( $current_view_id ) ) ) { |
|
670 | + if ( isset( $_GET[ 'view_id' ] ) && ( intval( $_GET[ 'view_id' ] ) !== intval( $current_view_id ) ) ) { |
|
671 | 671 | return; |
672 | 672 | } |
673 | 673 | |
674 | - $status = esc_attr( $_GET['status'] ); |
|
674 | + $status = esc_attr( $_GET[ 'status' ] ); |
|
675 | 675 | $message_from_url = \GV\Utils::_GET( 'message' ); |
676 | 676 | $message_from_url = rawurldecode( stripslashes_deep( $message_from_url ) ); |
677 | 677 | $class = ''; |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | $message = apply_filters( 'gravityview/duplicate-entry/message', esc_attr( $message ), $status, $message_from_url ); |
698 | 698 | |
699 | 699 | // DISPLAY ERROR/SUCCESS MESSAGE |
700 | - echo '<div class="gv-notice' . esc_attr( $class ) .'">'. $message .'</div>'; |
|
700 | + echo '<div class="gv-notice' . esc_attr( $class ) . '">' . $message . '</div>'; |
|
701 | 701 | } |
702 | 702 | |
703 | 703 | /** |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | ?> |
726 | 726 | <span class="duplicate"> |
727 | 727 | | |
728 | - <a href="<?php echo wp_nonce_url( add_query_arg( 'entry_id', $entry['id'] ), self::get_nonce_key( $entry['id'] ), 'duplicate' ); ?>"><?php esc_html_e( 'Duplicate', 'gravityview' ); ?></a> |
|
728 | + <a href="<?php echo wp_nonce_url( add_query_arg( 'entry_id', $entry[ 'id' ] ), self::get_nonce_key( $entry[ 'id' ] ), 'duplicate' ); ?>"><?php esc_html_e( 'Duplicate', 'gravityview' ); ?></a> |
|
729 | 729 | </span> |
730 | 730 | <?php |
731 | 731 | } |
@@ -747,9 +747,9 @@ discard block |
||
747 | 747 | |
748 | 748 | if ( 'success' === \GV\Utils::_GET( 'result' ) ) { |
749 | 749 | add_filter( 'gform_admin_messages', function( $messages ) { |
750 | - $messages = (array) $messages; |
|
750 | + $messages = (array)$messages; |
|
751 | 751 | |
752 | - $messages[] = esc_html__( 'Entry duplicated.', 'gravityview' ); |
|
752 | + $messages[ ] = esc_html__( 'Entry duplicated.', 'gravityview' ); |
|
753 | 753 | return $messages; |
754 | 754 | } ); |
755 | 755 | } |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | |
761 | 761 | $check_logs_message = ''; |
762 | 762 | |
763 | - if( $is_logging_active ) { |
|
763 | + if ( $is_logging_active ) { |
|
764 | 764 | $check_logs_message = sprintf( ' <a href="%s">%s</a>', |
765 | 765 | esc_url( admin_url( 'admin.php?page=gf_settings&subview=gravityformslogging' ) ), |
766 | 766 | esc_html_x( 'Check the GravityView logs for more information.', 'Error message links to logging page', 'gravityview' ) |
@@ -768,9 +768,9 @@ discard block |
||
768 | 768 | } |
769 | 769 | |
770 | 770 | add_filter( 'gform_admin_error_messages', function( $messages ) use ( $check_logs_message ) { |
771 | - $messages = (array) $messages; |
|
771 | + $messages = (array)$messages; |
|
772 | 772 | |
773 | - $messages[] = esc_html__( 'There was an error duplicating the entry.', 'gravityview' ) . $check_logs_message; |
|
773 | + $messages[ ] = esc_html__( 'There was an error duplicating the entry.', 'gravityview' ) . $check_logs_message; |
|
774 | 774 | |
775 | 775 | return $messages; |
776 | 776 | } ); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | $url = add_query_arg( array( |
71 | 71 | 'utm_source' => 'powered_by', |
72 | - 'utm_term' => get_bloginfo('name' ), |
|
72 | + 'utm_term' => get_bloginfo('name' ), |
|
73 | 73 | ), $url ); |
74 | 74 | |
75 | 75 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $powered_by = gravityview()->plugin->settings->get( 'powered_by', '0' ); |
34 | 34 | |
35 | - if( empty( $powered_by ) ) { |
|
35 | + if ( empty( $powered_by ) ) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected function get_url() { |
61 | 61 | |
62 | - $url = sprintf( self::url, get_bloginfo('name' ) ); |
|
62 | + $url = sprintf( self::url, get_bloginfo( 'name' ) ); |
|
63 | 63 | |
64 | 64 | $affiliate_id = gravityview()->plugin->settings->get( 'affiliate_id', '' ); |
65 | 65 | |
66 | - if( $affiliate_id && is_numeric( $affiliate_id ) ) { |
|
66 | + if ( $affiliate_id && is_numeric( $affiliate_id ) ) { |
|
67 | 67 | $url = add_query_arg( array( 'ref' => $affiliate_id ), $url ); |
68 | 68 | } |
69 | 69 | |
70 | 70 | $url = add_query_arg( array( |
71 | 71 | 'utm_source' => 'powered_by', |
72 | - 'utm_term' => get_bloginfo('name' ), |
|
72 | + 'utm_term' => get_bloginfo( 'name' ), |
|
73 | 73 | ), $url ); |
74 | 74 | |
75 | 75 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return array |
103 | 103 | */ |
104 | 104 | public function modify_app_settings_menu_title( $setting_tabs ) { |
105 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
105 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
106 | 106 | return $setting_tabs; |
107 | 107 | } |
108 | 108 | |
@@ -308,15 +308,15 @@ discard block |
||
308 | 308 | </ul> |
309 | 309 | <div class="gv-followup widefat"> |
310 | 310 | <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p> |
311 | - <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea> |
|
311 | + <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea> |
|
312 | 312 | </div> |
313 | 313 | <div class="scale-description"> |
314 | 314 | <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
315 | 315 | <ul class="inline"> |
316 | 316 | <?php |
317 | 317 | $i = 0; |
318 | - while( $i < 11 ) { |
|
319 | - echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>'; |
|
318 | + while ( $i < 11 ) { |
|
319 | + echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
|
320 | 320 | $i++; |
321 | 321 | } |
322 | 322 | ?> |
@@ -539,15 +539,15 @@ discard block |
||
539 | 539 | * @return string The HTML |
540 | 540 | */ |
541 | 541 | public function as_html( $field, $echo = true ) { |
542 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit'; |
|
542 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
543 | 543 | |
544 | 544 | $attributes = $this->get_field_attributes( $field ); |
545 | 545 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
546 | - $value = $this->get( $field['name'], $default_value ); |
|
546 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
547 | 547 | |
548 | 548 | |
549 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
550 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
549 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
550 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
551 | 551 | |
552 | 552 | if ( empty( $value ) ) { |
553 | 553 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | $attributes = $this->get_field_attributes( $field ); |
557 | 557 | |
558 | 558 | $html = '<input |
559 | - type="' . $field['type'] . '" |
|
559 | + type="' . $field[ 'type' ] . '" |
|
560 | 560 | name="' . esc_attr( $name ) . '" |
561 | 561 | value="' . $value . '" ' . |
562 | 562 | implode( ' ', $attributes ) . |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | * @return bool |
588 | 588 | */ |
589 | 589 | public function is_save_postback() { |
590 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
590 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | */ |
598 | 598 | public function license_key_notice() { |
599 | 599 | |
600 | - if( $this->is_save_postback() ) { |
|
600 | + if ( $this->is_save_postback() ) { |
|
601 | 601 | $settings = $this->get_posted_settings(); |
602 | 602 | $license_key = \GV\Utils::get( $settings, 'license_key' ); |
603 | 603 | $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | * but didn't want to mess up the translation strings for the translators. |
619 | 619 | */ |
620 | 620 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
621 | - $title = __( 'Inactive License', 'gravityview'); |
|
621 | + $title = __( 'Inactive License', 'gravityview' ); |
|
622 | 622 | $status = ''; |
623 | 623 | $update_below = false; |
624 | 624 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | $update_below = __( 'Activate your license key below.', 'gravityview' ); |
649 | 649 | break; |
650 | 650 | } |
651 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
651 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
652 | 652 | |
653 | 653 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
654 | 654 | if ( $update_below && gravityview()->request->is_admin( '', 'settings' ) ) { |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | public function scripts() { |
693 | 693 | $scripts = parent::scripts(); |
694 | 694 | |
695 | - $scripts[] = array( |
|
695 | + $scripts[ ] = array( |
|
696 | 696 | 'handle' => 'gform_tooltip_init', |
697 | 697 | 'enqueue' => array( |
698 | 698 | array( |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | public function styles() { |
712 | 712 | $styles = parent::styles(); |
713 | 713 | |
714 | - $styles[] = array( |
|
714 | + $styles[ ] = array( |
|
715 | 715 | 'handle' => 'gravityview_settings', |
716 | 716 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
717 | 717 | 'version' => Plugin::$version, |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | * If multisite and not network admin, we don't want the settings to show. |
743 | 743 | * @since 1.7.6 |
744 | 744 | */ |
745 | - $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
745 | + $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
746 | 746 | |
747 | 747 | /** |
748 | 748 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -790,26 +790,26 @@ discard block |
||
790 | 790 | 'label' => __( 'License Key', 'gravityview' ), |
791 | 791 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ), |
792 | 792 | 'type' => 'edd_license', |
793 | - 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
793 | + 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
794 | 794 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
795 | - 'default_value' => $default_settings['license_key'], |
|
795 | + 'default_value' => $default_settings[ 'license_key' ], |
|
796 | 796 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
797 | 797 | ), |
798 | 798 | array( |
799 | 799 | 'name' => 'license_key_response', |
800 | - 'default_value' => $default_settings['license_key_response'], |
|
800 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
801 | 801 | 'type' => 'hidden', |
802 | 802 | ), |
803 | 803 | array( |
804 | 804 | 'name' => 'license_key_status', |
805 | - 'default_value' => $default_settings['license_key_status'], |
|
805 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
806 | 806 | 'type' => 'hidden', |
807 | 807 | ), |
808 | 808 | array( |
809 | 809 | 'name' => 'support-email', |
810 | 810 | 'type' => 'text', |
811 | 811 | 'validate' => 'email', |
812 | - 'default_value' => $default_settings['support-email'], |
|
812 | + 'default_value' => $default_settings[ 'support-email' ], |
|
813 | 813 | 'label' => __( 'Support Email', 'gravityview' ), |
814 | 814 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
815 | 815 | 'class' => 'code regular-text', |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | 'name' => 'support_port', |
822 | 822 | 'type' => 'radio', |
823 | 823 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
824 | - 'default_value' => $default_settings['support_port'], |
|
824 | + 'default_value' => $default_settings[ 'support_port' ], |
|
825 | 825 | 'horizontal' => 1, |
826 | 826 | 'choices' => array( |
827 | 827 | array( |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | 'name' => 'no-conflict-mode', |
841 | 841 | 'type' => 'radio', |
842 | 842 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
843 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
843 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
844 | 844 | 'horizontal' => 1, |
845 | 845 | 'choices' => array( |
846 | 846 | array( |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | 'name' => 'rest_api', |
863 | 863 | 'type' => 'radio', |
864 | 864 | 'label' => __( 'REST API', 'gravityview' ), |
865 | - 'default_value' => $default_settings['rest_api'], |
|
865 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
866 | 866 | 'horizontal' => 1, |
867 | 867 | 'choices' => array( |
868 | 868 | array( |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | 'name' => 'beta', |
882 | 882 | 'type' => 'checkbox', |
883 | 883 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
884 | - 'default_value' => $default_settings['beta'], |
|
884 | + 'default_value' => $default_settings[ 'beta' ], |
|
885 | 885 | 'horizontal' => 1, |
886 | 886 | 'choices' => array( |
887 | 887 | array( |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | 'name' => 'powered_by', |
897 | 897 | 'type' => 'checkbox', |
898 | 898 | 'label' => __( 'Display "Powered By" Link', 'gravityview' ), |
899 | - 'default_value' => $default_settings['powered_by'], |
|
899 | + 'default_value' => $default_settings[ 'powered_by' ], |
|
900 | 900 | 'horizontal' => 1, |
901 | 901 | 'choices' => array( |
902 | 902 | array( |
@@ -939,17 +939,17 @@ discard block |
||
939 | 939 | * @since 1.7.4 |
940 | 940 | */ |
941 | 941 | foreach ( $fields as &$field ) { |
942 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
943 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
944 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
945 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
942 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
943 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
944 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
945 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
946 | 946 | |
947 | 947 | if ( $disabled_attribute ) { |
948 | - $field['disabled'] = $disabled_attribute; |
|
948 | + $field[ 'disabled' ] = $disabled_attribute; |
|
949 | 949 | } |
950 | 950 | |
951 | - if ( empty( $field['disabled'] ) ) { |
|
952 | - unset( $field['disabled'] ); |
|
951 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
952 | + unset( $field[ 'disabled' ] ); |
|
953 | 953 | } |
954 | 954 | } |
955 | 955 | |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | ); |
968 | 968 | |
969 | 969 | if ( $disabled_attribute ) { |
970 | - $button['disabled'] = $disabled_attribute; |
|
970 | + $button[ 'disabled' ] = $disabled_attribute; |
|
971 | 971 | } |
972 | 972 | |
973 | 973 | /** |
@@ -986,20 +986,20 @@ discard block |
||
986 | 986 | // If there are extensions, add a section for them |
987 | 987 | if ( ! empty( $extension_sections ) ) { |
988 | 988 | |
989 | - if( $disabled_attribute ) { |
|
989 | + if ( $disabled_attribute ) { |
|
990 | 990 | foreach ( $extension_sections as &$section ) { |
991 | - foreach ( $section['fields'] as &$field ) { |
|
992 | - $field['disabled'] = $disabled_attribute; |
|
991 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
992 | + $field[ 'disabled' ] = $disabled_attribute; |
|
993 | 993 | } |
994 | 994 | } |
995 | 995 | } |
996 | 996 | |
997 | - $k = count( $extension_sections ) - 1 ; |
|
998 | - $extension_sections[ $k ]['fields'][] = $button; |
|
997 | + $k = count( $extension_sections ) - 1; |
|
998 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
999 | 999 | $sections = array_merge( $sections, $extension_sections ); |
1000 | 1000 | } else { |
1001 | 1001 | // add the 'update settings' button to the general section |
1002 | - $sections[0]['fields'][] = $button; |
|
1002 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | return $sections; |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | protected function settings_edd_license( $field, $echo = true ) { |
1056 | 1056 | |
1057 | 1057 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
1058 | - $field['input_type'] = 'password'; |
|
1058 | + $field[ 'input_type' ] = 'password'; |
|
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | $text = $this->settings_text( $field, false ); |
@@ -1104,7 +1104,7 @@ discard block |
||
1104 | 1104 | public function single_setting_row_html( $field ) { |
1105 | 1105 | ?> |
1106 | 1106 | |
1107 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
1107 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
1108 | 1108 | <td colspan="2"> |
1109 | 1109 | <?php $this->single_setting( $field ); ?> |
1110 | 1110 | </td> |
@@ -1122,10 +1122,10 @@ discard block |
||
1122 | 1122 | * @return string |
1123 | 1123 | */ |
1124 | 1124 | public function settings_save( $field, $echo = true ) { |
1125 | - $field['type'] = 'submit'; |
|
1126 | - $field['name'] = 'gform-settings-save'; |
|
1127 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
1128 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
1125 | + $field[ 'type' ] = 'submit'; |
|
1126 | + $field[ 'name' ] = 'gform-settings-save'; |
|
1127 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
1128 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
1129 | 1129 | |
1130 | 1130 | $output = $this->settings_submit( $field, false ); |
1131 | 1131 | |
@@ -1156,8 +1156,8 @@ discard block |
||
1156 | 1156 | * @return void |
1157 | 1157 | */ |
1158 | 1158 | public function single_setting_row( $field ) { |
1159 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
1160 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
1159 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
1160 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
1161 | 1161 | parent::single_setting_row( $field ); |
1162 | 1162 | } |
1163 | 1163 | |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | public function single_setting_label( $field ) { |
1170 | 1170 | parent::single_setting_label( $field ); |
1171 | 1171 | if ( $description = Utils::get( $field, 'gv_description' ) ) { |
1172 | - echo '<span class="description">'. $description .'</span>'; |
|
1172 | + echo '<span class="description">' . $description . '</span>'; |
|
1173 | 1173 | } |
1174 | 1174 | } |
1175 | 1175 | |
@@ -1206,9 +1206,9 @@ discard block |
||
1206 | 1206 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
1207 | 1207 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
1208 | 1208 | if ( $local_key !== $response_key ) { |
1209 | - unset( $posted_settings['license_key_response'] ); |
|
1210 | - unset( $posted_settings['license_key_status'] ); |
|
1211 | - \GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
1209 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
1210 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
1211 | + \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
1212 | 1212 | } |
1213 | 1213 | return $posted_settings; |
1214 | 1214 | } |