PluginProbe
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings / 7.1.1
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings v7.1.1
7.2.1 7.2 7.1.2 7.1.1 7.1 7.0.4 7.0.6 7.0.7 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 6.3.1 trunk 5.7.3 5.7.5 5.8.1 5.8.2 5.8.3 5.8.4 5.8.6 6.0.4 6.0.5 All 36 releases
mlsimport / admin / partials / mlsimport-admin-fields-select.php

mlsimport-admin-fields-select.php in MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings 7.1.1, at admin/partials/mlsimport-admin-fields-select.php

69 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Read-only renderer for the Field Configuration settings tab.
4 *
5 * Metadata gathering owns initialization and persistence. This partial only
6 * checks connection state, asks the deep module for an in-memory normalized
7 * view, and renders the active fields. There is deliberately no settings form,
8 * options.php submission, pagination state, or browser-triggered initial save;
9 * the JavaScript controller sends compact commands to the single AJAX seam.
10 *
11 * @package MLSImport
12 * @subpackage MLSImport/admin/partials
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 global $mlsimport;
20
21 $metadata_populated = get_option( 'mlsimport_mls_metadata_populated', '' );
22 $token = $mlsimport->admin->mlsimport_saas_get_mls_api_token_from_transient();
23 $is_mls_connected = get_option( 'mlsimport_connection_test', '' );
24
25 // Refresh connection state before deciding whether the configuration can be
26 // displayed. These calls preserve the settings page's existing connection flow.
27 $mlsimport->admin->mlsimport_saas_setting_up();
28 if ( 'yes' !== $is_mls_connected ) {
29 $mlsimport->admin->mlsimport_saas_check_mls_connection();
30 $is_mls_connected = get_option( 'mlsimport_connection_test', '' );
31 }
32
33 if ( '' === trim( $token ) ) {
34 echo '<div class="mlsimport_warning">' . esc_html__( 'You are not connected to MlsImport - Please check your Username and Password.', 'mlsimport' ) . '</div>';
35 return;
36 }
37
38 if ( 'yes' !== $is_mls_connected ) {
39 echo '<div class="mlsimport_warning">' . esc_html__( 'The connection to your MLS was NOT succesful. Please check the authentication token is correct and check your MLS Data Access Application is approved.', 'mlsimport' ) . '</div>';
40 return;
41 }
42
43 if ( 'yes' === $metadata_populated ) {
44 $metadata = mlsimport_field_configuration_metadata();
45 $theme_schema = mlsimport_hardocde_theme_schema();
46 $configuration = mlsimport_field_configuration()->read( $metadata, $theme_schema, mlsimport_field_configuration_taxonomies() );
47
48 echo '<h3>' . esc_html__( 'Select the extra fields you want to import', 'mlsimport' ) . ':</h3>';
49 echo render_mls_field_selection_interface(
50 $metadata,
51 $configuration,
52 array(
53 'search_term' => '',
54 'import_filter' => 'all',
55 'show_filters' => true,
56 'show_stats' => true,
57 'enable_drag_drop' => true,
58 'plugin_name' => 'mlsimport',
59 ),
60 $theme_schema
61 );
62 } elseif ( '' !== trim( $token ) ) {
63 echo '<div class="mlsimport_warning mlsimport_validated">' . esc_html__( 'We need to gather some information about your MLS. Please Stand By! ', 'mlsimport' ) . '</div>';
64 } else {
65 esc_html_e( 'You are not connected to MLS Import', 'mlsimport' );
66 }
67 ?>
68 <input type="hidden" id="mlsimport_saas_get_metadata" value="<?php echo esc_attr( wp_create_nonce( 'mlsimport_saas_get_metadata' ) ); ?>">
69