@@ -63,28 +63,28 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * When on the Add/Edit View screen, suggest most popular articles related to that |
|
| 67 | - * |
|
| 66 | + * When on the Add/Edit View screen, suggest most popular articles related to that |
|
| 67 | + * |
|
| 68 | 68 | * @param array $localization_data Data to be passed to the Support Port JS |
| 69 | 69 | * |
| 70 | 70 | * @return array |
| 71 | 71 | */ |
| 72 | 72 | function suggest_support_articles( $localization_data = array() ) { |
| 73 | 73 | |
| 74 | - if( ! gravityview()->request->is_view() ) { |
|
| 75 | - return $localization_data; |
|
| 76 | - } |
|
| 74 | + if( ! gravityview()->request->is_view() ) { |
|
| 75 | + return $localization_data; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | 78 | $localization_data['suggest'] = array( |
| 79 | - '57ef23539033602e61d4a560', |
|
| 80 | - '54c67bb9e4b0512429885513', |
|
| 81 | - '54c67bb9e4b0512429885512', |
|
| 82 | - '54c67bbbe4b07997ea3f3f6b', |
|
| 83 | - '54d1a33ae4b086c0c0964ce9', |
|
| 84 | - '57ef253c9033602e61d4a563', |
|
| 85 | - '552355bfe4b0221aadf2572b', |
|
| 86 | - '54c67bcde4b051242988553e', |
|
| 87 | - ); |
|
| 79 | + '57ef23539033602e61d4a560', |
|
| 80 | + '54c67bb9e4b0512429885513', |
|
| 81 | + '54c67bb9e4b0512429885512', |
|
| 82 | + '54c67bbbe4b07997ea3f3f6b', |
|
| 83 | + '54d1a33ae4b086c0c0964ce9', |
|
| 84 | + '57ef253c9033602e61d4a563', |
|
| 85 | + '552355bfe4b0221aadf2572b', |
|
| 86 | + '54c67bcde4b051242988553e', |
|
| 87 | + ); |
|
| 88 | 88 | |
| 89 | 89 | return $localization_data; |
| 90 | 90 | } |
@@ -175,11 +175,11 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | if( 'form_list' === GFForms::get_page() ) { |
| 177 | 177 | $priority = 790; |
| 178 | - } |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | 180 | if( empty( $connected_views ) ) { |
| 181 | 181 | |
| 182 | - $menu_items['gravityview'] = array( |
|
| 182 | + $menu_items['gravityview'] = array( |
|
| 183 | 183 | 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
| 184 | 184 | 'icon' => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>', |
| 185 | 185 | 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
@@ -210,13 +210,13 @@ discard block |
||
| 210 | 210 | // If there were no items added, then let's create the parent menu |
| 211 | 211 | if( $sub_menu_items ) { |
| 212 | 212 | |
| 213 | - $sub_menu_items[] = array( |
|
| 214 | - 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 215 | - 'link_class' => 'gv-create-view', |
|
| 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 | - ); |
|
| 213 | + $sub_menu_items[] = array( |
|
| 214 | + 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 215 | + 'link_class' => 'gv-create-view', |
|
| 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 | // Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown |
| 222 | 222 | $sub_menu_items[] = array( |
@@ -599,17 +599,17 @@ discard block |
||
| 599 | 599 | * Render html for displaying available fields based on a Form ID |
| 600 | 600 | * $blacklist_field_types - contains the field types which are not proper to be shown in a directory. |
| 601 | 601 | * |
| 602 | - * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 602 | + * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 603 | 603 | * @access public |
| 604 | - * |
|
| 604 | + * |
|
| 605 | 605 | * @param int $form Gravity Forms Form ID (default: '') |
| 606 | 606 | * @param string $context (default: 'single') |
| 607 | - * |
|
| 607 | + * |
|
| 608 | 608 | * @return void |
| 609 | 609 | */ |
| 610 | 610 | function render_available_fields( $form = 0, $context = 'single' ) { |
| 611 | 611 | |
| 612 | - // Determine if form is a preset and convert it to an array with fields |
|
| 612 | + // Determine if form is a preset and convert it to an array with fields |
|
| 613 | 613 | $form = ( is_string( $form ) && preg_match( '/^preset_/', $form ) ) ? GravityView_Ajax::pre_get_form_fields( $form ) : $form; |
| 614 | 614 | |
| 615 | 615 | /** |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | if ( ! is_array( $blacklist_field_types ) ) { |
| 623 | 623 | |
| 624 | - gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 624 | + gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 625 | 625 | |
| 626 | 626 | $blacklist_field_types = array(); |
| 627 | 627 | } |
@@ -753,12 +753,12 @@ discard block |
||
| 753 | 753 | /** |
| 754 | 754 | * @since 1.7.2 |
| 755 | 755 | */ |
| 756 | - 'other_entries' => array( |
|
| 757 | - 'label' => __('Other Entries', 'gravityview'), |
|
| 758 | - 'type' => 'other_entries', |
|
| 759 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 760 | - ), |
|
| 761 | - ); |
|
| 756 | + 'other_entries' => array( |
|
| 757 | + 'label' => __('Other Entries', 'gravityview'), |
|
| 758 | + 'type' => 'other_entries', |
|
| 759 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 760 | + ), |
|
| 761 | + ); |
|
| 762 | 762 | |
| 763 | 763 | if( 'single' !== $zone) { |
| 764 | 764 | |
@@ -906,9 +906,9 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | $joined_forms = gravityview_get_joined_forms( $post->ID ); |
| 908 | 908 | |
| 909 | - foreach ( $joined_forms as $form ) { |
|
| 910 | - $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 911 | - } |
|
| 909 | + foreach ( $joined_forms as $form ) { |
|
| 910 | + $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 911 | + } |
|
| 912 | 912 | } else { |
| 913 | 913 | $available_items[ $form ] = \GV\Widget::registered(); |
| 914 | 914 | } |
@@ -936,9 +936,9 @@ discard block |
||
| 936 | 936 | |
| 937 | 937 | if ( $form_id ) { |
| 938 | 938 | $original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ; |
| 939 | - } else { |
|
| 939 | + } else { |
|
| 940 | 940 | $original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ; |
| 941 | - } |
|
| 941 | + } |
|
| 942 | 942 | |
| 943 | 943 | if ( !$original_item ) { |
| 944 | 944 | 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 ) ) ); |
@@ -990,7 +990,7 @@ discard block |
||
| 990 | 990 | |
| 991 | 991 | /** |
| 992 | 992 | * Render the widget active areas |
| 993 | - * @param string $template_id The current slug of the selected View template |
|
| 993 | + * @param string $template_id The current slug of the selected View template |
|
| 994 | 994 | * @param string $zone Either 'header' or 'footer' |
| 995 | 995 | * @param string $post_id Current Post ID (view) |
| 996 | 996 | * @return string html |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | $is_widgets_page = ( $pagenow === 'widgets.php' ); |
| 1175 | 1175 | |
| 1176 | 1176 | // Add the GV font (with the Astronaut) |
| 1177 | - wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1177 | + wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1178 | 1178 | wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version ); |
| 1179 | 1179 | |
| 1180 | 1180 | wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true ); |
@@ -1182,66 +1182,66 @@ discard block |
||
| 1182 | 1182 | if( GFForms::get_page() === 'form_list' ) { |
| 1183 | 1183 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1184 | 1184 | return; |
| 1185 | - } |
|
| 1185 | + } |
|
| 1186 | 1186 | |
| 1187 | 1187 | // Don't process any scripts below here if it's not a GravityView page. |
| 1188 | 1188 | if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) { |
| 1189 | - return; |
|
| 1189 | + return; |
|
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1193 | - wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1194 | - |
|
| 1195 | - $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
| 1196 | - |
|
| 1197 | - //enqueue scripts |
|
| 1198 | - 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 ); |
|
| 1199 | - |
|
| 1200 | - wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1201 | - 'cookiepath' => COOKIEPATH, |
|
| 1202 | - 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1203 | - 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1204 | - 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1205 | - 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
| 1206 | - 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
| 1207 | - 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
| 1208 | - 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1209 | - 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1210 | - 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1211 | - 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1212 | - 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1213 | - 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1214 | - 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1215 | - 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1216 | - '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' ), |
|
| 1217 | - )); |
|
| 1192 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1193 | + wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1194 | + |
|
| 1195 | + $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
| 1196 | + |
|
| 1197 | + //enqueue scripts |
|
| 1198 | + 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 ); |
|
| 1199 | + |
|
| 1200 | + wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1201 | + 'cookiepath' => COOKIEPATH, |
|
| 1202 | + 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1203 | + 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1204 | + 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1205 | + 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
| 1206 | + 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
| 1207 | + 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
| 1208 | + 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1209 | + 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1210 | + 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1211 | + 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1212 | + 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1213 | + 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1214 | + 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1215 | + 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1216 | + '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' ), |
|
| 1217 | + )); |
|
| 1218 | 1218 | |
| 1219 | 1219 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1220 | 1220 | |
| 1221 | - // Enqueue scripts needed for merge tags |
|
| 1222 | - self::enqueue_gravity_forms_scripts(); |
|
| 1221 | + // Enqueue scripts needed for merge tags |
|
| 1222 | + self::enqueue_gravity_forms_scripts(); |
|
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | 1225 | /** |
| 1226 | 1226 | * Enqueue Gravity Forms scripts, needed for Merge Tags |
| 1227 | - * |
|
| 1228 | - * @since 1.0.5-beta |
|
| 1229 | - * |
|
| 1230 | - * @return void |
|
| 1227 | + * |
|
| 1228 | + * @since 1.0.5-beta |
|
| 1229 | + * |
|
| 1230 | + * @return void |
|
| 1231 | 1231 | */ |
| 1232 | 1232 | static function enqueue_gravity_forms_scripts() { |
| 1233 | 1233 | GFForms::register_scripts(); |
| 1234 | 1234 | |
| 1235 | 1235 | $scripts = array( |
| 1236 | - 'sack', |
|
| 1237 | - 'gform_gravityforms', |
|
| 1238 | - 'gform_forms', |
|
| 1239 | - 'gform_form_admin', |
|
| 1240 | - 'jquery-ui-autocomplete' |
|
| 1236 | + 'sack', |
|
| 1237 | + 'gform_gravityforms', |
|
| 1238 | + 'gform_forms', |
|
| 1239 | + 'gform_form_admin', |
|
| 1240 | + 'jquery-ui-autocomplete' |
|
| 1241 | 1241 | ); |
| 1242 | 1242 | |
| 1243 | 1243 | if ( wp_is_mobile() ) { |
| 1244 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1244 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | 1247 | wp_enqueue_script( $scripts ); |