mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-26 06:22:22 +00:00
28 lines
829 B
PHP
28 lines
829 B
PHP
<?php require_once "header.php";
|
|
|
|
$html = file_get_contents("index");
|
|
|
|
if (isset($_GET["edit"])) { ?>
|
|
<form method="POST">
|
|
<label for="content">Contenu de la page :</label>
|
|
<textarea id="content" name="content" class="form-control" rows="<?= substr_count($html, "\n") + 1 ?>"><?php echo $html ?></textarea>
|
|
|
|
<hr />
|
|
|
|
<div class="form-group row">
|
|
<input class="btn btn-primary btn-lg btn-block" name="edit_page" type="submit" value="Modifier"/>
|
|
</div>
|
|
</form>
|
|
<?php }
|
|
else {
|
|
echo $html;
|
|
|
|
if (isset($_SESSION["user_id"]) && $_SESSION["role"] == Role::ADMIN) { ?>
|
|
<hr/>
|
|
<a class="btn btn-primary btn-block btn-lg" style="background-color: #ff2e34;" href="/modifier-page">
|
|
Modifier la page
|
|
</a>
|
|
<?php }
|
|
}
|
|
|
|
require_once "footer.php";
|