<?php

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

add_action( 'admin_menu', 'x4email_add_admin_menu' );

function x4email_add_admin_menu() {
	add_menu_page(
		'X4EMAIL-Lite',
		'X4EMAIL-Lite',
		'manage_options',
		'x4email-dashboard',
		'x4email_dashboard_page',
		'dashicons-email',
		25
	);

	add_submenu_page(
		'x4email-dashboard',
		'SMTP Settings',
		'SMTP Settings',
		'manage_options',
		'x4email-settings',
		'x4email_settings_page'
	);

	add_submenu_page(
		'x4email-dashboard',
		'Email Hooks',
		'Email Hooks',
		'manage_options',
		'x4email-hooks',
		'x4email_hooks_page'
	);

	add_submenu_page(
		'x4email-dashboard',
		'Security',
		'Security',
		'manage_options',
		'x4email-security',
		'x4email_security_page'
	);

	add_submenu_page(
		'x4email-dashboard',
		'Email Logs',
		'Email Logs',
		'manage_options',
		'x4email-logs',
		'x4email_logs_page'
	);
}

function x4email_dashboard_page() {
	include plugin_dir_path( __FILE__ ) . 'pages/dashboard.php';
}



require plugin_dir_path( __FILE__ ) . 'pages/settings.php';



require plugin_dir_path( __FILE__ ) . 'pages/hooks.php';



function x4email_security_page() {
	include plugin_dir_path( __FILE__ ) . 'pages/security.php';
}


require plugin_dir_path( __FILE__ ) . 'pages/logs.php';


require plugin_dir_path( __FILE__ ) . 'pages/templates.php';
