| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: React Application Shell |
| 4 |
* |
| 5 |
* Single mount point for the React SPA. Used by all admin pages |
| 6 |
* (Integrations, Chat Button, Settings, Logs, Migration). |
| 7 |
* |
| 8 |
* @package Notifier |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
$current_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : NOTIFIER_NAME; |
| 16 |
$logs_enabled = ( 'yes' === get_option( 'notifier_enable_activity_log', 'no' ) ); |
| 17 |
$migration_pending = Notifier_Migration::has_legacy_triggers() && ! Notifier_Migration::is_migration_complete(); |
| 18 |
?> |
| 19 |
<div class="wrap notifier"> |
| 20 |
<div id="notifier-admin-root" |
| 21 |
data-page="<?php echo esc_attr( $current_page ); ?>" |
| 22 |
data-rest-url="<?php echo esc_url( rest_url( 'notifier/v1/' ) ); ?>" |
| 23 |
data-rest-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_rest' ) ); ?>" |
| 24 |
data-logs-enabled="<?php echo $logs_enabled ? '1' : '0'; ?>" |
| 25 |
data-migration-pending="<?php echo $migration_pending ? '1' : '0'; ?>" |
| 26 |
data-plugin-url="<?php echo esc_url( NOTIFIER_URL ); ?>" |
| 27 |
data-plugin-version="<?php echo esc_attr( NOTIFIER_VERSION ); ?>" |
| 28 |
data-site-url="<?php echo esc_attr( parse_url( home_url(), PHP_URL_HOST ) ); ?>" |
| 29 |
></div> |
| 30 |
</div> |
| 31 |
|