requireAuth(); $publication = new Publication(); $user = $auth->getUser(); // Translation system is auto-initialized when translation.php is included // Handle actions $action = $_GET['action'] ?? ''; $message = ''; if ($action === 'delete' && isset($_GET['id'])) { $id = (int)$_GET['id']; try { $publication->delete($id); $message = t('admin_publication_deleted_success'); } catch (Exception $e) { $message = t('admin_publication_deleted_error') . ' ' . $e->getMessage(); } } // Get filter parameters $status = $_GET['status'] ?? 'all'; $search = $_GET['search'] ?? ''; $page = max(1, (int)($_GET['page'] ?? 1)); $limit = 20; $offset = ($page - 1) * $limit; // Get publications if ($search) { $publications = $publication->search($search, $status === 'all' ? 'all' : $status); $totalPublications = count($publications); // Apply pagination $publications = array_slice($publications, $offset, $limit); } else { $publications = $publication->getAll($status === 'all' ? 'all' : $status, $limit, $offset); $totalPublications = $publication->db->fetch("SELECT COUNT(*) as count FROM publications" . ($status !== 'all' ? " WHERE status = '$status'" : ""))['count']; } $totalPages = ceil($totalPublications / $limit); ?> <?php echo t('admin_nav_publications'); ?> - <?php echo SITE_TITLE; ?>

100 ? '...' : ''); ?>
1): ?>