|
@@ -153,7 +153,7 @@ if (isset($_GET['message'])) {
|
|
|
|
|
|
|
|
<?php if ($action === 'edit' || !empty($errors)): ?>
|
|
<?php if ($action === 'edit' || !empty($errors)): ?>
|
|
|
<div class="form-section">
|
|
<div class="form-section">
|
|
|
- <h3><?php echo $category && $category['id'] > 0 ? 'Edit Category' : 'Create Category'; ?></h3>
|
|
|
|
|
|
|
+ <h3><?php echo $category && $category['id'] > 0 ? t('admin_edit_category') : t('admin_create_category'); ?></h3>
|
|
|
|
|
|
|
|
<?php if (!empty($errors)): ?>
|
|
<?php if (!empty($errors)): ?>
|
|
|
<div class="alert alert-error">
|
|
<div class="alert alert-error">
|
|
@@ -167,31 +167,31 @@ if (isset($_GET['message'])) {
|
|
|
<input type="hidden" name="category_id" value="<?php echo $category['id'] ?? 0; ?>">
|
|
<input type="hidden" name="category_id" value="<?php echo $category['id'] ?? 0; ?>">
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label for="name">Category Name *</label>
|
|
|
|
|
|
|
+ <label for="name"><?php echo t('admin_category_name'); ?> *</label>
|
|
|
<input type="text" id="name" name="name"
|
|
<input type="text" id="name" name="name"
|
|
|
value="<?php echo htmlspecialchars($category['name'] ?? ''); ?>" required>
|
|
value="<?php echo htmlspecialchars($category['name'] ?? ''); ?>" required>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label for="description">Description</label>
|
|
|
|
|
|
|
+ <label for="description"><?php echo t('admin_category_description'); ?></label>
|
|
|
<textarea id="description" name="description" rows="3"><?php echo htmlspecialchars($category['description'] ?? ''); ?></textarea>
|
|
<textarea id="description" name="description" rows="3"><?php echo htmlspecialchars($category['description'] ?? ''); ?></textarea>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-actions">
|
|
<div class="form-actions">
|
|
|
<button type="submit" class="btn btn-primary">
|
|
<button type="submit" class="btn btn-primary">
|
|
|
- <?php echo $category && $category['id'] > 0 ? 'Update' : 'Create'; ?> Category
|
|
|
|
|
|
|
+ <?php echo $category && $category['id'] > 0 ? t('admin_update_category') : t('admin_create_category'); ?>
|
|
|
</button>
|
|
</button>
|
|
|
- <a href="categories.php" class="btn btn-secondary">Cancel</a>
|
|
|
|
|
|
|
+ <a href="categories.php" class="btn btn-secondary"><?php echo t('admin_cancel'); ?></a>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
</div>
|
|
</div>
|
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<div class="categories-list">
|
|
<div class="categories-list">
|
|
|
- <h3>Existing Categories</h3>
|
|
|
|
|
|
|
+ <h3><?php echo t('admin_existing_categories'); ?></h3>
|
|
|
|
|
|
|
|
<?php if (empty($categories)): ?>
|
|
<?php if (empty($categories)): ?>
|
|
|
- <p class="text-center">No categories found. Create your first category above.</p>
|
|
|
|
|
|
|
+ <p class="text-center"><?php echo t('admin_no_categories_found'); ?></p>
|
|
|
<?php else: ?>
|
|
<?php else: ?>
|
|
|
<div class="category-grid">
|
|
<div class="category-grid">
|
|
|
<?php foreach ($categories as $cat): ?>
|
|
<?php foreach ($categories as $cat): ?>
|
|
@@ -199,11 +199,11 @@ if (isset($_GET['message'])) {
|
|
|
<div class="category-header">
|
|
<div class="category-header">
|
|
|
<h4><?php echo htmlspecialchars($cat['name']); ?></h4>
|
|
<h4><?php echo htmlspecialchars($cat['name']); ?></h4>
|
|
|
<div class="category-actions">
|
|
<div class="category-actions">
|
|
|
- <a href="categories.php?action=edit&id=<?php echo $cat['id']; ?>" class="btn btn-sm">Edit</a>
|
|
|
|
|
|
|
+ <a href="categories.php?action=edit&id=<?php echo $cat['id']; ?>" class="btn btn-sm"><?php echo t('admin_edit'); ?></a>
|
|
|
<a href="categories.php?action=delete&id=<?php echo $cat['id']; ?>"
|
|
<a href="categories.php?action=delete&id=<?php echo $cat['id']; ?>"
|
|
|
class="btn btn-sm btn-danger"
|
|
class="btn btn-sm btn-danger"
|
|
|
- onclick="return confirm('Are you sure you want to delete this category?')">
|
|
|
|
|
- Delete
|
|
|
|
|
|
|
+ onclick="return confirm('<?php echo t('admin_delete_category_confirm'); ?>')">
|
|
|
|
|
+ <?php echo t('admin_delete'); ?>
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -214,10 +214,10 @@ if (isset($_GET['message'])) {
|
|
|
|
|
|
|
|
<div class="category-stats">
|
|
<div class="category-stats">
|
|
|
<span class="publication-count">
|
|
<span class="publication-count">
|
|
|
- <?php echo $cat['publication_count']; ?> publication(s)
|
|
|
|
|
|
|
+ <?php echo $cat['publication_count']; ?> <?php echo t('admin_publications'); ?>
|
|
|
</span>
|
|
</span>
|
|
|
<span class="created-date">
|
|
<span class="created-date">
|
|
|
- Created <?php echo date('M j, Y', strtotime($cat['created_at'])); ?>
|
|
|
|
|
|
|
+ <?php echo t('admin_created'); ?> <?php echo date('M j, Y', strtotime($cat['created_at'])); ?>
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|