@@ -10,22 +10,22 @@ |
||
10 | 10 | $search_field = $gravityview_view->search_field; |
11 | 11 | |
12 | 12 | // Make sure that there are choices to display |
13 | -if( empty( $search_field['choices'] ) ) { |
|
14 | - do_action('gravityview_log_debug', 'search-field-select.php - No choices for field' ); |
|
13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
14 | + do_action( 'gravityview_log_debug', 'search-field-select.php - No choices for field' ); |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | 18 | ?> |
19 | 19 | <div class="gv-search-box"> |
20 | - <?php if( ! gv_empty( $search_field['label'], false ) ) { ?> |
|
21 | - <label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label> |
|
20 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?> |
|
21 | + <label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
22 | 22 | <?php } ?> |
23 | 23 | <p> |
24 | - <select name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"> |
|
25 | - <option value="" <?php selected( '', $search_field['value'], true ); ?>>—</option> |
|
24 | + <select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"> |
|
25 | + <option value="" <?php selected( '', $search_field[ 'value' ], true ); ?>>—</option> |
|
26 | 26 | <?php |
27 | - foreach( $search_field['choices'] as $choice ) : ?> |
|
28 | - <option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option> |
|
27 | + foreach ( $search_field[ 'choices' ] as $choice ) : ?> |
|
28 | + <option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php selected( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option> |
|
29 | 29 | <?php endforeach; ?> |
30 | 30 | </select> |
31 | 31 | </p> |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class="gv-search-box"> |
16 | 16 | <div class="gv-search"> |
17 | - <?php if( ! gv_empty( $label, false ) ) { ?> |
|
17 | + <?php if ( ! gv_empty( $label, false ) ) { ?> |
|
18 | 18 | <label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
19 | 19 | <?php } ?> |
20 | 20 | <p><input type="text" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p> |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class="gv-search-box"> |
15 | 15 | <div class="gv-search"> |
16 | - <?php if( ! gv_empty( $label, false ) ) { ?> |
|
16 | + <?php if ( ! gv_empty( $label, false ) ) { ?> |
|
17 | 17 | <label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
18 | 18 | <?php } ?> |
19 | 19 | <p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p> |
@@ -11,10 +11,10 @@ |
||
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div class="gv-search-box"> |
14 | - <?php if( ! gv_empty( $search_field['label'], false ) ) { ?> |
|
15 | - <label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label> |
|
14 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?> |
|
15 | + <label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
16 | 16 | <?php } ?> |
17 | 17 | <p> |
18 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"> |
|
18 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"> |
|
19 | 19 | </p> |
20 | 20 | </div> |
21 | 21 | \ No newline at end of file |
@@ -10,22 +10,22 @@ |
||
10 | 10 | $search_field = $gravityview_view->search_field; |
11 | 11 | |
12 | 12 | // Make sure that there are choices to display |
13 | -if( empty( $search_field['choices'] ) ) { |
|
14 | - do_action('gravityview_log_debug', 'search-field-multiselect.php - No choices for field' ); |
|
13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
14 | + do_action( 'gravityview_log_debug', 'search-field-multiselect.php - No choices for field' ); |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | 18 | ?> |
19 | 19 | <div class="gv-search-box"> |
20 | - <?php if( ! gv_empty( $search_field['label'], false ) ) { ?> |
|
21 | - <label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label> |
|
20 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?> |
|
21 | + <label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
22 | 22 | <?php } ?> |
23 | 23 | <p> |
24 | - <select name="<?php echo esc_attr( $search_field['name'] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" multiple> |
|
25 | - <option value="" <?php gv_selected( '', $search_field['value'], true ); ?>>—</option> |
|
24 | + <select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" multiple> |
|
25 | + <option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>>—</option> |
|
26 | 26 | <?php |
27 | - foreach( $search_field['choices'] as $choice ) : ?> |
|
28 | - <option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option> |
|
27 | + foreach ( $search_field[ 'choices' ] as $choice ) : ?> |
|
28 | + <option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option> |
|
29 | 29 | <?php endforeach; ?> |
30 | 30 | </select> |
31 | 31 | </p> |
@@ -12,8 +12,8 @@ |
||
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class="gv-search-box"> |
15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio"> |
|
16 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>> |
|
17 | - <?php if( ! gv_empty( $search_field['label'], false ) ) { echo esc_html( $search_field['label'] ); } ?> |
|
15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" class="gv-check-radio"> |
|
16 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" <?php checked( '1', $search_field[ 'value' ], true ); ?>> |
|
17 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { echo esc_html( $search_field[ 'label' ] ); } ?> |
|
18 | 18 | </label> |
19 | 19 | </div> |
20 | 20 | \ No newline at end of file |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | */ |
24 | 24 | do_action( 'gravityview_search_widget_fields_before', $this ); |
25 | 25 | |
26 | - foreach( $this->search_fields as $search_field ) { |
|
26 | + foreach ( $this->search_fields as $search_field ) { |
|
27 | 27 | $gravityview_view->search_field = $search_field; |
28 | - $this->render( 'search-field', $search_field['input'], false ); |
|
28 | + $this->render( 'search-field', $search_field[ 'input' ], false ); |
|
29 | 29 | |
30 | 30 | // show/hide the search button if there are input type fields |
31 | - if( !$has_inputs && $search_field['input'] != 'link' ) { |
|
31 | + if ( ! $has_inputs && $search_field[ 'input' ] != 'link' ) { |
|
32 | 32 | $has_inputs = true; |
33 | 33 | } |
34 | 34 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | do_action( 'gravityview_search_widget_fields_after', $this ); |
41 | 41 | |
42 | - if( $has_inputs ) { ?> |
|
42 | + if ( $has_inputs ) { ?> |
|
43 | 43 | <div class="gv-search-box gv-search-box-submit"> |
44 | 44 | <?php |
45 | 45 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | function __construct() { |
19 | 19 | |
20 | - $this->widget_description = __('Insert custom text or HTML as a widget', 'gravityview' ); |
|
20 | + $this->widget_description = __( 'Insert custom text or HTML as a widget', 'gravityview' ); |
|
21 | 21 | |
22 | 22 | $default_values = array( |
23 | 23 | 'header' => 1, |
@@ -42,39 +42,39 @@ discard block |
||
42 | 42 | ), |
43 | 43 | ); |
44 | 44 | |
45 | - parent::__construct( __( 'Custom Content', 'gravityview' ) , 'custom_content', $default_values, $settings ); |
|
45 | + parent::__construct( __( 'Custom Content', 'gravityview' ), 'custom_content', $default_values, $settings ); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
48 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
49 | 49 | |
50 | - if( !$this->pre_render_frontend() ) { |
|
50 | + if ( ! $this->pre_render_frontend() ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | - if( !empty( $widget_args['title'] ) ) { |
|
55 | - echo $widget_args['title']; |
|
54 | + if ( ! empty( $widget_args[ 'title' ] ) ) { |
|
55 | + echo $widget_args[ 'title' ]; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | 59 | // Make sure the class is loaded in DataTables |
60 | - if( !class_exists( 'GFFormDisplay' ) ) { |
|
60 | + if ( ! class_exists( 'GFFormDisplay' ) ) { |
|
61 | 61 | include_once( GFCommon::get_base_path() . '/form_display.php' ); |
62 | 62 | } |
63 | 63 | |
64 | - $widget_args['content'] = trim( rtrim( $widget_args['content'] ) ); |
|
64 | + $widget_args[ 'content' ] = trim( rtrim( $widget_args[ 'content' ] ) ); |
|
65 | 65 | |
66 | 66 | // No custom content |
67 | - if( empty( $widget_args['content'] ) ) { |
|
68 | - do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: No content.', get_class($this)) ); |
|
67 | + if ( empty( $widget_args[ 'content' ] ) ) { |
|
68 | + do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: No content.', get_class( $this ) ) ); |
|
69 | 69 | return; |
70 | 70 | } |
71 | 71 | |
72 | 72 | // Add paragraphs? |
73 | - if( !empty( $widget_args['wpautop'] ) ) { |
|
74 | - $widget_args['content'] = wpautop( $widget_args['content'] ); |
|
73 | + if ( ! empty( $widget_args[ 'wpautop' ] ) ) { |
|
74 | + $widget_args[ 'content' ] = wpautop( $widget_args[ 'content' ] ); |
|
75 | 75 | } |
76 | 76 | |
77 | - $content = $widget_args['content']; |
|
77 | + $content = $widget_args[ 'content' ]; |
|
78 | 78 | |
79 | 79 | $content = GravityView_Merge_Tags::replace_variables( $content ); |
80 | 80 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | |
85 | 85 | |
86 | 86 | // Add custom class |
87 | - $class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
87 | + $class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
88 | 88 | $class = gravityview_sanitize_html_class( $class ); |
89 | 89 | |
90 | - echo '<div class="gv-widget-custom-content '.$class.'">'. $content .'</div>'; |
|
90 | + echo '<div class="gv-widget-custom-content ' . $class . '">' . $content . '</div>'; |
|
91 | 91 | |
92 | 92 | } |
93 | 93 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | function __construct() { |
18 | 18 | |
19 | - $this->widget_description = __('Summary of the number of visible entries out of the total results.', 'gravityview' ); |
|
19 | + $this->widget_description = __( 'Summary of the number of visible entries out of the total results.', 'gravityview' ); |
|
20 | 20 | |
21 | 21 | $default_values = array( |
22 | 22 | 'header' => 1, |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | |
26 | 26 | $settings = array(); |
27 | 27 | |
28 | - parent::__construct( __( 'Show Pagination Info', 'gravityview' ) , 'page_info', $default_values, $settings ); |
|
28 | + parent::__construct( __( 'Show Pagination Info', 'gravityview' ), 'page_info', $default_values, $settings ); |
|
29 | 29 | } |
30 | 30 | |
31 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
31 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
32 | 32 | $gravityview_view = GravityView_View::getInstance(); |
33 | 33 | |
34 | - if( !$this->pre_render_frontend() ) { |
|
34 | + if ( ! $this->pre_render_frontend() ) { |
|
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
38 | - if( !empty( $widget_args['title'] ) ) { |
|
39 | - echo $widget_args['title']; |
|
38 | + if ( ! empty( $widget_args[ 'title' ] ) ) { |
|
39 | + echo $widget_args[ 'title' ]; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $pagination_counts = $gravityview_view->getPaginationCounts(); |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | |
46 | 46 | $output = ''; |
47 | 47 | |
48 | - if( ! empty( $pagination_counts ) ) { |
|
48 | + if ( ! empty( $pagination_counts ) ) { |
|
49 | 49 | |
50 | - $first = $pagination_counts['first']; |
|
51 | - $last = $pagination_counts['last']; |
|
52 | - $total = $pagination_counts['total']; |
|
50 | + $first = $pagination_counts[ 'first' ]; |
|
51 | + $last = $pagination_counts[ 'last' ]; |
|
52 | + $total = $pagination_counts[ 'total' ]; |
|
53 | 53 | |
54 | - $class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
54 | + $class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
55 | 55 | $class = gravityview_sanitize_html_class( $class ); |
56 | 56 | |
57 | - $output = '<div class="gv-widget-pagination '.$class.'"><p>'. sprintf(__( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>'; |
|
57 | + $output = '<div class="gv-widget-pagination ' . $class . '"><p>' . sprintf( __( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |