@@ -312,11 +312,11 @@ discard block |
||
| 312 | 312 | include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-change-entry-creator.php' ); |
| 313 | 313 | |
| 314 | 314 | |
| 315 | - /** |
|
| 316 | - * When an entry is created, check if we need to update the custom slug meta |
|
| 317 | - * todo: move this to its own class.. |
|
| 318 | - */ |
|
| 319 | - add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 315 | + /** |
|
| 316 | + * When an entry is created, check if we need to update the custom slug meta |
|
| 317 | + * todo: move this to its own class.. |
|
| 318 | + */ |
|
| 319 | + add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | 322 | * @action `gravityview_include_frontend_actions` Triggered after all GravityView frontend files are loaded |
@@ -347,34 +347,34 @@ discard block |
||
| 347 | 347 | |
| 348 | 348 | /** DEBUG */ |
| 349 | 349 | |
| 350 | - /** |
|
| 351 | - * Logs messages using Gravity Forms logging add-on |
|
| 352 | - * @param string $message log message |
|
| 353 | - * @param mixed $data Additional data to display |
|
| 354 | - * @return void |
|
| 355 | - */ |
|
| 356 | - public static function log_debug( $message, $data = null ){ |
|
| 357 | - /** |
|
| 358 | - * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
|
| 359 | - * @param string $message Message to display |
|
| 360 | - * @param mixed $data Supporting data to print alongside it |
|
| 361 | - */ |
|
| 362 | - do_action( 'gravityview_log_debug', $message, $data ); |
|
| 363 | - } |
|
| 364 | - |
|
| 365 | - /** |
|
| 366 | - * Logs messages using Gravity Forms logging add-on |
|
| 367 | - * @param string $message log message |
|
| 368 | - * @return void |
|
| 369 | - */ |
|
| 370 | - public static function log_error( $message, $data = null ){ |
|
| 371 | - /** |
|
| 372 | - * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
|
| 373 | - * @param string $message Error message to display |
|
| 374 | - * @param mixed $data Supporting data to print alongside it |
|
| 375 | - */ |
|
| 376 | - do_action( 'gravityview_log_error', $message, $data ); |
|
| 377 | - } |
|
| 350 | + /** |
|
| 351 | + * Logs messages using Gravity Forms logging add-on |
|
| 352 | + * @param string $message log message |
|
| 353 | + * @param mixed $data Additional data to display |
|
| 354 | + * @return void |
|
| 355 | + */ |
|
| 356 | + public static function log_debug( $message, $data = null ){ |
|
| 357 | + /** |
|
| 358 | + * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
|
| 359 | + * @param string $message Message to display |
|
| 360 | + * @param mixed $data Supporting data to print alongside it |
|
| 361 | + */ |
|
| 362 | + do_action( 'gravityview_log_debug', $message, $data ); |
|
| 363 | + } |
|
| 364 | + |
|
| 365 | + /** |
|
| 366 | + * Logs messages using Gravity Forms logging add-on |
|
| 367 | + * @param string $message log message |
|
| 368 | + * @return void |
|
| 369 | + */ |
|
| 370 | + public static function log_error( $message, $data = null ){ |
|
| 371 | + /** |
|
| 372 | + * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
|
| 373 | + * @param string $message Error message to display |
|
| 374 | + * @param mixed $data Supporting data to print alongside it |
|
| 375 | + */ |
|
| 376 | + do_action( 'gravityview_log_error', $message, $data ); |
|
| 377 | + } |
|
| 378 | 378 | |
| 379 | 379 | } // end class GravityView_Plugin |
| 380 | 380 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * @param mixed $data Additional data to display |
| 352 | 352 | * @return void |
| 353 | 353 | */ |
| 354 | - public static function log_debug( $message, $data = null ){ |
|
| 354 | + public static function log_debug( $message, $data = null ) { |
|
| 355 | 355 | /** |
| 356 | 356 | * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
| 357 | 357 | * @param string $message Message to display |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | * @param string $message log message |
| 366 | 366 | * @return void |
| 367 | 367 | */ |
| 368 | - public static function log_error( $message, $data = null ){ |
|
| 368 | + public static function log_error( $message, $data = null ) { |
|
| 369 | 369 | /** |
| 370 | 370 | * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
| 371 | 371 | * @param string $message Error message to display |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | return; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
| 18 | + $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
| 19 | 19 | |
| 20 | 20 | ?> |
| 21 | 21 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" /> |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | |
| 29 | 29 | $show_mt = $this->show_merge_tags(); |
| 30 | 30 | |
| 31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | - $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
| 33 | - } |
|
| 34 | - $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
| 31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | + $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
| 33 | + } |
|
| 34 | + $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
| 35 | 35 | |
| 36 | 36 | ?> |
| 37 | 37 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
@@ -28,14 +28,14 @@ |
||
| 28 | 28 | |
| 29 | 29 | $show_mt = $this->show_merge_tags(); |
| 30 | 30 | |
| 31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | - $class = ' merge-tag-support mt-position-right '; |
|
| 33 | - |
|
| 34 | - if( empty( $this->field['show_all_fields'] ) ) { |
|
| 35 | - $class .= ' mt-hide_all_fields'; |
|
| 36 | - } |
|
| 37 | - } |
|
| 38 | - $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat'; |
|
| 31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | + $class = ' merge-tag-support mt-position-right '; |
|
| 33 | + |
|
| 34 | + if( empty( $this->field['show_all_fields'] ) ) { |
|
| 35 | + $class .= ' mt-hide_all_fields'; |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | + $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat'; |
|
| 39 | 39 | |
| 40 | 40 | ?> |
| 41 | 41 | <textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea( $this->value ); ?></textarea> |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | if( !GravityView_Compatibility::is_valid() ) { return; } |
| 16 | 16 | |
| 17 | - self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
| 17 | + self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
| 18 | 18 | |
| 19 | 19 | include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php'; |
| 20 | 20 | |
@@ -228,13 +228,13 @@ discard block |
||
| 228 | 228 | $get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL; |
| 229 | 229 | |
| 230 | 230 | if( isset( $form['id'] ) ) { |
| 231 | - $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
| 231 | + $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
| 232 | 232 | |
| 233 | - // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
|
| 234 | - $_GET['id'] = $form['id']; |
|
| 233 | + // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
|
| 234 | + $_GET['id'] = $form['id']; |
|
| 235 | 235 | |
| 236 | 236 | } else { |
| 237 | - $form_script = 'var form = new Form();'; |
|
| 237 | + $form_script = 'var form = new Form();'; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | $output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>'; |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Display the tab navigation for the Settings metabox |
|
| 4 | - * |
|
| 5 | - * @package GravityView |
|
| 6 | - * @subpackage Gravityview/admin/metaboxes/views |
|
| 7 | - * @since 1.8 |
|
| 8 | - * |
|
| 9 | - * @global GravityView_Metabox_Tab[] $metaboxes |
|
| 10 | - * @global WP_Post $post |
|
| 11 | - */ |
|
| 3 | + * Display the tab navigation for the Settings metabox |
|
| 4 | + * |
|
| 5 | + * @package GravityView |
|
| 6 | + * @subpackage Gravityview/admin/metaboxes/views |
|
| 7 | + * @since 1.8 |
|
| 8 | + * |
|
| 9 | + * @global GravityView_Metabox_Tab[] $metaboxes |
|
| 10 | + * @global WP_Post $post |
|
| 11 | + */ |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package GravityView |
|
| 4 | - * @subpackage Gravityview/admin/metaboxes/partials |
|
| 5 | - * @global $post |
|
| 6 | - */ |
|
| 3 | + * @package GravityView |
|
| 4 | + * @subpackage Gravityview/admin/metaboxes/partials |
|
| 5 | + * @global $post |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | global $post; |
| 9 | 9 | ?> |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package GravityView |
|
| 4 | - * @subpackage Gravityview/admin/metaboxes/partials |
|
| 5 | - * @global WP_Post $post |
|
| 6 | - */ |
|
| 3 | + * @package GravityView |
|
| 4 | + * @subpackage Gravityview/admin/metaboxes/partials |
|
| 5 | + * @global WP_Post $post |
|
| 6 | + */ |
|
| 7 | 7 | global $post; |
| 8 | 8 | |
| 9 | 9 | $curr_form = gravityview_get_form_id( $post->ID ); |
@@ -432,23 +432,17 @@ |
||
| 432 | 432 | do_action( 'gravityview_log_error', __METHOD__ . ' entry_id or form_id are empty.', $_POST ); |
| 433 | 433 | |
| 434 | 434 | $result = false; |
| 435 | - } |
|
| 436 | - |
|
| 437 | - else if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxgfentries' ) ) { |
|
| 435 | + } else if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxgfentries' ) ) { |
|
| 438 | 436 | |
| 439 | 437 | do_action( 'gravityview_log_error', __METHOD__ . ' Security check failed.', $_POST ); |
| 440 | 438 | |
| 441 | 439 | $result = false; |
| 442 | - } |
|
| 443 | - |
|
| 444 | - else if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST['entry_id'] ) ) { |
|
| 440 | + } else if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST['entry_id'] ) ) { |
|
| 445 | 441 | |
| 446 | 442 | do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the `gravityview_moderate_entries` capability.' ); |
| 447 | 443 | |
| 448 | 444 | $result = false; |
| 449 | - } |
|
| 450 | - |
|
| 451 | - else { |
|
| 445 | + } else { |
|
| 452 | 446 | |
| 453 | 447 | $result = self::update_approved( $_POST['entry_id'], $_POST['approved'], $_POST['form_id'] ); |
| 454 | 448 | |
@@ -363,12 +363,12 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | $approvedcolumn = self::get_approved_column( $form['id'] ); |
| 365 | 365 | |
| 366 | - /** |
|
| 367 | - * If the form doesn't contain the approve field, don't assume anything. |
|
| 368 | - */ |
|
| 369 | - if( empty( $approvedcolumn ) ) { |
|
| 370 | - return; |
|
| 371 | - } |
|
| 366 | + /** |
|
| 367 | + * If the form doesn't contain the approve field, don't assume anything. |
|
| 368 | + */ |
|
| 369 | + if( empty( $approvedcolumn ) ) { |
|
| 370 | + return; |
|
| 371 | + } |
|
| 372 | 372 | |
| 373 | 373 | $entry = GFAPI::get_entry( $entry_id ); |
| 374 | 374 | |
@@ -481,17 +481,17 @@ discard block |
||
| 481 | 481 | */ |
| 482 | 482 | static public function get_approved_column( $form ) { |
| 483 | 483 | |
| 484 | - if( empty( $form ) ) { |
|
| 485 | - return null; |
|
| 486 | - } |
|
| 484 | + if( empty( $form ) ) { |
|
| 485 | + return null; |
|
| 486 | + } |
|
| 487 | 487 | |
| 488 | - if( !is_array( $form ) ) { |
|
| 489 | - $form = GVCommon::get_form( $form ); |
|
| 490 | - } |
|
| 488 | + if( !is_array( $form ) ) { |
|
| 489 | + $form = GVCommon::get_form( $form ); |
|
| 490 | + } |
|
| 491 | 491 | |
| 492 | 492 | foreach( $form['fields'] as $key => $field ) { |
| 493 | 493 | |
| 494 | - $field = (array) $field; |
|
| 494 | + $field = (array) $field; |
|
| 495 | 495 | |
| 496 | 496 | if( !empty( $field['gravityview_approved'] ) ) { |
| 497 | 497 | if( !empty($field['inputs'][0]['id']) ) { |
@@ -499,14 +499,14 @@ discard block |
||
| 499 | 499 | } |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | - // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
| 503 | - if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
| 504 | - foreach ( $field['inputs'] as $key2 => $input ) { |
|
| 505 | - if ( strtolower( $input['label'] ) == 'approved' ) { |
|
| 506 | - return $input['id']; |
|
| 507 | - } |
|
| 508 | - } |
|
| 509 | - } |
|
| 502 | + // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
| 503 | + if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
| 504 | + foreach ( $field['inputs'] as $key2 => $input ) { |
|
| 505 | + if ( strtolower( $input['label'] ) == 'approved' ) { |
|
| 506 | + return $input['id']; |
|
| 507 | + } |
|
| 508 | + } |
|
| 509 | + } |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | return null; |