Files
igny8/plugins/wordpress/source/igny8-wp-bridge/admin/layout-header.php
2026-01-13 09:23:54 +00:00

83 lines
4.2 KiB
PHP

<?php
/**
* Modern Layout Wrapper
*
* This template provides the sidebar navigation and layout structure for all IGNY8 admin pages.
* Each page template should start by including this file.
*
* @package Igny8Bridge
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
// Get current page
$current_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : 'igny8-dashboard';
$api_key = function_exists('igny8_get_secure_option') ? igny8_get_secure_option('igny8_api_key') : get_option('igny8_api_key');
$is_connected = !empty($api_key);
?>
<div class="igny8-admin-wrapper">
<!-- Sidebar Navigation -->
<aside class="igny8-sidebar">
<div class="igny8-sidebar-logo">
<img src="<?php echo esc_url(plugins_url('assets/images/IGNY8_LIGHT_LOGO.png', __FILE__)); ?>" alt="IGNY8" />
</div>
<!-- Connection Status Badge -->
<div class="igny8-sidebar-badge-container">
<?php if ($is_connected): ?>
<div class="igny8-status igny8-status-connected">
<span class="igny8-status-indicator"></span>
<?php _e('Connected', 'igny8-bridge'); ?>
</div>
<?php else: ?>
<div class="igny8-status igny8-status-disconnected">
<span class="igny8-status-indicator"></span>
<?php _e('Not Connected', 'igny8-bridge'); ?>
</div>
<?php endif; ?>
</div>
<nav>
<ul class="igny8-sidebar-nav">
<li>
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-connection')); ?>"
class="<?php echo ($current_page === 'igny8-connection' || $current_page === 'igny8-dashboard') ? 'active' : ''; ?>">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
</svg>
<?php _e('Dashboard', 'igny8-bridge'); ?>
</a>
</li>
<li>
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-settings')); ?>"
class="<?php echo ($current_page === 'igny8-settings') ? 'active' : ''; ?>">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
<?php _e('Settings', 'igny8-bridge'); ?>
</a>
</li>
<li>
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-logs')); ?>"
class="<?php echo ($current_page === 'igny8-logs') ? 'active' : ''; ?>">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
<?php _e('Logs', 'igny8-bridge'); ?>
</a>
</li>
</ul>
</nav>
</aside>
<!-- Main Content Area -->
<main class="igny8-main-content">
<?php settings_errors('igny8_settings'); ?>