@@ -13,7 +13,7 @@ |
||
| 13 | 13 | * @see GFCommon::get_field_filter_settings Gravity Forms suggests checkboxes should just be "contains" |
| 14 | 14 | * @var array |
| 15 | 15 | */ |
| 16 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
| 16 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
| 17 | 17 | |
| 18 | 18 | var $is_searchable = true; |
| 19 | 19 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | var $is_searchable = true; |
| 13 | 13 | |
| 14 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
| 14 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
| 15 | 15 | |
| 16 | 16 | var $_gf_field_class_name = 'GF_Field_Radio'; |
| 17 | 17 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | // Set the $_field_id var |
| 41 | 41 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type ); |
| 42 | 42 | |
| 43 | - if( $this->is_choice_value_enabled() ) { |
|
| 44 | - $field_options['choice_display'] = array( |
|
| 43 | + if ( $this->is_choice_value_enabled() ) { |
|
| 44 | + $field_options[ 'choice_display' ] = array( |
|
| 45 | 45 | 'type' => 'radio', |
| 46 | 46 | 'value' => 'value', |
| 47 | 47 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function get_content( $output, $entry = array(), $field_settings = array(), $field = array() ) { |
| 60 | 60 | |
| 61 | 61 | /** Overridden by a template. */ |
| 62 | - if( ! empty( $field['field_path'] ) ) { return $output; } |
|
| 62 | + if ( ! empty( $field[ 'field_path' ] ) ) { return $output; } |
|
| 63 | 63 | |
| 64 | 64 | return $this->get_string_from_value( $output ); |
| 65 | 65 | } |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | switch ( intval( $value ) ) { |
| 79 | 79 | case self::NOT_FULFILLED: |
| 80 | 80 | default: |
| 81 | - $return = __('Not Fulfilled', 'gravityview'); |
|
| 81 | + $return = __( 'Not Fulfilled', 'gravityview' ); |
|
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case self::FULFILLED: |
| 85 | - $return = __('Fulfilled', 'gravityview'); |
|
| 85 | + $return = __( 'Fulfilled', 'gravityview' ); |
|
| 86 | 86 | break; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @return string Original text if {is_fulfilled} isn't found. Otherwise, "Not Fulfilled" or "Fulfilled" |
| 104 | 104 | */ |
| 105 | - public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
| 105 | + public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
| 106 | 106 | |
| 107 | 107 | $return = $text; |
| 108 | 108 | |
| 109 | 109 | foreach ( $matches as $match ) { |
| 110 | 110 | |
| 111 | - $full_tag = $match[0]; |
|
| 111 | + $full_tag = $match[ 0 ]; |
|
| 112 | 112 | |
| 113 | 113 | $fulfilled = rgar( $entry, 'is_fulfilled' ); |
| 114 | 114 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | var $is_searchable = true; |
| 13 | 13 | |
| 14 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
| 14 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
| 15 | 15 | |
| 16 | 16 | var $_gf_field_class_name = 'GF_Field_Post_Category'; |
| 17 | 17 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $entry = GFAPI::get_entry( $entry_id ); |
| 45 | 45 | $post_id = rgar( $entry, 'post_id' ); |
| 46 | 46 | |
| 47 | - if( empty( $post_id ) ) { |
|
| 47 | + if ( empty( $post_id ) ) { |
|
| 48 | 48 | return false; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $post_category_fields = GFAPI::get_fields_by_type( $form, 'post_category' ); |
| 54 | 54 | |
| 55 | - if( $post_category_fields ) { |
|
| 55 | + if ( $post_category_fields ) { |
|
| 56 | 56 | |
| 57 | 57 | $updated_categories = array(); |
| 58 | 58 | |
@@ -119,18 +119,18 @@ discard block |
||
| 119 | 119 | * |
| 120 | 120 | * @return mixed |
| 121 | 121 | */ |
| 122 | - function edit_entry_post_category_choices( $choices, $field, $form_id ) { |
|
| 122 | + function edit_entry_post_category_choices( $choices, $field, $form_id ) { |
|
| 123 | 123 | |
| 124 | - $entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry(); |
|
| 124 | + $entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry(); |
|
| 125 | 125 | |
| 126 | 126 | // $entry['post_id'] should always be set, but we check to make sure. |
| 127 | - if( $entry && isset( $entry['post_id'] ) && $post_id = $entry['post_id'] ) { |
|
| 127 | + if ( $entry && isset( $entry[ 'post_id' ] ) && $post_id = $entry[ 'post_id' ] ) { |
|
| 128 | 128 | |
| 129 | 129 | $post_categories = wp_get_post_categories( $post_id, array( 'fields' => 'ids' ) ); |
| 130 | 130 | |
| 131 | 131 | // Always use the live value |
| 132 | 132 | foreach ( $choices as &$choice ) { |
| 133 | - $choice['isSelected'] = in_array( $choice['value'], array_values( $post_categories ) ); |
|
| 133 | + $choice[ 'isSelected' ] = in_array( $choice[ 'value' ], array_values( $post_categories ) ); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -139,12 +139,12 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
| 141 | 141 | |
| 142 | - if( 'edit' === $context ) { |
|
| 142 | + if ( 'edit' === $context ) { |
|
| 143 | 143 | return $field_options; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $this->add_field_support('dynamic_data', $field_options ); |
|
| 147 | - $this->add_field_support('link_to_term', $field_options ); |
|
| 146 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
| 147 | + $this->add_field_support( 'link_to_term', $field_options ); |
|
| 148 | 148 | |
| 149 | 149 | return $field_options; |
| 150 | 150 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | var $is_searchable = true; |
| 16 | 16 | |
| 17 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
| 17 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
| 18 | 18 | |
| 19 | 19 | var $_gf_field_class_name = 'GF_Field_Post_Tags'; |
| 20 | 20 | |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
| 29 | 29 | |
| 30 | - if( 'edit' === $context ) { |
|
| 30 | + if ( 'edit' === $context ) { |
|
| 31 | 31 | return $field_options; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $this->add_field_support('dynamic_data', $field_options ); |
|
| 35 | - $this->add_field_support('link_to_term', $field_options ); |
|
| 34 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
| 35 | + $this->add_field_support( 'link_to_term', $field_options ); |
|
| 36 | 36 | |
| 37 | 37 | return $field_options; |
| 38 | 38 | } |
@@ -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-radio.php - No choices for field' ); |
|
| 13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
| 14 | + do_action( 'gravityview_log_debug', 'search-field-radio.php - No choices for field' ); |
|
| 15 | 15 | return; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | ?> |
| 19 | 19 | <div class="gv-search-box gv-search-field-radio"> |
| 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 | - <?php foreach( $search_field['choices'] as $choice ) { ?> |
|
| 24 | + <?php foreach ( $search_field[ 'choices' ] as $choice ) { ?> |
|
| 25 | 25 | |
| 26 | - <label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio"> |
|
| 27 | - <input type="radio" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php checked( $choice['value'], $search_field['value'], true ); ?>> |
|
| 28 | - <?php echo esc_html( $choice['text'] ); ?> |
|
| 26 | + <label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio"> |
|
| 27 | + <input type="radio" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php checked( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>> |
|
| 28 | + <?php echo esc_html( $choice[ 'text' ] ); ?> |
|
| 29 | 29 | </label> |
| 30 | 30 | |
| 31 | 31 | <?php } ?> |
@@ -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 gv-search-field-text gv-search-field-search_all"> |
| 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> |
@@ -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-checkbox.php - No choices for field' ); |
|
| 13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
| 14 | + do_action( 'gravityview_log_debug', 'search-field-checkbox.php - No choices for field' ); |
|
| 15 | 15 | return; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | ?> |
| 19 | 19 | <div class="gv-search-box gv-search-field-checkbox"> |
| 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 | - <?php foreach( $search_field['choices'] as $choice ) { ?> |
|
| 24 | + <?php foreach ( $search_field[ 'choices' ] as $choice ) { ?> |
|
| 25 | 25 | |
| 26 | - <label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio"> |
|
| 27 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>[]" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true, 'checked' ); ?>> |
|
| 28 | - <?php echo esc_html( $choice['text'] ); ?> |
|
| 26 | + <label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio"> |
|
| 27 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true, 'checked' ); ?>> |
|
| 28 | + <?php echo esc_html( $choice[ 'text' ] ); ?> |
|
| 29 | 29 | </label> |
| 30 | 30 | |
| 31 | 31 | <?php } ?> |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div class="gv-search-box gv-search-field-single_checkbox"> |
| 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 |