Files
Instagram-Gallery-Sync-Pro/admin/views/settings-page.php

122 lines
4.5 KiB
PHP

<?php
/**
* Admin Settings Page Template
*
* @package Instagram_Gallery_Sync_Pro
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
$admin = new IGSP_Admin();
$current_tab = $admin->get_current_tab();
$tabs = $admin->get_tabs();
?>
<div class="wrap igsp-admin-wrap">
<div class="igsp-admin-header">
<h1>
<span class="dashicons dashicons-instagram"></span>
<?php esc_html_e('Instagram Gallery Sync Pro', 'instagram-gallery-sync-pro'); ?>
</h1>
<p class="igsp-version">
<?php echo esc_html(sprintf(__('Version %s', 'instagram-gallery-sync-pro'), IGSP_VERSION)); ?>
</p>
</div>
<div class="igsp-admin-content">
<!-- Tabs Navigation -->
<nav class="igsp-tabs-nav">
<?php foreach ($tabs as $tab_id => $tab): ?>
<a href="<?php echo esc_url(admin_url('admin.php?page=' . IGSP_Admin::PAGE_SLUG . '&tab=' . $tab_id)); ?>"
class="igsp-tab-link <?php echo $current_tab === $tab_id ? 'active' : ''; ?>">
<span class="dashicons <?php echo esc_attr($tab['icon']); ?>"></span>
<?php echo esc_html($tab['title']); ?>
</a>
<?php endforeach; ?>
</nav>
<!-- Tab Content -->
<div class="igsp-tab-content">
<?php
$tab_file = IGSP_PLUGIN_DIR . 'admin/views/tab-' . $current_tab . '.php';
if (file_exists($tab_file)) {
include $tab_file;
} else {
echo '<p>' . esc_html__('Tab content not found.', 'instagram-gallery-sync-pro') . '</p>';
}
?>
</div>
</div>
<!-- Sidebar -->
<div class="igsp-admin-sidebar">
<div class="igsp-sidebar-box igsp-status-box">
<h3>
<?php esc_html_e('Sync Status', 'instagram-gallery-sync-pro'); ?>
</h3>
<div class="igsp-status-info" id="igsp-status-info">
<?php
$cron = new IGSP_Cron();
$status = $cron->get_sync_status();
?>
<div class="igsp-status-row">
<span class="igsp-status-label">
<?php esc_html_e('Total Posts:', 'instagram-gallery-sync-pro'); ?>
</span>
<span class="igsp-status-value" id="igsp-total-posts">
<?php echo esc_html($status['total_posts']); ?>
</span>
</div>
<div class="igsp-status-row">
<span class="igsp-status-label">
<?php esc_html_e('Last Sync:', 'instagram-gallery-sync-pro'); ?>
</span>
<span class="igsp-status-value" id="igsp-last-sync">
<?php echo esc_html($status['last_sync']); ?>
</span>
</div>
<div class="igsp-status-row">
<span class="igsp-status-label">
<?php esc_html_e('Next Sync:', 'instagram-gallery-sync-pro'); ?>
</span>
<span class="igsp-status-value" id="igsp-next-sync">
<?php echo esc_html($status['next_sync']); ?>
</span>
</div>
</div>
</div>
<div class="igsp-sidebar-box igsp-shortcode-box">
<h3>
<?php esc_html_e('Shortcode', 'instagram-gallery-sync-pro'); ?>
</h3>
<code class="igsp-shortcode-display">[instagram_gallery]</code>
<p class="description">
<?php esc_html_e('Use this shortcode to display the gallery on any page or post.', 'instagram-gallery-sync-pro'); ?>
</p>
</div>
<div class="igsp-sidebar-box igsp-help-box">
<h3>
<?php esc_html_e('Need Help?', 'instagram-gallery-sync-pro'); ?>
</h3>
<ul>
<li>
<span class="dashicons dashicons-book"></span>
<a href="#" target="_blank">
<?php esc_html_e('Documentation', 'instagram-gallery-sync-pro'); ?>
</a>
</li>
<li>
<span class="dashicons dashicons-sos"></span>
<a href="#" target="_blank">
<?php esc_html_e('Support', 'instagram-gallery-sync-pro'); ?>
</a>
</li>
</ul>
</div>
</div>
</div>