@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | // template areas |
| 140 | 140 | $template_areas_directory = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'directory' ); |
| 141 | - $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' ); |
|
| 141 | + $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' ); |
|
| 142 | 142 | |
| 143 | 143 | // widget areas |
| 144 | 144 | $default_widget_areas = \GV\Widget::get_default_widget_areas(); |
@@ -331,40 +331,40 @@ discard block |
||
| 331 | 331 | // load file |
| 332 | 332 | $xmlstr = file_get_contents( $form_file ); |
| 333 | 333 | |
| 334 | - $options = array( |
|
| 335 | - "page" => array("unserialize_as_array" => true), |
|
| 336 | - "form"=> array("unserialize_as_array" => true), |
|
| 337 | - "field"=> array("unserialize_as_array" => true), |
|
| 338 | - "rule"=> array("unserialize_as_array" => true), |
|
| 339 | - "choice"=> array("unserialize_as_array" => true), |
|
| 340 | - "input"=> array("unserialize_as_array" => true), |
|
| 341 | - "routing_item"=> array("unserialize_as_array" => true), |
|
| 342 | - "creditCard"=> array("unserialize_as_array" => true), |
|
| 343 | - "routin"=> array("unserialize_as_array" => true), |
|
| 344 | - "confirmation" => array("unserialize_as_array" => true), |
|
| 345 | - "notification" => array("unserialize_as_array" => true) |
|
| 346 | - ); |
|
| 334 | + $options = array( |
|
| 335 | + "page" => array("unserialize_as_array" => true), |
|
| 336 | + "form"=> array("unserialize_as_array" => true), |
|
| 337 | + "field"=> array("unserialize_as_array" => true), |
|
| 338 | + "rule"=> array("unserialize_as_array" => true), |
|
| 339 | + "choice"=> array("unserialize_as_array" => true), |
|
| 340 | + "input"=> array("unserialize_as_array" => true), |
|
| 341 | + "routing_item"=> array("unserialize_as_array" => true), |
|
| 342 | + "creditCard"=> array("unserialize_as_array" => true), |
|
| 343 | + "routin"=> array("unserialize_as_array" => true), |
|
| 344 | + "confirmation" => array("unserialize_as_array" => true), |
|
| 345 | + "notification" => array("unserialize_as_array" => true) |
|
| 346 | + ); |
|
| 347 | 347 | |
| 348 | 348 | $xml = new RGXML($options); |
| 349 | - $forms = $xml->unserialize($xmlstr); |
|
| 349 | + $forms = $xml->unserialize($xmlstr); |
|
| 350 | 350 | |
| 351 | - if( !$forms ) { |
|
| 352 | - gravityview()->log->error( 'Importing Form Fields for preset [{template_id}]. Error importing file. (File) {path}', array( 'template_id' => $template_id, 'path' => $form_file ) ); |
|
| 353 | - return false; |
|
| 354 | - } |
|
| 351 | + if( !$forms ) { |
|
| 352 | + gravityview()->log->error( 'Importing Form Fields for preset [{template_id}]. Error importing file. (File) {path}', array( 'template_id' => $template_id, 'path' => $form_file ) ); |
|
| 353 | + return false; |
|
| 354 | + } |
|
| 355 | 355 | |
| 356 | - if( !empty( $forms[0] ) && is_array( $forms[0] ) ) { |
|
| 357 | - $form = $forms[0]; |
|
| 358 | - } |
|
| 356 | + if( !empty( $forms[0] ) && is_array( $forms[0] ) ) { |
|
| 357 | + $form = $forms[0]; |
|
| 358 | + } |
|
| 359 | 359 | |
| 360 | - if( empty( $form ) ) { |
|
| 361 | - gravityview()->log->error( '$form not set.', array( 'data' => $forms ) ); |
|
| 362 | - return false; |
|
| 363 | - } |
|
| 360 | + if( empty( $form ) ) { |
|
| 361 | + gravityview()->log->error( '$form not set.', array( 'data' => $forms ) ); |
|
| 362 | + return false; |
|
| 363 | + } |
|
| 364 | 364 | |
| 365 | - gravityview()->log->debug( '[pre_get_available_fields] Importing Form Fields for preset [{template_id}]. (Form)', array( 'template_id' => $template_id, 'data' => $form ) ); |
|
| 365 | + gravityview()->log->debug( '[pre_get_available_fields] Importing Form Fields for preset [{template_id}]. (Form)', array( 'template_id' => $template_id, 'data' => $form ) ); |
|
| 366 | 366 | |
| 367 | - return $form; |
|
| 367 | + return $form; |
|
| 368 | 368 | |
| 369 | 369 | } |
| 370 | 370 | |
@@ -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 | } |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | if( 'form_list' === GFForms::get_page() ) { |
| 172 | 172 | $priority = 790; |
| 173 | - } |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | 175 | if( empty( $connected_views ) ) { |
| 176 | 176 | |
| 177 | - $menu_items['gravityview'] = array( |
|
| 177 | + $menu_items['gravityview'] = array( |
|
| 178 | 178 | 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
| 179 | 179 | 'icon' => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>', |
| 180 | 180 | 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
@@ -205,13 +205,13 @@ discard block |
||
| 205 | 205 | // If there were no items added, then let's create the parent menu |
| 206 | 206 | if( $sub_menu_items ) { |
| 207 | 207 | |
| 208 | - $sub_menu_items[] = array( |
|
| 209 | - 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 210 | - 'link_class' => 'gv-create-view', |
|
| 211 | - 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
|
| 212 | - 'url' => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ), |
|
| 213 | - 'capabilities' => array( 'edit_gravityviews' ), |
|
| 214 | - ); |
|
| 208 | + $sub_menu_items[] = array( |
|
| 209 | + 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 210 | + 'link_class' => 'gv-create-view', |
|
| 211 | + 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
|
| 212 | + 'url' => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ), |
|
| 213 | + 'capabilities' => array( 'edit_gravityviews' ), |
|
| 214 | + ); |
|
| 215 | 215 | |
| 216 | 216 | // Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown |
| 217 | 217 | $sub_menu_items[] = array( |
@@ -596,12 +596,12 @@ discard block |
||
| 596 | 596 | * Render html for displaying available fields based on a Form ID |
| 597 | 597 | * $blacklist_field_types - contains the field types which are not proper to be shown in a directory. |
| 598 | 598 | * |
| 599 | - * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 599 | + * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 600 | 600 | * @access public |
| 601 | - * |
|
| 601 | + * |
|
| 602 | 602 | * @param int $form Gravity Forms Form ID (default: '') |
| 603 | 603 | * @param string $context (default: 'single') |
| 604 | - * |
|
| 604 | + * |
|
| 605 | 605 | * @return void |
| 606 | 606 | */ |
| 607 | 607 | function render_available_fields( $form = 0, $context = 'single' ) { |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | |
| 616 | 616 | if ( ! is_array( $blacklist_field_types ) ) { |
| 617 | 617 | |
| 618 | - gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 618 | + gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 619 | 619 | |
| 620 | 620 | $blacklist_field_types = array(); |
| 621 | 621 | } |
@@ -747,12 +747,12 @@ discard block |
||
| 747 | 747 | /** |
| 748 | 748 | * @since 1.7.2 |
| 749 | 749 | */ |
| 750 | - 'other_entries' => array( |
|
| 751 | - 'label' => __('Other Entries', 'gravityview'), |
|
| 752 | - 'type' => 'other_entries', |
|
| 753 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 754 | - ), |
|
| 755 | - ); |
|
| 750 | + 'other_entries' => array( |
|
| 751 | + 'label' => __('Other Entries', 'gravityview'), |
|
| 752 | + 'type' => 'other_entries', |
|
| 753 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 754 | + ), |
|
| 755 | + ); |
|
| 756 | 756 | |
| 757 | 757 | if( 'single' !== $zone) { |
| 758 | 758 | |
@@ -885,9 +885,9 @@ discard block |
||
| 885 | 885 | |
| 886 | 886 | $joined_forms = gravityview_get_joined_forms( $post->ID ); |
| 887 | 887 | |
| 888 | - foreach ( $joined_forms as $form ) { |
|
| 889 | - $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 890 | - } |
|
| 888 | + foreach ( $joined_forms as $form ) { |
|
| 889 | + $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 890 | + } |
|
| 891 | 891 | } else { |
| 892 | 892 | $available_items[ $form ] = \GV\Widget::registered(); |
| 893 | 893 | } |
@@ -917,9 +917,9 @@ discard block |
||
| 917 | 917 | |
| 918 | 918 | if ( $form_id ) { |
| 919 | 919 | $original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ; |
| 920 | - } else { |
|
| 920 | + } else { |
|
| 921 | 921 | $original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ; |
| 922 | - } |
|
| 922 | + } |
|
| 923 | 923 | |
| 924 | 924 | if ( !$original_item ) { |
| 925 | 925 | 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 ) ) ); |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | |
| 973 | 973 | /** |
| 974 | 974 | * Render the widget active areas |
| 975 | - * @param string $template_id The current slug of the selected View template |
|
| 975 | + * @param string $template_id The current slug of the selected View template |
|
| 976 | 976 | * @param string $zone Either 'header' or 'footer' |
| 977 | 977 | * @param string $post_id Current Post ID (view) |
| 978 | 978 | * @return string html |
@@ -1002,13 +1002,13 @@ discard block |
||
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | /** |
| 1005 | - * Renders "Add Field" tooltips |
|
| 1006 | - * |
|
| 1007 | - * @since 2.0.11 |
|
| 1008 | - * |
|
| 1005 | + * Renders "Add Field" tooltips |
|
| 1006 | + * |
|
| 1007 | + * @since 2.0.11 |
|
| 1008 | + * |
|
| 1009 | 1009 | * @param string $context "directory", "single", or "edit" |
| 1010 | - * |
|
| 1011 | - * @return void |
|
| 1010 | + * |
|
| 1011 | + * @return void |
|
| 1012 | 1012 | */ |
| 1013 | 1013 | function render_field_pickers( $context = 'directory' ) { |
| 1014 | 1014 | |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | </div> |
| 1036 | 1036 | <?php |
| 1037 | 1037 | } |
| 1038 | - } |
|
| 1038 | + } |
|
| 1039 | 1039 | |
| 1040 | 1040 | /** |
| 1041 | 1041 | * Render the Template Active Areas and configured active fields for a given template id and post id |
@@ -1101,7 +1101,7 @@ discard block |
||
| 1101 | 1101 | $is_widgets_page = ( $pagenow === 'widgets.php' ); |
| 1102 | 1102 | |
| 1103 | 1103 | // Add the GV font (with the Astronaut) |
| 1104 | - wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1104 | + wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1105 | 1105 | wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version ); |
| 1106 | 1106 | |
| 1107 | 1107 | wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true ); |
@@ -1109,63 +1109,63 @@ discard block |
||
| 1109 | 1109 | if( GFForms::get_page() === 'form_list' ) { |
| 1110 | 1110 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1111 | 1111 | return; |
| 1112 | - } |
|
| 1112 | + } |
|
| 1113 | 1113 | |
| 1114 | 1114 | // Don't process any scripts below here if it's not a GravityView page. |
| 1115 | 1115 | if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) { |
| 1116 | - return; |
|
| 1116 | + return; |
|
| 1117 | 1117 | } |
| 1118 | 1118 | |
| 1119 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1120 | - wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1121 | - |
|
| 1122 | - $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
| 1123 | - |
|
| 1124 | - //enqueue scripts |
|
| 1125 | - 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 ); |
|
| 1126 | - |
|
| 1127 | - wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1128 | - 'cookiepath' => COOKIEPATH, |
|
| 1129 | - 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1130 | - 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1131 | - 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1132 | - 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1133 | - 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1134 | - 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1135 | - 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1136 | - 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1137 | - 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1138 | - 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1139 | - 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1140 | - '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' ), |
|
| 1141 | - )); |
|
| 1119 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1120 | + wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1121 | + |
|
| 1122 | + $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
| 1123 | + |
|
| 1124 | + //enqueue scripts |
|
| 1125 | + 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 ); |
|
| 1126 | + |
|
| 1127 | + wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1128 | + 'cookiepath' => COOKIEPATH, |
|
| 1129 | + 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1130 | + 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1131 | + 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1132 | + 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1133 | + 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1134 | + 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1135 | + 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1136 | + 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1137 | + 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1138 | + 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1139 | + 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1140 | + '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' ), |
|
| 1141 | + )); |
|
| 1142 | 1142 | |
| 1143 | 1143 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1144 | 1144 | |
| 1145 | - // Enqueue scripts needed for merge tags |
|
| 1146 | - self::enqueue_gravity_forms_scripts(); |
|
| 1145 | + // Enqueue scripts needed for merge tags |
|
| 1146 | + self::enqueue_gravity_forms_scripts(); |
|
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | 1149 | /** |
| 1150 | 1150 | * Enqueue Gravity Forms scripts, needed for Merge Tags |
| 1151 | - * |
|
| 1152 | - * @since 1.0.5-beta |
|
| 1153 | - * |
|
| 1154 | - * @return void |
|
| 1151 | + * |
|
| 1152 | + * @since 1.0.5-beta |
|
| 1153 | + * |
|
| 1154 | + * @return void |
|
| 1155 | 1155 | */ |
| 1156 | 1156 | static function enqueue_gravity_forms_scripts() { |
| 1157 | 1157 | GFForms::register_scripts(); |
| 1158 | 1158 | |
| 1159 | 1159 | $scripts = array( |
| 1160 | - 'sack', |
|
| 1161 | - 'gform_gravityforms', |
|
| 1162 | - 'gform_forms', |
|
| 1163 | - 'gform_form_admin', |
|
| 1164 | - 'jquery-ui-autocomplete' |
|
| 1160 | + 'sack', |
|
| 1161 | + 'gform_gravityforms', |
|
| 1162 | + 'gform_forms', |
|
| 1163 | + 'gform_form_admin', |
|
| 1164 | + 'jquery-ui-autocomplete' |
|
| 1165 | 1165 | ); |
| 1166 | 1166 | |
| 1167 | 1167 | if ( wp_is_mobile() ) { |
| 1168 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1168 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | wp_enqueue_script( $scripts ); |