<?php
if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * New UI Loader
 * 
 * Main entry point for loading the new admin UI.
 * This file is loaded by the plugin bootstrap.
 *
 * @package All_Sources_Images
 * @since 6.2.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// Prevent double loading
if ( defined( 'ALLSI_NEW_UI_LOADED' ) ) {
    return;
}
define( 'ALLSI_NEW_UI_LOADED', true );

// Get the directory of this file
$ALLSI_new_ui_dir = plugin_dir_path( __FILE__ );

// Load menu registration
require_once $ALLSI_new_ui_dir . 'new-ui-menus.php';

// Load asset enqueuing
require_once $ALLSI_new_ui_dir . 'new-ui-assets.php';

/**
 * Initialize new UI with admin instance
 * 
 * Call this function from your admin class constructor or init hook
 * to ensure the admin instance is available for the new UI pages.
 * 
 * @param All_Sources_Images_Admin $admin_instance
 */
function ALLSI_init_new_ui( $admin_instance = null ) {
    if ( $admin_instance && function_exists( 'ALLSI_set_new_ui_admin' ) ) {
        ALLSI_set_new_ui_admin( $admin_instance );
    }
}
