@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function if_gravityview_return_true( $has_content = false ) { |
52 | 52 | |
53 | - if( ! class_exists( 'GravityView_frontend' ) ) { |
|
53 | + if ( ! class_exists( 'GravityView_frontend' ) ) { |
|
54 | 54 | return $has_content; |
55 | 55 | } |
56 | 56 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if( ! class_exists('GFAddOn') ) { |
|
3 | +if ( ! class_exists( 'GFAddOn' ) ) { |
|
4 | 4 | return; |
5 | 5 | } |
6 | 6 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function __construct( $prevent_multiple_instances = '' ) { |
77 | 77 | |
78 | - if( $prevent_multiple_instances === 'get_instance' ) { |
|
78 | + if ( $prevent_multiple_instances === 'get_instance' ) { |
|
79 | 79 | return parent::__construct(); |
80 | 80 | } |
81 | 81 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public static function get_instance() { |
89 | 89 | |
90 | - if( empty( self::$instance ) ) { |
|
90 | + if ( empty( self::$instance ) ) { |
|
91 | 91 | self::$instance = new self( 'get_instance' ); |
92 | 92 | } |
93 | 93 | |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | * Prevent Gravity Forms from showing the uninstall tab on the settings page |
111 | 111 | * @hack |
112 | 112 | */ |
113 | - if( $caps === $this->_capabilities_uninstall ) { |
|
113 | + if ( $caps === $this->_capabilities_uninstall ) { |
|
114 | 114 | return false; |
115 | 115 | } |
116 | 116 | |
117 | - if( empty( $caps ) ) { |
|
117 | + if ( empty( $caps ) ) { |
|
118 | 118 | $caps = array( 'gravityview_full_access' ); |
119 | 119 | } |
120 | 120 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | add_filter( 'gform_addon_app_settings_menu_gravityview', array( $this, 'modify_app_settings_menu_title' ) ); |
138 | 138 | |
139 | 139 | /** @since 1.7.6 */ |
140 | - add_action('network_admin_menu', array( $this, 'add_network_menu' ) ); |
|
140 | + add_action( 'network_admin_menu', array( $this, 'add_network_menu' ) ); |
|
141 | 141 | |
142 | 142 | parent::init_admin(); |
143 | 143 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function modify_app_settings_menu_title( $setting_tabs ) { |
153 | 153 | |
154 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview'); |
|
154 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
155 | 155 | |
156 | 156 | return $setting_tabs; |
157 | 157 | } |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | */ |
169 | 169 | private function _load_license_handler() { |
170 | 170 | |
171 | - if( !empty( $this->License_Handler ) ) { |
|
171 | + if ( ! empty( $this->License_Handler ) ) { |
|
172 | 172 | return; |
173 | 173 | } |
174 | 174 | |
175 | - require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php'); |
|
175 | + require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php' ); |
|
176 | 176 | |
177 | 177 | $this->License_Handler = GV_License_Handler::get_instance( $this ); |
178 | 178 | } |
@@ -184,39 +184,39 @@ discard block |
||
184 | 184 | function license_key_notice() { |
185 | 185 | |
186 | 186 | // Only show on GravityView pages |
187 | - if( ! gravityview_is_admin_page() ) { |
|
187 | + if ( ! gravityview_is_admin_page() ) { |
|
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
191 | - $license_status = self::getSetting('license_key_status'); |
|
192 | - $license_id = self::getSetting('license_key'); |
|
191 | + $license_status = self::getSetting( 'license_key_status' ); |
|
192 | + $license_id = self::getSetting( 'license_key' ); |
|
193 | 193 | $license_id = empty( $license_id ) ? 'license' : $license_id; |
194 | 194 | |
195 | - $message = esc_html__('Your GravityView license %s. This means you’re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview'); |
|
195 | + $message = esc_html__( 'Your GravityView license %s. This means you’re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview' ); |
|
196 | 196 | |
197 | 197 | /** |
198 | 198 | * I wanted to remove the period from after the buttons in the string, |
199 | 199 | * but didn't want to mess up the translation strings for the translators. |
200 | 200 | */ |
201 | 201 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
202 | - $title = __('Inactive License', 'gravityview'); |
|
202 | + $title = __( 'Inactive License', 'gravityview' ); |
|
203 | 203 | $status = ''; |
204 | 204 | $update_below = false; |
205 | 205 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
206 | 206 | switch ( $license_status ) { |
207 | 207 | /** @since 1.17 */ |
208 | 208 | case 'expired': |
209 | - $title = __('Expired License', 'gravityview'); |
|
209 | + $title = __( 'Expired License', 'gravityview' ); |
|
210 | 210 | $status = 'expired'; |
211 | - $message = $this->get_license_handler()->strings( 'expired', self::getSetting('license_key_response') ); |
|
211 | + $message = $this->get_license_handler()->strings( 'expired', self::getSetting( 'license_key_response' ) ); |
|
212 | 212 | break; |
213 | 213 | case 'invalid': |
214 | - $title = __('Invalid License', 'gravityview'); |
|
215 | - $status = __('is invalid', 'gravityview'); |
|
214 | + $title = __( 'Invalid License', 'gravityview' ); |
|
215 | + $status = __( 'is invalid', 'gravityview' ); |
|
216 | 216 | break; |
217 | 217 | case 'deactivated': |
218 | - $status = __('is inactive', 'gravityview'); |
|
219 | - $update_below = __('Activate your license key below.', 'gravityview'); |
|
218 | + $status = __( 'is inactive', 'gravityview' ); |
|
219 | + $update_below = __( 'Activate your license key below.', 'gravityview' ); |
|
220 | 220 | break; |
221 | 221 | /** @noinspection PhpMissingBreakStatementInspection */ |
222 | 222 | case '': |
@@ -224,27 +224,27 @@ discard block |
||
224 | 224 | // break intentionally left blank |
225 | 225 | case 'inactive': |
226 | 226 | case 'site_inactive': |
227 | - $status = __('has not been activated', 'gravityview'); |
|
228 | - $update_below = __('Activate your license key below.', 'gravityview'); |
|
227 | + $status = __( 'has not been activated', 'gravityview' ); |
|
228 | + $update_below = __( 'Activate your license key below.', 'gravityview' ); |
|
229 | 229 | break; |
230 | 230 | } |
231 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
231 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
232 | 232 | |
233 | 233 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
234 | - if( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
|
234 | + if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
|
235 | 235 | $message = sprintf( $message, $status, '<div class="hidden">', '', '', '</div><a href="#" onclick="jQuery(\'#license_key\').focus(); return false;">' . $update_below . '</a>' ); |
236 | 236 | } else { |
237 | 237 | $message = sprintf( $message, $status, "\n\n" . '<a href="' . $primary_button_link . '" class="button button-primary">', '</a>', '<a href="' . esc_url( $url ) . '" class="button button-secondary">', '</a>' ); |
238 | 238 | } |
239 | 239 | |
240 | - if( !empty( $status ) ) { |
|
240 | + if ( ! empty( $status ) ) { |
|
241 | 241 | GravityView_Admin_Notices::add_notice( array( |
242 | 242 | 'message' => $message, |
243 | 243 | 'class' => 'updated', |
244 | 244 | 'title' => $title, |
245 | 245 | 'cap' => 'gravityview_edit_settings', |
246 | - 'dismiss' => sha1( $license_status.'_'.$license_id ), |
|
247 | - )); |
|
246 | + 'dismiss' => sha1( $license_status . '_' . $license_id ), |
|
247 | + ) ); |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | $styles = parent::styles(); |
258 | 258 | |
259 | - $styles[] = array( |
|
259 | + $styles[ ] = array( |
|
260 | 260 | 'handle' => 'gravityview_settings', |
261 | 261 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
262 | 262 | 'version' => GravityView_Plugin::version, |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * @return void |
280 | 280 | */ |
281 | 281 | public function add_network_menu() { |
282 | - if( GravityView_Plugin::is_network_activated() ) { |
|
282 | + if ( GravityView_Plugin::is_network_activated() ) { |
|
283 | 283 | add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' ); |
284 | 284 | } |
285 | 285 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * If multisite and not network admin, we don't want the settings to show. |
297 | 297 | * @since 1.7.6 |
298 | 298 | */ |
299 | - $show_submenu = !is_multisite() || is_main_site() || !GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() ); |
|
299 | + $show_submenu = ! is_multisite() || is_main_site() || ! GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() ); |
|
300 | 300 | |
301 | 301 | /** |
302 | 302 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | $show_submenu = apply_filters( 'gravityview/show-settings-menu', $show_submenu ); |
307 | 307 | |
308 | - if( $show_submenu ) { |
|
308 | + if ( $show_submenu ) { |
|
309 | 309 | add_submenu_page( 'edit.php?post_type=gravityview', __( 'Settings', 'gravityview' ), __( 'Settings', 'gravityview' ), $this->_capabilities_app_settings, $this->_slug . '_settings', array( $this, 'app_tab_page' ) ); |
310 | 310 | } |
311 | 311 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | /** |
337 | 337 | * Backward compatibility with Redux |
338 | 338 | */ |
339 | - if( $setting_name === 'license' ) { |
|
339 | + if ( $setting_name === 'license' ) { |
|
340 | 340 | return array( |
341 | 341 | 'license' => parent::get_app_setting( 'license_key' ), |
342 | 342 | 'status' => parent::get_app_setting( 'license_key_status' ), |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | |
401 | 401 | $return = $text . $activation; |
402 | 402 | |
403 | - if( $echo ) { |
|
403 | + if ( $echo ) { |
|
404 | 404 | echo $return; |
405 | 405 | } |
406 | 406 | |
@@ -427,15 +427,15 @@ discard block |
||
427 | 427 | */ |
428 | 428 | public function settings_submit( $field, $echo = true ) { |
429 | 429 | |
430 | - $field['type'] = ( isset($field['type']) && in_array( $field['type'], array('submit','reset','button') ) ) ? $field['type'] : 'submit'; |
|
430 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
431 | 431 | |
432 | 432 | $attributes = $this->get_field_attributes( $field ); |
433 | 433 | $default_value = rgar( $field, 'value' ) ? rgar( $field, 'value' ) : rgar( $field, 'default_value' ); |
434 | - $value = $this->get_setting( $field['name'], $default_value ); |
|
434 | + $value = $this->get_setting( $field[ 'name' ], $default_value ); |
|
435 | 435 | |
436 | 436 | |
437 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
438 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_'.$field['name']; |
|
437 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
438 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
439 | 439 | |
440 | 440 | if ( empty( $value ) ) { |
441 | 441 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $attributes = $this->get_field_attributes( $field ); |
445 | 445 | |
446 | 446 | $html = '<input |
447 | - type="' . $field['type'] . '" |
|
447 | + type="' . $field[ 'type' ] . '" |
|
448 | 448 | name="' . esc_attr( $name ) . '" |
449 | 449 | value="' . $value . '" ' . |
450 | 450 | implode( ' ', $attributes ) . |
@@ -466,16 +466,16 @@ discard block |
||
466 | 466 | * @return string |
467 | 467 | */ |
468 | 468 | public function settings_save( $field, $echo = true ) { |
469 | - $field['type'] = 'submit'; |
|
470 | - $field['name'] = 'gform-settings-save'; |
|
471 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
469 | + $field[ 'type' ] = 'submit'; |
|
470 | + $field[ 'name' ] = 'gform-settings-save'; |
|
471 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
472 | 472 | |
473 | 473 | if ( ! rgar( $field, 'value' ) ) |
474 | - $field['value'] = __( 'Update Settings', 'gravityview' ); |
|
474 | + $field[ 'value' ] = __( 'Update Settings', 'gravityview' ); |
|
475 | 475 | |
476 | 476 | $output = $this->settings_submit( $field, false ); |
477 | 477 | |
478 | - if( $echo ) { |
|
478 | + if ( $echo ) { |
|
479 | 479 | echo $output; |
480 | 480 | } |
481 | 481 | |
@@ -492,8 +492,8 @@ discard block |
||
492 | 492 | parent::single_setting_label( $field ); |
493 | 493 | |
494 | 494 | // Added by GravityView |
495 | - if ( isset( $field['description'] ) ) { |
|
496 | - echo '<span class="description">'. $field['description'] .'</span>'; |
|
495 | + if ( isset( $field[ 'description' ] ) ) { |
|
496 | + echo '<span class="description">' . $field[ 'description' ] . '</span>'; |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | } |
@@ -555,11 +555,11 @@ discard block |
||
555 | 555 | |
556 | 556 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
557 | 557 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
558 | - if( $local_key !== $response_key ) { |
|
558 | + if ( $local_key !== $response_key ) { |
|
559 | 559 | |
560 | - unset( $posted_settings['license_key_response'] ); |
|
561 | - unset( $posted_settings['license_key_status'] ); |
|
562 | - GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
560 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
561 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
562 | + GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
563 | 563 | } |
564 | 564 | |
565 | 565 | return $posted_settings; |
@@ -594,25 +594,25 @@ discard block |
||
594 | 594 | 'label' => __( 'License Key', 'gravityview' ), |
595 | 595 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ), |
596 | 596 | 'type' => 'edd_license', |
597 | - 'data-pending-text' => __('Verifying license…', 'gravityview'), |
|
598 | - 'default_value' => $default_settings['license_key'], |
|
597 | + 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
|
598 | + 'default_value' => $default_settings[ 'license_key' ], |
|
599 | 599 | 'class' => ( '' == $this->get_app_setting( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
600 | 600 | ), |
601 | 601 | array( |
602 | 602 | 'name' => 'license_key_response', |
603 | - 'default_value' => $default_settings['license_key_response'], |
|
603 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
604 | 604 | 'type' => 'hidden', |
605 | 605 | ), |
606 | 606 | array( |
607 | 607 | 'name' => 'license_key_status', |
608 | - 'default_value' => $default_settings['license_key_status'], |
|
608 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
609 | 609 | 'type' => 'hidden', |
610 | 610 | ), |
611 | 611 | array( |
612 | 612 | 'name' => 'support-email', |
613 | 613 | 'type' => 'text', |
614 | 614 | 'validate' => 'email', |
615 | - 'default_value' => $default_settings['support-email'], |
|
615 | + 'default_value' => $default_settings[ 'support-email' ], |
|
616 | 616 | 'label' => __( 'Support Email', 'gravityview' ), |
617 | 617 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
618 | 618 | 'class' => 'code regular-text', |
@@ -624,44 +624,44 @@ discard block |
||
624 | 624 | 'name' => 'support_port', |
625 | 625 | 'type' => 'radio', |
626 | 626 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
627 | - 'default_value' => $default_settings['support_port'], |
|
627 | + 'default_value' => $default_settings[ 'support_port' ], |
|
628 | 628 | 'horizontal' => 1, |
629 | 629 | 'choices' => array( |
630 | 630 | array( |
631 | - 'label' => _x('Show', 'Setting: Show or Hide', 'gravityview'), |
|
631 | + 'label' => _x( 'Show', 'Setting: Show or Hide', 'gravityview' ), |
|
632 | 632 | 'value' => '1', |
633 | 633 | ), |
634 | 634 | array( |
635 | - 'label' => _x('Hide', 'Setting: Show or Hide', 'gravityview'), |
|
635 | + 'label' => _x( 'Hide', 'Setting: Show or Hide', 'gravityview' ), |
|
636 | 636 | 'value' => '0', |
637 | 637 | ), |
638 | 638 | ), |
639 | - 'tooltip' => '<p><img src="' . esc_url_raw( plugins_url('assets/images/screenshots/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__('The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview') . '</p>', |
|
639 | + 'tooltip' => '<p><img src="' . esc_url_raw( plugins_url( 'assets/images/screenshots/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__( 'The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview' ) . '</p>', |
|
640 | 640 | 'description' => __( 'Show the Support Port on GravityView pages?', 'gravityview' ), |
641 | 641 | ), |
642 | 642 | array( |
643 | 643 | 'name' => 'no-conflict-mode', |
644 | 644 | 'type' => 'radio', |
645 | 645 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
646 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
646 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
647 | 647 | 'horizontal' => 1, |
648 | 648 | 'choices' => array( |
649 | 649 | array( |
650 | - 'label' => _x('On', 'Setting: On or off', 'gravityview'), |
|
650 | + 'label' => _x( 'On', 'Setting: On or off', 'gravityview' ), |
|
651 | 651 | 'value' => '1', |
652 | 652 | ), |
653 | 653 | array( |
654 | - 'label' => _x('Off', 'Setting: On or off', 'gravityview'), |
|
654 | + 'label' => _x( 'Off', 'Setting: On or off', 'gravityview' ), |
|
655 | 655 | 'value' => '0', |
656 | 656 | ), |
657 | 657 | ), |
658 | - 'description' => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __('If your Edit View tabs are ugly, enable this setting.', 'gravityview'), |
|
658 | + 'description' => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __( 'If your Edit View tabs are ugly, enable this setting.', 'gravityview' ), |
|
659 | 659 | ), |
660 | 660 | array( |
661 | 661 | 'name' => 'delete-on-uninstall', |
662 | 662 | 'type' => 'radio', |
663 | 663 | 'label' => __( 'Remove Data on Delete?', 'gravityview' ), |
664 | - 'default_value' => $default_settings['delete-on-uninstall'], |
|
664 | + 'default_value' => $default_settings[ 'delete-on-uninstall' ], |
|
665 | 665 | 'horizontal' => 1, |
666 | 666 | 'choices' => array( |
667 | 667 | array( |
@@ -687,20 +687,20 @@ discard block |
||
687 | 687 | * @since 1.7.4 |
688 | 688 | */ |
689 | 689 | foreach ( $fields as &$field ) { |
690 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : rgget('id', $field ); |
|
691 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : rgget('title', $field ); |
|
692 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : rgget('default', $field ); |
|
693 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : rgget('subtitle', $field ); |
|
690 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : rgget( 'id', $field ); |
|
691 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : rgget( 'title', $field ); |
|
692 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : rgget( 'default', $field ); |
|
693 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : rgget( 'subtitle', $field ); |
|
694 | 694 | |
695 | - if( $disabled_attribute ) { |
|
696 | - $field['disabled'] = $disabled_attribute; |
|
695 | + if ( $disabled_attribute ) { |
|
696 | + $field[ 'disabled' ] = $disabled_attribute; |
|
697 | 697 | } |
698 | 698 | } |
699 | 699 | |
700 | 700 | |
701 | 701 | $sections = array( |
702 | 702 | array( |
703 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ), |
|
703 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), GravityView_Plugin::version ) ), |
|
704 | 704 | 'fields' => $fields, |
705 | 705 | ) |
706 | 706 | ); |
@@ -711,8 +711,8 @@ discard block |
||
711 | 711 | 'type' => 'save', |
712 | 712 | ); |
713 | 713 | |
714 | - if( $disabled_attribute ) { |
|
715 | - $button['disabled'] = $disabled_attribute; |
|
714 | + if ( $disabled_attribute ) { |
|
715 | + $button[ 'disabled' ] = $disabled_attribute; |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | |
@@ -732,20 +732,20 @@ discard block |
||
732 | 732 | // If there are extensions, add a section for them |
733 | 733 | if ( ! empty( $extension_sections ) ) { |
734 | 734 | |
735 | - if( $disabled_attribute ) { |
|
735 | + if ( $disabled_attribute ) { |
|
736 | 736 | foreach ( $extension_sections as &$section ) { |
737 | - foreach ( $section['fields'] as &$field ) { |
|
738 | - $field['disabled'] = $disabled_attribute; |
|
737 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
738 | + $field[ 'disabled' ] = $disabled_attribute; |
|
739 | 739 | } |
740 | 740 | } |
741 | 741 | } |
742 | 742 | |
743 | - $k = count( $extension_sections ) - 1 ; |
|
744 | - $extension_sections[ $k ]['fields'][] = $button; |
|
743 | + $k = count( $extension_sections ) - 1; |
|
744 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
745 | 745 | $sections = array_merge( $sections, $extension_sections ); |
746 | 746 | } else { |
747 | 747 | // add the 'update settings' button to the general section |
748 | - $sections[0]['fields'][] = $button; |
|
748 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | return $sections; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public static function process_modifiers( $value, $merge_tag, $modifier, $field, $raw_value ) { |
46 | 46 | |
47 | 47 | // No modifier was set or the raw value was empty |
48 | - if( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) { |
|
48 | + if ( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) { |
|
49 | 49 | return $value; |
50 | 50 | } |
51 | 51 | |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | foreach ( $gv_modifiers as $gv_modifier => $method ) { |
62 | 62 | |
63 | 63 | // Only match the regex if it's the first modifer; this allows us to enforce our own modifier structure |
64 | - preg_match( '/^' . $gv_modifier .'/ism', $modifier, $matches ); |
|
64 | + preg_match( '/^' . $gv_modifier . '/ism', $modifier, $matches ); |
|
65 | 65 | |
66 | - if( ! empty( $matches ) ) { |
|
66 | + if ( ! empty( $matches ) ) { |
|
67 | 67 | // The called method is passed the raw value and the full matches array |
68 | 68 | $return = self::$method( $raw_value, $matches ); |
69 | 69 | break; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private static function modifier_timestamp( $raw_value, $matches ) { |
89 | 89 | |
90 | - if( empty( $matches[0] ) ) { |
|
90 | + if ( empty( $matches[ 0 ] ) ) { |
|
91 | 91 | return $raw_value; |
92 | 92 | } |
93 | 93 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | private static function modifier_wpautop( $raw_value, $matches ) { |
113 | 113 | |
114 | - if( empty( $matches[0] ) || ! function_exists( 'wpautop' ) ) { |
|
114 | + if ( empty( $matches[ 0 ] ) || ! function_exists( 'wpautop' ) ) { |
|
115 | 115 | return $raw_value; |
116 | 116 | } |
117 | 117 | |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | */ |
136 | 136 | private static function modifier_maxwords( $raw_value, $matches ) { |
137 | 137 | |
138 | - if( ! is_string( $raw_value ) || empty( $matches[1] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
138 | + if ( ! is_string( $raw_value ) || empty( $matches[ 1 ] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
139 | 139 | return $raw_value; |
140 | 140 | } |
141 | 141 | |
142 | - $max = intval( $matches[1] ); |
|
142 | + $max = intval( $matches[ 1 ] ); |
|
143 | 143 | |
144 | 144 | $more_placeholder = '[GVMORE]'; |
145 | 145 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param bool $esc_html Pass return value through `esc_html()` |
172 | 172 | * @return string Text with variables maybe replaced |
173 | 173 | */ |
174 | - public static function replace_variables($text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) { |
|
174 | + public static function replace_variables( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) { |
|
175 | 175 | |
176 | 176 | /** |
177 | 177 | * @filter `gravityview_do_replace_variables` Turn off merge tag variable replacements.\n |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | * @internal Reported to GF Support on 12/3 |
196 | 196 | * @internal Fixed in Gravity Forms |
197 | 197 | */ |
198 | - $form['title'] = isset( $form['title'] ) ? $form['title'] : ''; |
|
199 | - $form['id'] = isset( $form['id'] ) ? $form['id'] : ''; |
|
200 | - $form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array(); |
|
198 | + $form[ 'title' ] = isset( $form[ 'title' ] ) ? $form[ 'title' ] : ''; |
|
199 | + $form[ 'id' ] = isset( $form[ 'id' ] ) ? $form[ 'id' ] : ''; |
|
200 | + $form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array(); |
|
201 | 201 | |
202 | 202 | return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html ); |
203 | 203 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * |
218 | 218 | * @return mixed |
219 | 219 | */ |
220 | - public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
220 | + public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
221 | 221 | |
222 | 222 | /** |
223 | 223 | * This prevents the gform_replace_merge_tags filter from being called twice, as defined in: |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @see GFCommon::replace_variables_prepopulate() |
226 | 226 | * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14 |
227 | 227 | */ |
228 | - if( false === $form ) { |
|
228 | + if ( false === $form ) { |
|
229 | 229 | return $text; |
230 | 230 | } |
231 | 231 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
258 | 258 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
259 | 259 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
260 | - 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
260 | + 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
261 | 261 | ); |
262 | 262 | |
263 | 263 | $formatted_date = GVCommon::format_date( $date_created, $atts ); |
@@ -320,14 +320,14 @@ discard block |
||
320 | 320 | preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER ); |
321 | 321 | |
322 | 322 | // If there are no matches OR the Entry `created_by` isn't set or is 0 (no user) |
323 | - if( empty( $matches ) ) { |
|
323 | + if ( empty( $matches ) ) { |
|
324 | 324 | return $text; |
325 | 325 | } |
326 | 326 | |
327 | 327 | foreach ( $matches as $match ) { |
328 | 328 | |
329 | - $full_tag = $match[0]; |
|
330 | - $property = $match[1]; |
|
329 | + $full_tag = $match[ 0 ]; |
|
330 | + $property = $match[ 1 ]; |
|
331 | 331 | |
332 | 332 | $value = stripslashes_deep( rgget( $property ) ); |
333 | 333 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | * @since 1.15 |
352 | 352 | * @param bool $esc_html Whether to esc_html() the value. Default: `true` |
353 | 353 | */ |
354 | - $esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
354 | + $esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
355 | 355 | |
356 | 356 | $value = $esc_html ? esc_html( $value ) : $value; |
357 | 357 | |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | * @param[in] array $form Gravity Forms form array |
363 | 363 | * @param[in] array $entry Entry array |
364 | 364 | */ |
365 | - $value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
365 | + $value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
366 | 366 | |
367 | 367 | $text = str_replace( $full_tag, $value, $text ); |
368 | 368 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - if( ! is_admin() ) { return; } |
|
21 | + if ( ! is_admin() ) { return; } |
|
22 | 22 | |
23 | 23 | $this->add_hooks(); |
24 | 24 | } |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | */ |
33 | 33 | private function add_hooks() { |
34 | 34 | //Hooks for no-conflict functionality |
35 | - add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000); |
|
36 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9); |
|
35 | + add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 ); |
|
36 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 ); |
|
37 | 37 | |
38 | - add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000); |
|
39 | - add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11); |
|
40 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1); |
|
41 | - add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1); |
|
38 | + add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 ); |
|
39 | + add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 ); |
|
40 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 ); |
|
41 | + add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | function no_conflict_scripts() { |
52 | 52 | global $wp_scripts; |
53 | 53 | |
54 | - if( ! gravityview_is_admin_page() ) { |
|
54 | + if ( ! gravityview_is_admin_page() ) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | - $no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode'); |
|
58 | + $no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' ); |
|
59 | 59 | |
60 | - if( empty( $no_conflict_mode ) ) { |
|
60 | + if ( empty( $no_conflict_mode ) ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
@@ -110,24 +110,24 @@ discard block |
||
110 | 110 | function no_conflict_styles() { |
111 | 111 | global $wp_styles; |
112 | 112 | |
113 | - if( ! gravityview_is_admin_page() ) { |
|
113 | + if ( ! gravityview_is_admin_page() ) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | 117 | // Dequeue other jQuery styles even if no-conflict is off. |
118 | 118 | // Terrible-looking tabs help no one. |
119 | - if( !empty( $wp_styles->registered ) ) { |
|
120 | - foreach ($wp_styles->registered as $key => $style) { |
|
121 | - if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
119 | + if ( ! empty( $wp_styles->registered ) ) { |
|
120 | + foreach ( $wp_styles->registered as $key => $style ) { |
|
121 | + if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
122 | 122 | wp_dequeue_style( $key ); |
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - $no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode'); |
|
127 | + $no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' ); |
|
128 | 128 | |
129 | 129 | // If no conflict is off, jQuery will suffice. |
130 | - if( empty( $no_conflict_mode ) ) { |
|
130 | + if ( empty( $no_conflict_mode ) ) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | /** |
155 | 155 | * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here. |
156 | 156 | */ |
157 | - do_action('gravityview_remove_conflicts_after'); |
|
157 | + do_action( 'gravityview_remove_conflicts_after' ); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | |
179 | 179 | //reset queue |
180 | 180 | $queue = array(); |
181 | - foreach( $wp_objects->queue as $object ) { |
|
182 | - if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
183 | - $queue[] = $object; |
|
181 | + foreach ( $wp_objects->queue as $object ) { |
|
182 | + if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
183 | + $queue[ ] = $object; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | $wp_objects->queue = $queue; |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | |
190 | 190 | //unregistering scripts |
191 | 191 | $registered = array(); |
192 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
193 | - if( in_array( $handle, $required_objects ) ){ |
|
192 | + foreach ( $wp_objects->registered as $handle => $script_registration ) { |
|
193 | + if ( in_array( $handle, $required_objects ) ) { |
|
194 | 194 | $registered[ $handle ] = $script_registration; |
195 | 195 | } |
196 | 196 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @param array $registered [description] |
206 | 206 | * @param array $scripts [description] |
207 | 207 | */ |
208 | - private function add_script_dependencies($registered, $scripts) { |
|
208 | + private function add_script_dependencies( $registered, $scripts ) { |
|
209 | 209 | |
210 | 210 | //gets all dependent scripts linked to the $scripts array passed |
211 | 211 | do { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array(); |
215 | 215 | foreach ( $deps as $dep ) { |
216 | 216 | if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) { |
217 | - $dependents[] = $dep; |
|
217 | + $dependents[ ] = $dep; |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | } |
@@ -19,12 +19,12 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | function render_input( $override_input = null ) { |
22 | - if( isset( $override_input ) ) { |
|
22 | + if ( isset( $override_input ) ) { |
|
23 | 23 | echo $override_input; |
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | - foreach( $this->field['options'] as $value => $label ) : ?> |
|
27 | + foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
28 | 28 | <label class="<?php echo $this->get_label_class(); ?>"> |
29 | 29 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> /> <?php echo esc_html( $label ); ?> |
30 | 30 | </label> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | var $name = 'radio'; |
11 | 11 | |
12 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
12 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
13 | 13 | |
14 | 14 | var $_gf_field_class_name = 'GF_Field_Radio'; |
15 | 15 | |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | // Set the $_field_id var |
39 | 39 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type ); |
40 | 40 | |
41 | - if( $this->is_choice_value_enabled() ) { |
|
42 | - $field_options['choice_display'] = array( |
|
41 | + if ( $this->is_choice_value_enabled() ) { |
|
42 | + $field_options[ 'choice_display' ] = array( |
|
43 | 43 | 'type' => 'radio', |
44 | 44 | 'value' => 'value', |
45 | 45 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -38,8 +38,8 @@ |
||
38 | 38 | // Set the $_field_id var |
39 | 39 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type ); |
40 | 40 | |
41 | - if( $this->is_choice_value_enabled() ) { |
|
42 | - $field_options['choice_display'] = array( |
|
41 | + if ( $this->is_choice_value_enabled() ) { |
|
42 | + $field_options[ 'choice_display' ] = array( |
|
43 | 43 | 'type' => 'radio', |
44 | 44 | 'value' => 'value', |
45 | 45 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -66,20 +66,20 @@ discard block |
||
66 | 66 | |
67 | 67 | /** Load common & connector functions */ |
68 | 68 | require_once( GRAVITYVIEW_DIR . 'includes/helper-functions.php' ); |
69 | -require_once( GRAVITYVIEW_DIR . 'includes/class-common.php'); |
|
70 | -require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php'); |
|
69 | +require_once( GRAVITYVIEW_DIR . 'includes/class-common.php' ); |
|
70 | +require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php' ); |
|
71 | 71 | require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-compatibility.php' ); |
72 | 72 | require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-roles-capabilities.php' ); |
73 | 73 | require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-notices.php' ); |
74 | 74 | |
75 | 75 | /** Register Post Types and Rewrite Rules */ |
76 | -require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php'); |
|
76 | +require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php' ); |
|
77 | 77 | |
78 | 78 | /** Add Cache Class */ |
79 | -require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php'); |
|
79 | +require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php' ); |
|
80 | 80 | |
81 | 81 | /** Register hooks that are fired when the plugin is activated and deactivated. */ |
82 | -if( is_admin() ) { |
|
82 | +if ( is_admin() ) { |
|
83 | 83 | register_activation_hook( __FILE__, array( 'GravityView_Plugin', 'activate' ) ); |
84 | 84 | register_deactivation_hook( __FILE__, array( 'GravityView_Plugin', 'deactivate' ) ); |
85 | 85 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public static function getInstance() { |
102 | 102 | |
103 | - if( empty( self::$instance ) ) { |
|
103 | + if ( empty( self::$instance ) ) { |
|
104 | 104 | self::$instance = new self; |
105 | 105 | } |
106 | 106 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | private function __construct() { |
111 | 111 | |
112 | 112 | |
113 | - if( ! GravityView_Compatibility::is_valid() ) { |
|
113 | + if ( ! GravityView_Compatibility::is_valid() ) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function include_files() { |
141 | 141 | |
142 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin.php' ); |
|
142 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin.php' ); |
|
143 | 143 | |
144 | 144 | // Load fields |
145 | 145 | include_once( GRAVITYVIEW_DIR . 'includes/fields/class-gravityview-fields.php' ); |
@@ -150,20 +150,20 @@ discard block |
||
150 | 150 | include_once( $gv_field_filename ); |
151 | 151 | } |
152 | 152 | |
153 | - include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-entry-notes.php' ); |
|
154 | - include_once( GRAVITYVIEW_DIR .'includes/load-plugin-and-theme-hooks.php' ); |
|
153 | + include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-notes.php' ); |
|
154 | + include_once( GRAVITYVIEW_DIR . 'includes/load-plugin-and-theme-hooks.php' ); |
|
155 | 155 | |
156 | 156 | // Load Extensions |
157 | 157 | // @todo: Convert to a scan of the directory or a method where this all lives |
158 | - include_once( GRAVITYVIEW_DIR .'includes/extensions/edit-entry/class-edit-entry.php' ); |
|
159 | - include_once( GRAVITYVIEW_DIR .'includes/extensions/delete-entry/class-delete-entry.php' ); |
|
160 | - include_once( GRAVITYVIEW_DIR .'includes/extensions/entry-notes/class-gravityview-field-notes.php' ); |
|
158 | + include_once( GRAVITYVIEW_DIR . 'includes/extensions/edit-entry/class-edit-entry.php' ); |
|
159 | + include_once( GRAVITYVIEW_DIR . 'includes/extensions/delete-entry/class-delete-entry.php' ); |
|
160 | + include_once( GRAVITYVIEW_DIR . 'includes/extensions/entry-notes/class-gravityview-field-notes.php' ); |
|
161 | 161 | |
162 | 162 | // Load WordPress Widgets |
163 | - include_once( GRAVITYVIEW_DIR .'includes/wordpress-widgets/register-wordpress-widgets.php' ); |
|
163 | + include_once( GRAVITYVIEW_DIR . 'includes/wordpress-widgets/register-wordpress-widgets.php' ); |
|
164 | 164 | |
165 | 165 | // Load GravityView Widgets |
166 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/register-gravityview-widgets.php' ); |
|
166 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/register-gravityview-widgets.php' ); |
|
167 | 167 | |
168 | 168 | // Add oEmbed |
169 | 169 | include_once( GRAVITYVIEW_DIR . 'includes/class-oembed.php' ); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' ); |
177 | 177 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-bar.php' ); |
178 | 178 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-list.php' ); |
179 | - include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */ |
|
179 | + include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */ |
|
180 | 180 | include_once( GRAVITYVIEW_DIR . 'includes/class-data.php' ); |
181 | 181 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-shortcode.php' ); |
182 | 182 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-link-shortcode.php' ); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @return bool |
192 | 192 | */ |
193 | 193 | public static function is_network_activated() { |
194 | - return is_multisite() && ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network( 'gravityview/gravityview.php' ) ); |
|
194 | + return is_multisite() && ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( 'gravityview/gravityview.php' ) ); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | * @since 1.7.5.1 |
257 | 257 | */ |
258 | 258 | public static function include_widget_class() { |
259 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' ); |
|
259 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' ); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | if ( ! $loaded ) { |
280 | 280 | $locale = apply_filters( 'plugin_locale', get_locale(), 'gravityview' ); |
281 | - $mofile = dirname( __FILE__ ) . '/languages/gravityview-'. $locale .'.mo'; |
|
281 | + $mofile = dirname( __FILE__ ) . '/languages/gravityview-' . $locale . '.mo'; |
|
282 | 282 | load_textdomain( 'gravityview', $mofile ); |
283 | 283 | } |
284 | 284 | |
@@ -309,12 +309,12 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function frontend_actions( $force = false ) { |
311 | 311 | |
312 | - if( self::is_admin() && ! $force ) { return; } |
|
312 | + if ( self::is_admin() && ! $force ) { return; } |
|
313 | 313 | |
314 | 314 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-image.php' ); |
315 | - include_once( GRAVITYVIEW_DIR .'includes/class-template.php' ); |
|
316 | - include_once( GRAVITYVIEW_DIR .'includes/class-api.php' ); |
|
317 | - include_once( GRAVITYVIEW_DIR .'includes/class-frontend-views.php' ); |
|
315 | + include_once( GRAVITYVIEW_DIR . 'includes/class-template.php' ); |
|
316 | + include_once( GRAVITYVIEW_DIR . 'includes/class-api.php' ); |
|
317 | + include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' ); |
|
318 | 318 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-change-entry-creator.php' ); |
319 | 319 | |
320 | 320 | |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public static function get_default_widget_areas() { |
341 | 341 | $default_areas = array( |
342 | - array( '1-1' => array( array( 'areaid' => 'top', 'title' => __('Top', 'gravityview' ) , 'subtitle' => '' ) ) ), |
|
343 | - array( '1-2' => array( array( 'areaid' => 'left', 'title' => __('Left', 'gravityview') , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __('Right', 'gravityview') , 'subtitle' => '' ) ) ), |
|
342 | + array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ), 'subtitle' => '' ) ) ), |
|
343 | + array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ), 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ), 'subtitle' => '' ) ) ), |
|
344 | 344 | ); |
345 | 345 | |
346 | 346 | /** |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | * @param mixed $data Additional data to display |
359 | 359 | * @return void |
360 | 360 | */ |
361 | - public static function log_debug( $message, $data = null ){ |
|
361 | + public static function log_debug( $message, $data = null ) { |
|
362 | 362 | /** |
363 | 363 | * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
364 | 364 | * @param string $message Message to display |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | * @param string $message log message |
373 | 373 | * @return void |
374 | 374 | */ |
375 | - public static function log_error( $message, $data = null ){ |
|
375 | + public static function log_error( $message, $data = null ) { |
|
376 | 376 | /** |
377 | 377 | * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
378 | 378 | * @param string $message Error message to display |
@@ -383,4 +383,4 @@ discard block |
||
383 | 383 | |
384 | 384 | } // end class GravityView_Plugin |
385 | 385 | |
386 | -add_action('plugins_loaded', array('GravityView_Plugin', 'getInstance'), 1); |
|
386 | +add_action( 'plugins_loaded', array( 'GravityView_Plugin', 'getInstance' ), 1 ); |
@@ -48,25 +48,25 @@ |
||
48 | 48 | |
49 | 49 | $quiz_fields = GFAPI::get_fields_by_type( $form, 'quiz' ); |
50 | 50 | |
51 | - if( ! empty( $quiz_fields ) ) { |
|
51 | + if ( ! empty( $quiz_fields ) ) { |
|
52 | 52 | |
53 | - $fields['gquiz_score'] = array( |
|
53 | + $fields[ 'gquiz_score' ] = array( |
|
54 | 54 | 'label' => __( 'Quiz Score Total', 'gravityview' ), |
55 | 55 | 'type' => 'quiz_score', |
56 | 56 | 'desc' => __( 'Displays the number of correct Quiz answers the user submitted.', 'gravityview' ), |
57 | 57 | ); |
58 | - $fields['gquiz_percent'] = array( |
|
58 | + $fields[ 'gquiz_percent' ] = array( |
|
59 | 59 | 'label' => __( 'Quiz Percentage Grade', 'gravityview' ), |
60 | 60 | 'type' => 'quiz_percent', |
61 | 61 | 'desc' => __( 'Displays the percentage of correct Quiz answers the user submitted.', 'gravityview' ), |
62 | 62 | ); |
63 | - $fields['gquiz_grade'] = array( |
|
63 | + $fields[ 'gquiz_grade' ] = array( |
|
64 | 64 | /* translators: This is a field type used by the Gravity Forms Quiz Addon. "A" is 100-90, "B" is 89-80, "C" is 79-70, etc. */ |
65 | 65 | 'label' => __( 'Quiz Letter Grade', 'gravityview' ), |
66 | 66 | 'type' => 'quiz_grade', |
67 | 67 | 'desc' => __( 'Displays the Grade the user achieved based on Letter Grading configured in the Quiz Settings.', 'gravityview' ), |
68 | 68 | ); |
69 | - $fields['gquiz_is_pass'] = array( |
|
69 | + $fields[ 'gquiz_is_pass' ] = array( |
|
70 | 70 | 'label' => __( 'Quiz Pass/Fail', 'gravityview' ), |
71 | 71 | 'type' => 'quiz_is_pass', |
72 | 72 | 'desc' => __( 'Displays either Passed or Failed based on the Pass/Fail settings configured in the Quiz Settings.', 'gravityview' ), |