mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
admin/add: add ?mode=student toggle — hides admin header, keeps auth
This commit is contained in:
@@ -8,6 +8,7 @@ if (empty($_SESSION["csrf_token"])) {
|
||||
}
|
||||
|
||||
$pageTitle = "Ajouter un TFE";
|
||||
$studentMode = isset($_GET['mode']) && $_GET['mode'] === 'student';
|
||||
|
||||
require_once __DIR__ . '/../../src/ThesisCreateController.php';
|
||||
|
||||
@@ -47,11 +48,27 @@ function wasSelected($key, $value) {
|
||||
return $formData[$key] == $value;
|
||||
}
|
||||
?>
|
||||
<?php $isAdmin = true; $bodyClass = 'admin-body'; require_once APP_ROOT . '/templates/head.php'; ?>
|
||||
<?php include APP_ROOT . '/templates/header.php'; ?>
|
||||
<?php
|
||||
if ($studentMode) {
|
||||
$bodyClass = 'student-body';
|
||||
require_once APP_ROOT . '/templates/head.php';
|
||||
} else {
|
||||
$isAdmin = true;
|
||||
$bodyClass = 'admin-body';
|
||||
require_once APP_ROOT . '/templates/head.php';
|
||||
include APP_ROOT . '/templates/header.php';
|
||||
}
|
||||
?>
|
||||
|
||||
<main id="main-content">
|
||||
<h1>Ajouter un TFE</h1>
|
||||
<div class="thesis-add-header">
|
||||
<h1>Ajouter un TFE</h1>
|
||||
<?php if (!$studentMode): ?>
|
||||
<a href="?mode=student" class="mode-toggle" target="_blank" rel="noopener">Mode étudiant ↗</a>
|
||||
<?php else: ?>
|
||||
<a href="?mode=admin" class="mode-toggle mode-toggle--back">← Retour admin</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php include APP_ROOT . '/templates/partials/flash-messages.php'; ?>
|
||||
|
||||
@@ -135,8 +152,8 @@ function wasSelected($key, $value) {
|
||||
include APP_ROOT . '/templates/partials/form/select-field.php';
|
||||
?>
|
||||
|
||||
<div class="admin-form-footer">
|
||||
<button type="submit" name="go" class="admin-btn">Soumettre</button>
|
||||
<div class="form-footer">
|
||||
<button type="submit" name="go">Soumettre</button>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user