@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $show_mt = $this->show_merge_tags(); |
| 30 | 30 | |
| 31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | - $class .= ' merge-tag-support mt-position-right '; |
|
| 31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | + $class .= ' merge-tag-support mt-position-right '; |
|
| 33 | 33 | |
| 34 | - if( empty( $this->field['show_all_fields'] ) ) { |
|
| 35 | - $class .= ' mt-hide_all_fields '; |
|
| 36 | - } |
|
| 37 | - } |
|
| 34 | + if( empty( $this->field['show_all_fields'] ) ) { |
|
| 35 | + $class .= ' mt-hide_all_fields '; |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | $class .= rgar( $this->field, 'class' ); |
| 40 | 40 | $placeholder = rgar( $this->field, 'placeholder' ); |
@@ -55,20 +55,20 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | function codemirror( $field_id = '' ) { |
| 57 | 57 | |
| 58 | - // Enqueue code editor and settings for manipulating HTML. |
|
| 59 | - $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) ); |
|
| 58 | + // Enqueue code editor and settings for manipulating HTML. |
|
| 59 | + $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) ); |
|
| 60 | 60 | |
| 61 | - // Bail if user disabled CodeMirror. |
|
| 62 | - if ( false === $settings ) { |
|
| 63 | - return; |
|
| 64 | - } |
|
| 61 | + // Bail if user disabled CodeMirror. |
|
| 62 | + if ( false === $settings ) { |
|
| 63 | + return; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - ?> |
|
| 66 | + ?> |
|
| 67 | 67 | |
| 68 | 68 | <script> |
| 69 | 69 | wp.codeEditor.initialize( "<?php echo $field_id;?>", {}); |
| 70 | 70 | </script> |
| 71 | 71 | <?php |
| 72 | - } |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | 74 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // Enqueue code editor and settings for manipulating HTML. |
| 47 | 47 | add_action('admin_enqueue_scripts', function() { |
| 48 | 48 | |
| 49 | - $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) ); |
|
| 49 | + $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) ); |
|
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | 52 | // @todo check if this hook is needed.. |
@@ -68,28 +68,28 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * When on the Add/Edit View screen, suggest most popular articles related to that |
|
| 72 | - * |
|
| 71 | + * When on the Add/Edit View screen, suggest most popular articles related to that |
|
| 72 | + * |
|
| 73 | 73 | * @param array $localization_data Data to be passed to the Support Port JS |
| 74 | 74 | * |
| 75 | 75 | * @return array |
| 76 | 76 | */ |
| 77 | 77 | function suggest_support_articles( $localization_data = array() ) { |
| 78 | 78 | |
| 79 | - if( ! gravityview()->request->is_view() ) { |
|
| 80 | - return $localization_data; |
|
| 81 | - } |
|
| 79 | + if( ! gravityview()->request->is_view() ) { |
|
| 80 | + return $localization_data; |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | 83 | $localization_data['suggest'] = array( |
| 84 | - '57ef23539033602e61d4a560', |
|
| 85 | - '54c67bb9e4b0512429885513', |
|
| 86 | - '54c67bb9e4b0512429885512', |
|
| 87 | - '54c67bbbe4b07997ea3f3f6b', |
|
| 88 | - '54d1a33ae4b086c0c0964ce9', |
|
| 89 | - '57ef253c9033602e61d4a563', |
|
| 90 | - '552355bfe4b0221aadf2572b', |
|
| 91 | - '54c67bcde4b051242988553e', |
|
| 92 | - ); |
|
| 84 | + '57ef23539033602e61d4a560', |
|
| 85 | + '54c67bb9e4b0512429885513', |
|
| 86 | + '54c67bb9e4b0512429885512', |
|
| 87 | + '54c67bbbe4b07997ea3f3f6b', |
|
| 88 | + '54d1a33ae4b086c0c0964ce9', |
|
| 89 | + '57ef253c9033602e61d4a563', |
|
| 90 | + '552355bfe4b0221aadf2572b', |
|
| 91 | + '54c67bcde4b051242988553e', |
|
| 92 | + ); |
|
| 93 | 93 | |
| 94 | 94 | return $localization_data; |
| 95 | 95 | } |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | if( 'form_list' === GFForms::get_page() ) { |
| 182 | 182 | $priority = 790; |
| 183 | - } |
|
| 183 | + } |
|
| 184 | 184 | |
| 185 | 185 | if( empty( $connected_views ) ) { |
| 186 | 186 | |
| 187 | - $menu_items['gravityview'] = array( |
|
| 187 | + $menu_items['gravityview'] = array( |
|
| 188 | 188 | 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
| 189 | 189 | 'icon' => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>', |
| 190 | 190 | 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
@@ -215,14 +215,14 @@ discard block |
||
| 215 | 215 | // If there were no items added, then let's create the parent menu |
| 216 | 216 | if( $sub_menu_items ) { |
| 217 | 217 | |
| 218 | - $sub_menu_items[] = array( |
|
| 219 | - 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 220 | - 'link_class' => 'gv-create-view', |
|
| 221 | - 'icon' => '<i> + </i>', |
|
| 222 | - 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
|
| 223 | - 'url' => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ), |
|
| 224 | - 'capabilities' => array( 'edit_gravityviews' ), |
|
| 225 | - ); |
|
| 218 | + $sub_menu_items[] = array( |
|
| 219 | + 'label' => esc_attr__( 'Create a View', 'gravityview' ), |
|
| 220 | + 'link_class' => 'gv-create-view', |
|
| 221 | + 'icon' => '<i> + </i>', |
|
| 222 | + 'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ), |
|
| 223 | + 'url' => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ), |
|
| 224 | + 'capabilities' => array( 'edit_gravityviews' ), |
|
| 225 | + ); |
|
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -625,16 +625,16 @@ discard block |
||
| 625 | 625 | /** |
| 626 | 626 | * Render html for displaying available fields based on a Form ID |
| 627 | 627 | * |
| 628 | - * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 628 | + * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
| 629 | 629 | * |
| 630 | 630 | * @param int $form Gravity Forms Form ID (default: '') |
| 631 | 631 | * @param string $context (default: 'single') |
| 632 | - * |
|
| 632 | + * |
|
| 633 | 633 | * @return void |
| 634 | 634 | */ |
| 635 | 635 | function render_available_fields( $form = 0, $context = 'single' ) { |
| 636 | 636 | |
| 637 | - // Determine if form is a preset and convert it to an array with fields |
|
| 637 | + // Determine if form is a preset and convert it to an array with fields |
|
| 638 | 638 | $form = ( is_string( $form ) && preg_match( '/^preset_/', $form ) ) ? GravityView_Ajax::pre_get_form_fields( $form ) : $form; |
| 639 | 639 | |
| 640 | 640 | /** |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | |
| 647 | 647 | if ( ! is_array( $blacklist_field_types ) ) { |
| 648 | 648 | |
| 649 | - gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 649 | + gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
| 650 | 650 | |
| 651 | 651 | $blacklist_field_types = array(); |
| 652 | 652 | } |
@@ -784,12 +784,12 @@ discard block |
||
| 784 | 784 | /** |
| 785 | 785 | * @since 1.7.2 |
| 786 | 786 | */ |
| 787 | - 'other_entries' => array( |
|
| 788 | - 'label' => __('Other Entries', 'gravityview'), |
|
| 789 | - 'type' => 'other_entries', |
|
| 790 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 791 | - ), |
|
| 792 | - ); |
|
| 787 | + 'other_entries' => array( |
|
| 788 | + 'label' => __('Other Entries', 'gravityview'), |
|
| 789 | + 'type' => 'other_entries', |
|
| 790 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 791 | + ), |
|
| 792 | + ); |
|
| 793 | 793 | |
| 794 | 794 | if( 'single' !== $zone) { |
| 795 | 795 | |
@@ -961,9 +961,9 @@ discard block |
||
| 961 | 961 | |
| 962 | 962 | $joined_forms = gravityview_get_joined_forms( $post->ID ); |
| 963 | 963 | |
| 964 | - foreach ( $joined_forms as $form ) { |
|
| 965 | - $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 966 | - } |
|
| 964 | + foreach ( $joined_forms as $form ) { |
|
| 965 | + $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
| 966 | + } |
|
| 967 | 967 | } else { |
| 968 | 968 | $available_items[ $form ] = \GV\Widget::registered(); |
| 969 | 969 | } |
@@ -991,9 +991,9 @@ discard block |
||
| 991 | 991 | |
| 992 | 992 | if ( $form_id ) { |
| 993 | 993 | $original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ; |
| 994 | - } else { |
|
| 994 | + } else { |
|
| 995 | 995 | $original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ; |
| 996 | - } |
|
| 996 | + } |
|
| 997 | 997 | |
| 998 | 998 | if ( !$original_item ) { |
| 999 | 999 | 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 ) ) ); |
@@ -1045,7 +1045,7 @@ discard block |
||
| 1045 | 1045 | |
| 1046 | 1046 | /** |
| 1047 | 1047 | * Render the widget active areas |
| 1048 | - * @param string $template_id The current slug of the selected View template |
|
| 1048 | + * @param string $template_id The current slug of the selected View template |
|
| 1049 | 1049 | * @param string $zone Either 'header' or 'footer' |
| 1050 | 1050 | * @param string $post_id Current Post ID (view) |
| 1051 | 1051 | * @return string html |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | 1238 | // Add the GV font (with the Astronaut) |
| 1239 | - wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1239 | + wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
| 1240 | 1240 | wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version ); |
| 1241 | 1241 | |
| 1242 | 1242 | wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true ); |
@@ -1244,64 +1244,64 @@ discard block |
||
| 1244 | 1244 | if( GFForms::get_page() === 'form_list' ) { |
| 1245 | 1245 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1246 | 1246 | return; |
| 1247 | - } |
|
| 1247 | + } |
|
| 1248 | 1248 | |
| 1249 | 1249 | // Don't process any scripts below here if it's not a GravityView page. |
| 1250 | 1250 | if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) { |
| 1251 | - return; |
|
| 1251 | + return; |
|
| 1252 | 1252 | } |
| 1253 | 1253 | |
| 1254 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1255 | - wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1256 | - |
|
| 1257 | - // Enqueue scripts |
|
| 1258 | - 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 ); |
|
| 1259 | - |
|
| 1260 | - wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1261 | - 'cookiepath' => COOKIEPATH, |
|
| 1262 | - 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1263 | - 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1264 | - 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1265 | - 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
| 1266 | - 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
| 1267 | - 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
| 1268 | - 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1269 | - 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1270 | - 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1271 | - 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1272 | - 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1273 | - 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1274 | - 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1275 | - 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1276 | - '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' ), |
|
| 1277 | - )); |
|
| 1254 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 1255 | + wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
| 1256 | + |
|
| 1257 | + // Enqueue scripts |
|
| 1258 | + 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 ); |
|
| 1259 | + |
|
| 1260 | + wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
| 1261 | + 'cookiepath' => COOKIEPATH, |
|
| 1262 | + 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
| 1263 | + 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
| 1264 | + 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
| 1265 | + 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
| 1266 | + 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
| 1267 | + 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
| 1268 | + 'label_close' => __( 'Close', 'gravityview' ), |
|
| 1269 | + 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
| 1270 | + 'label_continue' => __( 'Continue', 'gravityview' ), |
|
| 1271 | + 'label_ok' => __( 'Ok', 'gravityview' ), |
|
| 1272 | + 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
| 1273 | + 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
| 1274 | + 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
| 1275 | + 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
| 1276 | + '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' ), |
|
| 1277 | + )); |
|
| 1278 | 1278 | |
| 1279 | 1279 | wp_enqueue_style( 'gravityview_views_styles' ); |
| 1280 | 1280 | |
| 1281 | - // Enqueue scripts needed for merge tags |
|
| 1282 | - self::enqueue_gravity_forms_scripts(); |
|
| 1281 | + // Enqueue scripts needed for merge tags |
|
| 1282 | + self::enqueue_gravity_forms_scripts(); |
|
| 1283 | 1283 | } |
| 1284 | 1284 | |
| 1285 | 1285 | /** |
| 1286 | 1286 | * Enqueue Gravity Forms scripts, needed for Merge Tags |
| 1287 | - * |
|
| 1288 | - * @since 1.0.5-beta |
|
| 1289 | - * |
|
| 1290 | - * @return void |
|
| 1287 | + * |
|
| 1288 | + * @since 1.0.5-beta |
|
| 1289 | + * |
|
| 1290 | + * @return void |
|
| 1291 | 1291 | */ |
| 1292 | 1292 | static function enqueue_gravity_forms_scripts() { |
| 1293 | 1293 | GFForms::register_scripts(); |
| 1294 | 1294 | |
| 1295 | 1295 | $scripts = array( |
| 1296 | - 'sack', |
|
| 1297 | - 'gform_gravityforms', |
|
| 1298 | - 'gform_forms', |
|
| 1299 | - 'gform_form_admin', |
|
| 1300 | - 'jquery-ui-autocomplete' |
|
| 1296 | + 'sack', |
|
| 1297 | + 'gform_gravityforms', |
|
| 1298 | + 'gform_forms', |
|
| 1299 | + 'gform_form_admin', |
|
| 1300 | + 'jquery-ui-autocomplete' |
|
| 1301 | 1301 | ); |
| 1302 | 1302 | |
| 1303 | 1303 | if ( wp_is_mobile() ) { |
| 1304 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1304 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1305 | 1305 | } |
| 1306 | 1306 | |
| 1307 | 1307 | wp_enqueue_script( $scripts ); |