@@ -10,12 +10,12 @@ |
||
| 10 | 10 | |
| 11 | 11 | function render_input( $override_input = null ) { |
| 12 | 12 | |
| 13 | - if( isset( $override_input ) ) { |
|
| 13 | + if ( isset( $override_input ) ) { |
|
| 14 | 14 | echo $override_input; |
| 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 ); ?>" /> |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | function render_setting( $override_input = NULL ) { |
| 17 | 17 | |
| 18 | - if( $this->get_field_left_label() ) { ?> |
|
| 18 | + if ( $this->get_field_left_label() ) { ?> |
|
| 19 | 19 | |
| 20 | 20 | <td scope="row"> |
| 21 | 21 | <label for="<?php echo $this->get_field_id(); ?>"> |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function render_input( $override_input = NULL ) { |
| 45 | - if( isset( $override_input ) ) { |
|
| 45 | + if ( isset( $override_input ) ) { |
|
| 46 | 46 | echo $override_input; |
| 47 | 47 | return; |
| 48 | 48 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | ?> |
| 9 | 9 | <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php |
| 10 | 10 | |
| 11 | - echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
|
| 11 | + echo '<span class="gv-label">' . $this->get_field_label() . '</span>'; |
|
| 12 | 12 | |
| 13 | 13 | echo $this->get_tooltip() . $this->get_field_desc(); |
| 14 | 14 | |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | function render_input( $override_input = null ) { |
| 23 | - if( isset( $override_input ) ) { |
|
| 23 | + if ( isset( $override_input ) ) { |
|
| 24 | 24 | echo $override_input; |
| 25 | 25 | return; |
| 26 | 26 | } |
| 27 | 27 | ?> |
| 28 | 28 | <select name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>"> |
| 29 | - <?php foreach( $this->field['options'] as $value => $label ) : ?> |
|
| 29 | + <?php foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
| 30 | 30 | <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->value, true ); ?>><?php echo esc_html( $label ); ?></option> |
| 31 | 31 | <?php endforeach; ?> |
| 32 | 32 | </select> |
@@ -3,13 +3,13 @@ discard block |
||
| 3 | 3 | * number input type |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -if( !class_exists('GravityView_FieldType_text') ) { |
|
| 6 | +if ( ! class_exists( 'GravityView_FieldType_text' ) ) { |
|
| 7 | 7 | include_once( GRAVITYVIEW_DIR . 'includes/admin/field-types/type_text.php' ); |
| 8 | 8 | } |
| 9 | 9 | class GravityView_FieldType_number extends GravityView_FieldType_text { |
| 10 | 10 | |
| 11 | 11 | function render_input( $override_input = null ) { |
| 12 | - if( isset( $override_input ) ) { |
|
| 12 | + if ( isset( $override_input ) ) { |
|
| 13 | 13 | echo $override_input; |
| 14 | 14 | return; |
| 15 | 15 | } |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $show_mt = $this->show_merge_tags(); |
| 20 | 20 | |
| 21 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 21 | + if ( $show_mt && $this->field[ 'merge_tags' ] !== false || $this->field[ 'merge_tags' ] === 'force' ) { |
|
| 22 | 22 | $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
| 23 | 23 | } |
| 24 | - $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
| 24 | + $class .= ! empty( $this->field[ 'class' ] ) ? $this->field[ 'class' ] : 'widefat'; |
|
| 25 | 25 | |
| 26 | 26 | ?> |
| 27 | 27 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="number" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | $defaults = self::get_field_defaults(); |
| 34 | 34 | |
| 35 | 35 | // Backward compatibility |
| 36 | - if( !empty( $field['choices'] ) ) { |
|
| 37 | - $field['options'] = $field['choices']; |
|
| 38 | - unset( $field['choices'] ); |
|
| 36 | + if ( ! empty( $field[ 'choices' ] ) ) { |
|
| 37 | + $field[ 'options' ] = $field[ 'choices' ]; |
|
| 38 | + unset( $field[ 'choices' ] ); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $this->field = wp_parse_args( $field, $defaults ); |
|
| 41 | + $this->field = wp_parse_args( $field, $defaults ); |
|
| 42 | 42 | |
| 43 | - $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value; |
|
| 43 | + $this->value = is_null( $curr_value ) ? $this->field[ 'value' ] : $curr_value; |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | function get_tooltip() { |
| 81 | - if( !function_exists('gform_tooltip') ) { |
|
| 81 | + if ( ! function_exists( 'gform_tooltip' ) ) { |
|
| 82 | 82 | return NULL; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - return !empty( $this->field['tooltip'] ) ? ' '.gform_tooltip( $this->field['tooltip'] , false, true ) : NULL; |
|
| 85 | + return ! empty( $this->field[ 'tooltip' ] ) ? ' ' . gform_tooltip( $this->field[ 'tooltip' ], false, true ) : NULL; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | * @return string |
| 91 | 91 | */ |
| 92 | 92 | function get_field_id() { |
| 93 | - if( isset( $this->field['id'] ) ) { |
|
| 94 | - return esc_attr( $this->field['id'] ); |
|
| 93 | + if ( isset( $this->field[ 'id' ] ) ) { |
|
| 94 | + return esc_attr( $this->field[ 'id' ] ); |
|
| 95 | 95 | } |
| 96 | 96 | return esc_attr( sanitize_html_class( $this->name ) ); |
| 97 | 97 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @return string |
| 102 | 102 | */ |
| 103 | 103 | function get_field_label() { |
| 104 | - return esc_html( trim( $this->field['label'] ) ); |
|
| 104 | + return esc_html( trim( $this->field[ 'label' ] ) ); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | 114 | function get_field_left_label() { |
| 115 | - return ! empty( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL; |
|
| 115 | + return ! empty( $this->field[ 'left_label' ] ) ? esc_html( trim( $this->field[ 'left_label' ] ) ) : NULL; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @return string |
| 121 | 121 | */ |
| 122 | 122 | function get_label_class() { |
| 123 | - return 'gv-label-'. sanitize_html_class( $this->field['type'] ); |
|
| 123 | + return 'gv-label-' . sanitize_html_class( $this->field[ 'type' ] ); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @return string |
| 130 | 130 | */ |
| 131 | 131 | function get_field_desc() { |
| 132 | - return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : ''; |
|
| 132 | + return ! empty( $this->field[ 'desc' ] ) ? '<span class="howto">' . $this->field[ 'desc' ] . '</span>' : ''; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | function render_setting( $override_input = NULL ) { |
| 164 | 164 | |
| 165 | - if( !empty( $this->field['full_width'] ) ) { ?> |
|
| 165 | + if ( ! empty( $this->field[ 'full_width' ] ) ) { ?> |
|
| 166 | 166 | <th scope="row" colspan="2"> |
| 167 | 167 | <div> |
| 168 | 168 | <label for="<?php echo $this->get_field_id(); ?>"> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 ); |
| 12 | 12 | |
| 13 | 13 | // Add script to enable edit link |
| 14 | - add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script') ); |
|
| 14 | + add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script' ) ); |
|
| 15 | 15 | |
| 16 | 16 | } |
| 17 | 17 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function add_edit_script() { |
| 27 | 27 | |
| 28 | 28 | // We're on a single entry page, or at least not the Entries page. |
| 29 | - if( !empty( $_GET['view'] ) && $_GET['view'] !== 'entries' ) { return; } |
|
| 29 | + if ( ! empty( $_GET[ 'view' ] ) && $_GET[ 'view' ] !== 'entries' ) { return; } |
|
| 30 | 30 | ?> |
| 31 | 31 | <script> |
| 32 | 32 | jQuery( document ).ready( function( $ ) { |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | 'page' => 'gf_entries', |
| 57 | 57 | 'view' => 'entry', |
| 58 | 58 | 'id' => (int)$form_id, |
| 59 | - 'lid' => (int)$lead["id"], |
|
| 59 | + 'lid' => (int)$lead[ "id" ], |
|
| 60 | 60 | 'screen_mode' => 'edit', |
| 61 | 61 | ); |
| 62 | 62 | ?> |
| 63 | 63 | |
| 64 | 64 | <span class="edit edit_entry"> |
| 65 | 65 | | |
| 66 | - <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview'); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page='.$query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a> |
|
| 66 | + <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview' ); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page=' . $query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a> |
|
| 67 | 67 | </span> |
| 68 | 68 | <?php |
| 69 | 69 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @copydoc GravityView_Entry_Link_Shortcode::shortcode |
| 73 | 73 | */ |
| 74 | 74 | public function edit_shortcode( $atts, $content = null, $context = 'gv_edit_entry_link' ) { |
| 75 | - $atts['action'] = 'edit'; |
|
| 75 | + $atts[ 'action' ] = 'edit'; |
|
| 76 | 76 | |
| 77 | 77 | return $this->shortcode( $atts, $content, $context ); |
| 78 | 78 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @copydoc GravityView_Entry_Link_Shortcode::shortcode |
| 86 | 86 | */ |
| 87 | 87 | public function delete_shortcode( $atts, $content = null, $context = 'gv_delete_entry_link' ) { |
| 88 | - $atts['action'] = 'delete'; |
|
| 88 | + $atts[ 'action' ] = 'delete'; |
|
| 89 | 89 | |
| 90 | 90 | return $this->shortcode( $atts, $content, $context ); |
| 91 | 91 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $this->settings = shortcode_atts( self::$defaults, $atts, $context ); |
| 128 | 128 | |
| 129 | - $this->view_id = empty( $this->settings['view_id'] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings['view_id'] ); |
|
| 129 | + $this->view_id = empty( $this->settings[ 'view_id' ] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings[ 'view_id' ] ); |
|
| 130 | 130 | |
| 131 | 131 | if ( empty( $this->view_id ) ) { |
| 132 | 132 | do_action( 'gravityview_log_error', __METHOD__ . ' A View ID was not defined and we are not inside a View' ); |
@@ -134,12 +134,12 @@ discard block |
||
| 134 | 134 | return null; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $this->entry = $this->get_entry( $this->settings['entry_id'] ); |
|
| 137 | + $this->entry = $this->get_entry( $this->settings[ 'entry_id' ] ); |
|
| 138 | 138 | |
| 139 | 139 | do_action( 'gravityview_log_debug', __METHOD__ . ' ' . $context . ' $atts: ', $atts ); |
| 140 | 140 | |
| 141 | 141 | if ( ! $this->has_cap() ) { |
| 142 | - do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the capability to ' . esc_attr( $this->settings['action'] ) . ' this entry: ' . $this->entry['id'] ); |
|
| 142 | + do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the capability to ' . esc_attr( $this->settings[ 'action' ] ) . ' this entry: ' . $this->entry[ 'id' ] ); |
|
| 143 | 143 | |
| 144 | 144 | return null; |
| 145 | 145 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // Get just the URL, not the tag |
| 156 | - if ( 'url' === $this->settings['return'] ) { |
|
| 156 | + if ( 'url' === $this->settings[ 'return' ] ) { |
|
| 157 | 157 | return $url; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -174,13 +174,13 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | private function get_link_atts() { |
| 176 | 176 | |
| 177 | - wp_parse_str( $this->settings['link_atts'], $link_atts ); |
|
| 177 | + wp_parse_str( $this->settings[ 'link_atts' ], $link_atts ); |
|
| 178 | 178 | |
| 179 | - if ( 'delete' === $this->settings['action'] ) { |
|
| 180 | - $link_atts['onclick'] = isset( $link_atts['onclick'] ) ? $link_atts['onclick'] : GravityView_Delete_Entry::get_confirm_dialog(); |
|
| 179 | + if ( 'delete' === $this->settings[ 'action' ] ) { |
|
| 180 | + $link_atts[ 'onclick' ] = isset( $link_atts[ 'onclick' ] ) ? $link_atts[ 'onclick' ] : GravityView_Delete_Entry::get_confirm_dialog(); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - return (array) $link_atts; |
|
| 183 | + return (array)$link_atts; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | return $content; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - switch ( $this->settings['action'] ) { |
|
| 203 | + switch ( $this->settings[ 'action' ] ) { |
|
| 204 | 204 | case 'edit': |
| 205 | 205 | $anchor_text = __( 'Edit Entry', 'gravityview' ); |
| 206 | 206 | break; |
@@ -228,9 +228,9 @@ discard block |
||
| 228 | 228 | private function get_url() { |
| 229 | 229 | |
| 230 | 230 | // if post_id is not defined, default to view_id |
| 231 | - $post_id = empty( $this->settings['post_id'] ) ? $this->view_id : absint( $this->settings['post_id'] ); |
|
| 231 | + $post_id = empty( $this->settings[ 'post_id' ] ) ? $this->view_id : absint( $this->settings[ 'post_id' ] ); |
|
| 232 | 232 | |
| 233 | - switch ( $this->settings['action'] ) { |
|
| 233 | + switch ( $this->settings[ 'action' ] ) { |
|
| 234 | 234 | case 'edit': |
| 235 | 235 | $url = GravityView_Edit_Entry::get_edit_link( $this->entry, $this->view_id, $post_id ); |
| 236 | 236 | break; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | private function has_cap() { |
| 257 | 257 | |
| 258 | - switch ( $this->settings['action'] ) { |
|
| 258 | + switch ( $this->settings[ 'action' ] ) { |
|
| 259 | 259 | case 'edit': |
| 260 | 260 | $has_cap = GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry, $this->view_id ); |
| 261 | 261 | break; |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | private function maybe_add_field_values_query_args( $url ) { |
| 322 | 322 | |
| 323 | - if ( $url && ! empty( $this->settings['field_values'] ) ) { |
|
| 323 | + if ( $url && ! empty( $this->settings[ 'field_values' ] ) ) { |
|
| 324 | 324 | |
| 325 | - wp_parse_str( $this->settings['field_values'], $field_values ); |
|
| 325 | + wp_parse_str( $this->settings[ 'field_values' ], $field_values ); |
|
| 326 | 326 | |
| 327 | 327 | $url = add_query_arg( $field_values, $url ); |
| 328 | 328 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | function load() { |
| 26 | 26 | |
| 27 | - if( !is_admin() ) { |
|
| 27 | + if ( ! is_admin() ) { |
|
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 ); |
| 39 | 39 | |
| 40 | 40 | // add tooltips |
| 41 | - add_filter( 'gravityview_tooltips', array( $this, 'tooltips') ); |
|
| 41 | + add_filter( 'gravityview_tooltips', array( $this, 'tooltips' ) ); |
|
| 42 | 42 | |
| 43 | 43 | // custom fields' options for zone EDIT |
| 44 | 44 | add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 5 ); |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
| 54 | 54 | |
| 55 | - if( $zone !== 'edit' ) { |
|
| 55 | + if ( $zone !== 'edit' ) { |
|
| 56 | 56 | |
| 57 | - $entry_default_fields['edit_link'] = array( |
|
| 58 | - 'label' => __('Edit Entry', 'gravityview'), |
|
| 57 | + $entry_default_fields[ 'edit_link' ] = array( |
|
| 58 | + 'label' => __( 'Edit Entry', 'gravityview' ), |
|
| 59 | 59 | 'type' => 'edit_link', |
| 60 | - 'desc' => __('A link to edit the entry. Visible based on View settings.', 'gravityview'), |
|
| 60 | + 'desc' => __( 'A link to edit the entry. Visible based on View settings.', 'gravityview' ), |
|
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | } |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | $caps = $visibility_caps; |
| 82 | 82 | |
| 83 | 83 | // If we're configuring fields in the edit context, we want a limited selection |
| 84 | - if( $context === 'edit' ) { |
|
| 84 | + if ( $context === 'edit' ) { |
|
| 85 | 85 | |
| 86 | 86 | // Remove other built-in caps. |
| 87 | - unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] ); |
|
| 87 | + unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] ); |
|
| 88 | 88 | |
| 89 | - $caps['read'] = _x('Entry Creator','User capability', 'gravityview'); |
|
| 89 | + $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' ); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | return $caps; |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
| 105 | 105 | |
| 106 | 106 | // Always a link, never a filter |
| 107 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
| 107 | + unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] ); |
|
| 108 | 108 | |
| 109 | 109 | // Edit Entry link should only appear to visitors capable of editing entries |
| 110 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
| 110 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
| 111 | 111 | |
| 112 | - $add_option['edit_link'] = array( |
|
| 112 | + $add_option[ 'edit_link' ] = array( |
|
| 113 | 113 | 'type' => 'text', |
| 114 | 114 | 'label' => __( 'Edit Link Text', 'gravityview' ), |
| 115 | 115 | 'desc' => NULL, |
| 116 | - 'value' => __('Edit Entry', 'gravityview'), |
|
| 116 | + 'value' => __( 'Edit Entry', 'gravityview' ), |
|
| 117 | 117 | 'merge_tags' => true, |
| 118 | 118 | ); |
| 119 | 119 | |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $return = $tooltips; |
| 131 | 131 | |
| 132 | - $return['allow_edit_cap'] = array( |
|
| 133 | - 'title' => __('Limiting Edit Access', 'gravityview'), |
|
| 134 | - 'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'), |
|
| 132 | + $return[ 'allow_edit_cap' ] = array( |
|
| 133 | + 'title' => __( 'Limiting Edit Access', 'gravityview' ), |
|
| 134 | + 'value' => __( 'Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview' ), |
|
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | return $return; |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
| 150 | 150 | |
| 151 | 151 | // We only want to modify the settings for the edit context |
| 152 | - if( 'edit' !== $context ) { |
|
| 152 | + if ( 'edit' !== $context ) { |
|
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * @since 1.8.4 |
| 156 | 156 | */ |
| 157 | - $field_options['new_window'] = array( |
|
| 157 | + $field_options[ 'new_window' ] = array( |
|
| 158 | 158 | 'type' => 'checkbox', |
| 159 | 159 | 'label' => __( 'Open link in a new tab or window?', 'gravityview' ), |
| 160 | 160 | 'value' => false, |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // Entry field is only for logged in users |
| 167 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
| 167 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
| 168 | 168 | |
| 169 | 169 | $add_options = array( |
| 170 | 170 | 'allow_edit_cap' => array( |
@@ -6,17 +6,17 @@ |
||
| 6 | 6 | ?><script type="text/javascript"> |
| 7 | 7 | |
| 8 | 8 | function DeleteFile(leadId, fieldId, deleteButton){ |
| 9 | - if(confirm('<?php echo esc_js( __("Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview') ); ?>')){ |
|
| 9 | + if(confirm('<?php echo esc_js( __( "Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview' ) ); ?>')){ |
|
| 10 | 10 | var fileIndex = jQuery(deleteButton).parent().index(); |
| 11 | - var mysack = new sack("<?php echo admin_url("admin-ajax.php")?>"); |
|
| 11 | + var mysack = new sack("<?php echo admin_url( "admin-ajax.php" )?>"); |
|
| 12 | 12 | mysack.execute = 1; |
| 13 | 13 | mysack.method = 'POST'; |
| 14 | 14 | mysack.setVar( "action", "rg_delete_file" ); |
| 15 | - mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce("rg_delete_file") ?>" ); |
|
| 15 | + mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce( "rg_delete_file" ) ?>" ); |
|
| 16 | 16 | mysack.setVar( "lead_id", leadId ); |
| 17 | 17 | mysack.setVar( "field_id", fieldId ); |
| 18 | 18 | mysack.setVar( "file_index", fileIndex ); |
| 19 | - mysack.onError = function() { alert('<?php echo esc_js(__('Ajax error while deleting field.', 'gravityview')) ?>' )}; |
|
| 19 | + mysack.onError = function() { alert('<?php echo esc_js( __( 'Ajax error while deleting field.', 'gravityview' ) ) ?>' )}; |
|
| 20 | 20 | mysack.runAJAX(); |
| 21 | 21 | |
| 22 | 22 | return true; |