PluginProbe
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings / 6.3.6
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings v6.3.6
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-history.php

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

76 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 if ( ! current_user_can( 'administrator' ) ) {
7 wp_die( esc_html__( 'You do not have permission to view this page.', 'mlsimport' ) );
8 }
9
10 // Load WP_List_Table base class (admin-only; must not be loaded in mlsimport.php).
11 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
12 // __FILE__ = mlsimport/admin/partials/mlsimport-history.php — dirname x3 = plugin root.
13 require_once dirname( __FILE__, 3 ) . '/includes/class-mlsimport-activity-list-table.php';
14
15 // Filter GET keys — MUST match the keys read in Mlsimport_Activity_List_Table::prepare_items().
16 // 'mlsimport_action' = action filter; 'mlsimport_item' = import-task filter.
17 $filter_action = isset( $_GET['mlsimport_action'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
18 ? sanitize_text_field( wp_unslash( $_GET['mlsimport_action'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
19 : '';
20
21 $filter_item = isset( $_GET['mlsimport_item'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
22 ? absint( $_GET['mlsimport_item'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
23 : 0;
24
25 // Search term — matches Listing ID or ListingKey. Key 'mlsimport_s' MUST match prepare_items().
26 $filter_search = isset( $_GET['mlsimport_s'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
27 ? trim( sanitize_text_field( wp_unslash( $_GET['mlsimport_s'] ) ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
28 : '';
29
30 $list_table = new Mlsimport_Activity_List_Table();
31 $list_table->prepare_items();
32
33 $import_task_options = $list_table->get_import_task_options();
34 ?>
35 <div class="wrap">
36 <h1><?php echo esc_html__( 'Import History', 'mlsimport' ); ?></h1>
37 <p><?php echo esc_html__( 'Showing import activity from the last 30 days.', 'mlsimport' ); ?></p>
38
39 <form method="get" action="" class="notice notice-info mlsimport-history-filters">
40 <input type="hidden" name="page" value="mlsimport_history">
41
42 <label for="mlsimport-search"><?php echo esc_html__( 'Search:', 'mlsimport' ); ?></label>
43 <input type="search" id="mlsimport-search" name="mlsimport_s" value="<?php echo esc_attr( $filter_search ); ?>" placeholder="<?php echo esc_attr__( 'Listing ID or ListingKey', 'mlsimport' ); ?>">
44
45 <label for="mlsimport-action-filter"><?php echo esc_html__( 'Action:', 'mlsimport' ); ?></label>
46 <select id="mlsimport-action-filter" name="mlsimport_action">
47 <option value=""><?php echo esc_html__( 'All', 'mlsimport' ); ?></option>
48 <option value="added" <?php selected( $filter_action, 'added' ); ?>><?php echo esc_html__( 'Added', 'mlsimport' ); ?></option>
49 <option value="edited" <?php selected( $filter_action, 'edited' ); ?>><?php echo esc_html__( 'Edited', 'mlsimport' ); ?></option>
50 <option value="deleted" <?php selected( $filter_action, 'deleted' ); ?>><?php echo esc_html__( 'Deleted', 'mlsimport' ); ?></option>
51 </select>
52
53 <?php if ( ! empty( $import_task_options ) ) : ?>
54 <label for="mlsimport-item-filter"><?php echo esc_html__( 'Import Task:', 'mlsimport' ); ?></label>
55 <select id="mlsimport-item-filter" name="mlsimport_item">
56 <option value=""><?php echo esc_html__( 'All', 'mlsimport' ); ?></option>
57 <?php foreach ( $import_task_options as $task_id => $task_title ) : ?>
58 <?php
59 // Skip any entry with an empty title — defensive guard (import_item_id=0 is excluded by get_import_task_options()).
60 if ( '' === trim( (string) $task_title ) ) {
61 continue;
62 }
63 ?>
64 <option value="<?php echo esc_attr( (string) $task_id ); ?>" <?php selected( $filter_item, $task_id ); ?>>
65 <?php echo esc_html( $task_title ); ?>
66 </option>
67 <?php endforeach; ?>
68 </select>
69 <?php endif; ?>
70
71 <?php submit_button( __( 'Filter', 'mlsimport' ), 'secondary', 'submit', false ); ?>
72 </form>
73
74 <?php $list_table->display(); ?>
75 </div>
76