@@ -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 ); ?>" /> |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly |
| 15 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 15 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * GravityView_Welcome Class |
@@ -204,7 +204,7 @@ |
||
| 204 | 204 | self::$notices['wp_version'] = array( |
| 205 | 205 | 'class' => 'error', |
| 206 | 206 | 'message' => sprintf( __( "%sGravityView requires WordPress %s or newer.%s \n\nYou're using Version %s. Please upgrade your WordPress installation.", 'gravityview' ), '<h3>', GV_MIN_WP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">'.$wp_version.'</span>' ), |
| 207 | - 'cap' => 'update_core', |
|
| 207 | + 'cap' => 'update_core', |
|
| 208 | 208 | 'dismiss' => 'wp_version', |
| 209 | 209 | ); |
| 210 | 210 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | var $style = NULL; |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * String representing size of image - Choose from "full", "medium", "thumb", "tiny" |
|
| 26 | + * String representing size of image - Choose from "full", "medium", "thumb", "tiny" |
|
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | 29 | var $size = NULL; |
@@ -180,8 +180,8 @@ |
||
| 180 | 180 | |
| 181 | 181 | // check widget settings: |
| 182 | 182 | // [search_free] => 1 |
| 183 | - // [search_date] => 1 |
|
| 184 | - $search_generic = array(); |
|
| 183 | + // [search_date] => 1 |
|
| 184 | + $search_generic = array(); |
|
| 185 | 185 | if( !empty( $widget['search_free'] ) ) { |
| 186 | 186 | $search_generic[] = array( 'field' => 'search_all', 'input' => 'input_text' ); |
| 187 | 187 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | add_filter( 'members_get_capabilities', array( 'GravityView_Roles_Capabilities', 'merge_with_all_caps' ) ); |
| 57 | 57 | add_action( 'members_register_cap_groups', array( $this, 'members_register_cap_group' ), 20 ); |
| 58 | 58 | add_filter( 'user_has_cap', array( $this, 'filter_user_has_cap' ), 10, 4 ); |
| 59 | - add_action( 'admin_init', array( $this, 'add_caps') ); |
|
| 59 | + add_action( 'admin_init', array( $this, 'add_caps') ); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -360,7 +360,6 @@ discard block |
||
| 360 | 360 | * Add Gravity Forms and GravityView's "full access" caps when any other caps are checked against. |
| 361 | 361 | * |
| 362 | 362 | * @since 1.15 |
| 363 | - |
|
| 364 | 363 | * @param array $caps_to_check |
| 365 | 364 | * |
| 366 | 365 | * @return array |
@@ -307,7 +307,7 @@ |
||
| 307 | 307 | ! isset( $value ) // If it's not set, it's empty! |
| 308 | 308 | || false === $value |
| 309 | 309 | || null === $value |
| 310 | - || '' === $value // Empty string |
|
| 310 | + || '' === $value // Empty string |
|
| 311 | 311 | || array() === $value // Empty array |
| 312 | 312 | || ( is_object( $value ) && ! get_object_vars( $value ) ) // Empty object |
| 313 | 313 | ) { |
@@ -255,7 +255,6 @@ |
||
| 255 | 255 | * Get the default date format for a field based on the field ID and the time format setting |
| 256 | 256 | * |
| 257 | 257 | * @since 1.14 |
| 258 | - |
|
| 259 | 258 | * @param string $time_format The time format ("12" or "24"). Default: "12" {@since 1.14} |
| 260 | 259 | * @param int $field_id The ID of the field. Used to figure out full time/hours/minutes/am/pm {@since 1.14} |
| 261 | 260 | * |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | * |
| 271 | 271 | * @return void |
| 272 | 272 | */ |
| 273 | - public function add_custom_column_content( $column_name = NULL, $post_id ) { |
|
| 273 | + public function add_custom_column_content( $column_name = NULL, $post_id ) { |
|
| 274 | 274 | |
| 275 | 275 | $output = ''; |
| 276 | 276 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | function save_postdata( $post_id ) { |
| 431 | 431 | |
| 432 | - if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){ |
|
| 432 | + if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
| 433 | 433 | return; |
| 434 | 434 | } |
| 435 | 435 | |
@@ -62,28 +62,28 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * When on the Add/Edit View screen, suggest most popular articles related to that |
|
| 66 | - * |
|
| 65 | + * When on the Add/Edit View screen, suggest most popular articles related to that |
|
| 66 | + * |
|
| 67 | 67 | * @param array $localization_data Data to be passed to the Support Port JS |
| 68 | 68 | * |
| 69 | 69 | * @return array |
| 70 | 70 | */ |
| 71 | 71 | function suggest_support_articles( $localization_data = array() ) { |
| 72 | 72 | |
| 73 | - if( ! gravityview()->request->is_view() ) { |
|
| 74 | - return $localization_data; |
|
| 75 | - } |
|
| 73 | + if( ! gravityview()->request->is_view() ) { |
|
| 74 | + return $localization_data; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | 77 | $localization_data['suggest'] = array( |
| 78 | - '57ef23539033602e61d4a560', |
|
| 79 | - '54c67bb9e4b0512429885513', |
|
| 80 | - '54c67bb9e4b0512429885512', |
|
| 81 | - '54c67bbbe4b07997ea3f3f6b', |
|
| 82 | - '54d1a33ae4b086c0c0964ce9', |
|
| 83 | - '57ef253c9033602e61d4a563', |
|
| 84 | - '552355bfe4b0221aadf2572b', |
|
| 85 | - '54c67bcde4b051242988553e', |
|
| 86 | - ); |
|
| 78 | + '57ef23539033602e61d4a560', |
|
| 79 | + '54c67bb9e4b0512429885513', |
|
| 80 | + '54c67bb9e4b0512429885512', |
|
| 81 | + '54c67bbbe4b07997ea3f3f6b', |
|
| 82 | + '54d1a33ae4b086c0c0964ce9', |
|
| 83 | + '57ef253c9033602e61d4a563', |
|
| 84 | + '552355bfe4b0221aadf2572b', |
|
| 85 | + '54c67bcde4b051242988553e', |
|
| 86 | + ); |
|
| 87 | 87 | |
| 88 | 88 | return $localization_data; |
| 89 | 89 | } |
@@ -174,11 +174,11 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | if( 'form_list' === GFForms::get_page() ) { |
| 176 | 176 | $priority = 790; |
| 177 | - } |
|
| 177 | + } |
|
| 178 | 178 | |
| 179 | 179 | if( empty( $connected_views ) ) { |
| 180 | 180 | |
| 181 | - $menu_items['gravityview'] = array( |
|
| 181 | + $menu_items['gravityview'] = array( |
|
| 182 | 182 | 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
| 183 | 183 | 'icon' => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>', |
| 184 | 184 | 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
@@ -209,14 +209,14 @@ discard block |
||
| 209 | 209 | // If there were no items added, then let's create the parent menu |
| 210 | 210 | if( $sub_menu_items ) { |
| 211 | 211 | |
| 212 | - $sub_menu_items[] = array( |
|
| 213 | - 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 214 | - 'link_class' => 'gv-create-view', |
|
| 215 | - 'icon' => '<i> + </i>', |
|
| 216 | - 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
|
| 217 | - 'url' => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ), |
|
| 218 | - 'capabilities' => array( 'edit_gravityviews' ), |
|
| 219 | - ); |
|
| 212 | + $sub_menu_items[] = array( |
|
| 213 | + 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 214 | + 'link_class' => 'gv-create-view', |
|
| 215 | + 'icon' => '<i> + </i>', |
|
| 216 | + 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
|
| 217 | + 'url' => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ), |
|
| 218 | + 'capabilities' => array( 'edit_gravityviews' ), |
|
| 219 | + ); |
|
| 220 | 220 | |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -619,16 +619,16 @@ discard block |
||
| 619 | 619 | /** |
| 620 | 620 | * Render html for displaying available fields based on a Form ID |
| 621 | 621 | * |
| 622 | - * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 622 | + * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 623 | 623 | * |
| 624 | 624 | * @param int $form Gravity Forms Form ID (default: '') |
| 625 | 625 | * @param string $context (default: 'single') |
| 626 | - * |
|
| 626 | + * |
|
| 627 | 627 | * @return void |
| 628 | 628 | */ |
| 629 | 629 | function render_available_fields( $form = 0, $context = 'single' ) { |
| 630 | 630 | |
| 631 | - // Determine if form is a preset and convert it to an array with fields |
|
| 631 | + // Determine if form is a preset and convert it to an array with fields |
|
| 632 | 632 | $form = ( is_string( $form ) && preg_match( '/^preset_/', $form ) ) ? GravityView_Ajax::pre_get_form_fields( $form ) : $form; |
| 633 | 633 | |
| 634 | 634 | /** |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | if ( ! is_array( $blacklist_field_types ) ) { |
| 642 | 642 | |
| 643 | - gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 643 | + gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 644 | 644 | |
| 645 | 645 | $blacklist_field_types = array(); |
| 646 | 646 | } |
@@ -778,12 +778,12 @@ discard block |
||
| 778 | 778 | /** |
| 779 | 779 | * @since 1.7.2 |
| 780 | 780 | */ |
| 781 | - 'other_entries' => array( |
|
| 782 | - 'label' => __('Other Entries', 'gravityview'), |
|
| 783 | - 'type' => 'other_entries', |
|
| 784 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 785 | - ), |
|
| 786 | - ); |
|
| 781 | + 'other_entries' => array( |
|
| 782 | + 'label' => __('Other Entries', 'gravityview'), |
|
| 783 | + 'type' => 'other_entries', |
|
| 784 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 785 | + ), |
|
| 786 | + ); |
|
| 787 | 787 | |
| 788 | 788 | if( 'single' !== $zone) { |
| 789 | 789 | |
@@ -955,9 +955,9 @@ discard block |
||
| 955 | 955 | |
| 956 | 956 | $joined_forms = gravityview_get_joined_forms( $post->ID ); |
| 957 | 957 | |
| 958 | - foreach ( $joined_forms as $form ) { |
|
| 959 | - $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 960 | - } |
|
| 958 | + foreach ( $joined_forms as $form ) { |
|
| 959 | + $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 960 | + } |
|
| 961 | 961 | } else { |
| 962 | 962 | $available_items[ $form ] = \GV\Widget::registered(); |
| 963 | 963 | } |
@@ -985,9 +985,9 @@ discard block |
||
| 985 | 985 | |
| 986 | 986 | if ( $form_id ) { |
| 987 | 987 | $original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ; |
| 988 | - } else { |
|
| 988 | + } else { |
|
| 989 | 989 | $original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ; |
| 990 | - } |
|
| 990 | + } |
|
| 991 | 991 | |
| 992 | 992 | if ( !$original_item ) { |
| 993 | 993 | gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array(' data' => array('available_items' => $available_items, 'field' => $field ) ) ); |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | |
| 1040 | 1040 | /** |
| 1041 | 1041 | * Render the widget active areas |
| 1042 | - * @param string $template_id The current slug of the selected View template |
|
| 1042 | + * @param string $template_id The current slug of the selected View template |
|
| 1043 | 1043 | * @param string $zone Either 'header' or 'footer' |
| 1044 | 1044 | * @param string $post_id Current Post ID (view) |
| 1045 | 1045 | * @return string html |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | // Add the GV font (with the Astronaut) |
| 1233 | - wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1233 | + wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1234 | 1234 | wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version ); |
| 1235 | 1235 | |
| 1236 | 1236 | wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true ); |
@@ -1238,64 +1238,64 @@ discard block |
||
| 1238 | 1238 | if( GFForms::get_page() === 'form_list' ) { |
| 1239 | 1239 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1240 | 1240 | return; |
| 1241 | - } |
|
| 1241 | + } |
|
| 1242 | 1242 | |
| 1243 | 1243 | // Don't process any scripts below here if it's not a GravityView page. |
| 1244 | 1244 | if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) { |
| 1245 | - return; |
|
| 1245 | + return; |
|
| 1246 | 1246 | } |
| 1247 | 1247 | |
| 1248 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1249 | - wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1250 | - |
|
| 1251 | - // Enqueue scripts |
|
| 1252 | - wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), \GV\Plugin::$version ); |
|
| 1253 | - |
|
| 1254 | - wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1255 | - 'cookiepath' => COOKIEPATH, |
|
| 1256 | - 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1257 | - 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1258 | - 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1259 | - 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
| 1260 | - 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
| 1261 | - 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
| 1262 | - 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1263 | - 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1264 | - 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1265 | - 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1266 | - 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1267 | - 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1268 | - 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1269 | - 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1270 | - 'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ), |
|
| 1271 | - )); |
|
| 1248 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1249 | + wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1250 | + |
|
| 1251 | + // Enqueue scripts |
|
| 1252 | + wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), \GV\Plugin::$version ); |
|
| 1253 | + |
|
| 1254 | + wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1255 | + 'cookiepath' => COOKIEPATH, |
|
| 1256 | + 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1257 | + 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1258 | + 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1259 | + 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
| 1260 | + 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
| 1261 | + 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
| 1262 | + 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1263 | + 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1264 | + 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1265 | + 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1266 | + 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1267 | + 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1268 | + 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1269 | + 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1270 | + 'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ), |
|
| 1271 | + )); |
|
| 1272 | 1272 | |
| 1273 | 1273 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1274 | 1274 | |
| 1275 | - // Enqueue scripts needed for merge tags |
|
| 1276 | - self::enqueue_gravity_forms_scripts(); |
|
| 1275 | + // Enqueue scripts needed for merge tags |
|
| 1276 | + self::enqueue_gravity_forms_scripts(); |
|
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | /** |
| 1280 | 1280 | * Enqueue Gravity Forms scripts, needed for Merge Tags |
| 1281 | - * |
|
| 1282 | - * @since 1.0.5-beta |
|
| 1283 | - * |
|
| 1284 | - * @return void |
|
| 1281 | + * |
|
| 1282 | + * @since 1.0.5-beta |
|
| 1283 | + * |
|
| 1284 | + * @return void |
|
| 1285 | 1285 | */ |
| 1286 | 1286 | static function enqueue_gravity_forms_scripts() { |
| 1287 | 1287 | GFForms::register_scripts(); |
| 1288 | 1288 | |
| 1289 | 1289 | $scripts = array( |
| 1290 | - 'sack', |
|
| 1291 | - 'gform_gravityforms', |
|
| 1292 | - 'gform_forms', |
|
| 1293 | - 'gform_form_admin', |
|
| 1294 | - 'jquery-ui-autocomplete' |
|
| 1290 | + 'sack', |
|
| 1291 | + 'gform_gravityforms', |
|
| 1292 | + 'gform_forms', |
|
| 1293 | + 'gform_form_admin', |
|
| 1294 | + 'jquery-ui-autocomplete' |
|
| 1295 | 1295 | ); |
| 1296 | 1296 | |
| 1297 | 1297 | if ( wp_is_mobile() ) { |
| 1298 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1298 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1299 | 1299 | } |
| 1300 | 1300 | |
| 1301 | 1301 | wp_enqueue_script( $scripts ); |