|
@@ -3,6 +3,7 @@ require_once '../includes/config.php';
|
|
|
require_once '../includes/database.php';
|
|
require_once '../includes/database.php';
|
|
|
require_once '../includes/auth.php';
|
|
require_once '../includes/auth.php';
|
|
|
require_once '../includes/publication.php';
|
|
require_once '../includes/publication.php';
|
|
|
|
|
+require_once '../includes/translation.php';
|
|
|
|
|
|
|
|
// Include LDAP class if LDAP is enabled
|
|
// Include LDAP class if LDAP is enabled
|
|
|
if (LDAP_ENABLED) {
|
|
if (LDAP_ENABLED) {
|
|
@@ -15,6 +16,9 @@ $auth->requireAuth();
|
|
|
$publication = new Publication();
|
|
$publication = new Publication();
|
|
|
$user = $auth->getUser();
|
|
$user = $auth->getUser();
|
|
|
|
|
|
|
|
|
|
+// Initialize translation system
|
|
|
|
|
+$translation = Translation::getInstance();
|
|
|
|
|
+
|
|
|
// Handle actions
|
|
// Handle actions
|
|
|
$action = $_GET['action'] ?? '';
|
|
$action = $_GET['action'] ?? '';
|
|
|
$message = '';
|
|
$message = '';
|
|
@@ -23,9 +27,9 @@ if ($action === 'delete' && isset($_GET['id'])) {
|
|
|
$id = (int)$_GET['id'];
|
|
$id = (int)$_GET['id'];
|
|
|
try {
|
|
try {
|
|
|
$publication->delete($id);
|
|
$publication->delete($id);
|
|
|
- $message = 'Publication deleted successfully';
|
|
|
|
|
|
|
+ $message = t('admin_publication_deleted_success');
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
- $message = 'Error deleting publication: ' . $e->getMessage();
|
|
|
|
|
|
|
+ $message = t('admin_publication_deleted_error') . ' ' . $e->getMessage();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -54,7 +58,7 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<head>
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
- <title>Publications - <?php echo SITE_TITLE; ?></title>
|
|
|
|
|
|
|
+ <title><?php echo t('admin_nav_publications'); ?> - <?php echo SITE_TITLE; ?></title>
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
</head>
|
|
</head>
|
|
|
<body>
|
|
<body>
|
|
@@ -63,24 +67,24 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<div class="header-content">
|
|
<div class="header-content">
|
|
|
<h1><?php echo SITE_TITLE; ?></h1>
|
|
<h1><?php echo SITE_TITLE; ?></h1>
|
|
|
<nav class="admin-nav">
|
|
<nav class="admin-nav">
|
|
|
- <a href="index.php" class="nav-link">Dashboard</a>
|
|
|
|
|
- <a href="publications.php" class="nav-link active">Publications</a>
|
|
|
|
|
- <a href="categories.php" class="nav-link">Categories</a>
|
|
|
|
|
|
|
+ <a href="index.php" class="nav-link"><?php echo t('admin_nav_dashboard'); ?></a>
|
|
|
|
|
+ <a href="publications.php" class="nav-link active"><?php echo t('admin_nav_publications'); ?></a>
|
|
|
|
|
+ <a href="categories.php" class="nav-link"><?php echo t('admin_nav_categories'); ?></a>
|
|
|
<?php if (LDAP_ENABLED): ?>
|
|
<?php if (LDAP_ENABLED): ?>
|
|
|
- <a href="ldap-users.php" class="nav-link">LDAP Users</a>
|
|
|
|
|
|
|
+ <a href="ldap-users.php" class="nav-link"><?php echo t('admin_nav_ldap_users'); ?></a>
|
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
- <a href="logout.php" class="nav-link">Logout</a>
|
|
|
|
|
|
|
+ <a href="logout.php" class="nav-link"><?php echo t('admin_nav_logout'); ?></a>
|
|
|
</nav>
|
|
</nav>
|
|
|
<div class="user-info">
|
|
<div class="user-info">
|
|
|
- Welcome, <?php echo htmlspecialchars($user['username']); ?>
|
|
|
|
|
|
|
+ <?php echo t('admin_welcome'); ?>, <?php echo htmlspecialchars($user['username']); ?>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</header>
|
|
</header>
|
|
|
|
|
|
|
|
<main class="admin-main">
|
|
<main class="admin-main">
|
|
|
<div class="page-header">
|
|
<div class="page-header">
|
|
|
- <h2>Publications</h2>
|
|
|
|
|
- <a href="edit.php" class="btn btn-primary">Create New Publication</a>
|
|
|
|
|
|
|
+ <h2><?php echo t('admin_nav_publications'); ?></h2>
|
|
|
|
|
+ <a href="edit.php" class="btn btn-primary"><?php echo t('admin_create_publication'); ?></a>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<?php if ($message): ?>
|
|
<?php if ($message): ?>
|
|
@@ -92,23 +96,23 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<div class="filters">
|
|
<div class="filters">
|
|
|
<form method="get" class="filter-form">
|
|
<form method="get" class="filter-form">
|
|
|
<div class="filter-group">
|
|
<div class="filter-group">
|
|
|
- <label for="status">Status:</label>
|
|
|
|
|
|
|
+ <label for="status"><?php echo t('admin_table_status'); ?>:</label>
|
|
|
<select id="status" name="status" onchange="this.form.submit()">
|
|
<select id="status" name="status" onchange="this.form.submit()">
|
|
|
- <option value="all" <?php echo $status === 'all' ? 'selected' : ''; ?>>All</option>
|
|
|
|
|
- <option value="published" <?php echo $status === 'published' ? 'selected' : ''; ?>>Published</option>
|
|
|
|
|
- <option value="draft" <?php echo $status === 'draft' ? 'selected' : ''; ?>>Draft</option>
|
|
|
|
|
- <option value="archived" <?php echo $status === 'archived' ? 'selected' : ''; ?>>Archived</option>
|
|
|
|
|
|
|
+ <option value="all" <?php echo $status === 'all' ? 'selected' : ''; ?>><?php echo t('admin_filter_all'); ?></option>
|
|
|
|
|
+ <option value="published" <?php echo $status === 'published' ? 'selected' : ''; ?>><?php echo t('admin_published'); ?></option>
|
|
|
|
|
+ <option value="draft" <?php echo $status === 'draft' ? 'selected' : ''; ?>><?php echo t('admin_drafts'); ?></option>
|
|
|
|
|
+ <option value="archived" <?php echo $status === 'archived' ? 'selected' : ''; ?>><?php echo t('admin_archived'); ?></option>
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="filter-group">
|
|
<div class="filter-group">
|
|
|
- <label for="search">Search:</label>
|
|
|
|
|
- <input type="text" id="search" name="search" value="<?php echo htmlspecialchars($search); ?>" placeholder="Search publications...">
|
|
|
|
|
|
|
+ <label for="search"><?php echo t('search'); ?>:</label>
|
|
|
|
|
+ <input type="text" id="search" name="search" value="<?php echo htmlspecialchars($search); ?>" placeholder="<?php echo t('admin_search_publications'); ?>...">
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <button type="submit" class="btn btn-sm">Filter</button>
|
|
|
|
|
|
|
+ <button type="submit" class="btn btn-sm"><?php echo t('admin_filter_button'); ?></button>
|
|
|
<?php if ($search || $status !== 'all'): ?>
|
|
<?php if ($search || $status !== 'all'): ?>
|
|
|
- <a href="publications.php" class="btn btn-sm btn-secondary">Clear</a>
|
|
|
|
|
|
|
+ <a href="publications.php" class="btn btn-sm btn-secondary"><?php echo t('admin_clear_button'); ?></a>
|
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
</form>
|
|
</form>
|
|
|
</div>
|
|
</div>
|
|
@@ -117,18 +121,18 @@ $totalPages = ceil($totalPublications / $limit);
|
|
|
<table class="admin-table">
|
|
<table class="admin-table">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th>Title</th>
|
|
|
|
|
- <th>Author</th>
|
|
|
|
|
- <th>Status</th>
|
|
|
|
|
- <th>Created</th>
|
|
|
|
|
- <th>Updated</th>
|
|
|
|
|
- <th>Actions</th>
|
|
|
|
|
|
|
+ <th><?php echo t('admin_table_title'); ?></th>
|
|
|
|
|
+ <th><?php echo t('admin_table_author'); ?></th>
|
|
|
|
|
+ <th><?php echo t('admin_table_status'); ?></th>
|
|
|
|
|
+ <th><?php echo t('admin_table_created'); ?></th>
|
|
|
|
|
+ <th><?php echo t('admin_table_updated'); ?></th>
|
|
|
|
|
+ <th><?php echo t('admin_table_actions'); ?></th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
<?php if (empty($publications)): ?>
|
|
<?php if (empty($publications)): ?>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td colspan="6" class="text-center">No publications found.</td>
|
|
|
|
|
|
|
+ <td colspan="6" class="text-center"><?php echo t('admin_no_publications_found'); ?></td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<?php else: ?>
|
|
<?php else: ?>
|
|
|
<?php foreach ($publications as $pub): ?>
|
|
<?php foreach ($publications as $pub): ?>
|