summaryrefslogtreecommitdiff
path: root/view/melaine.php
diff options
context:
space:
mode:
Diffstat (limited to 'view/melaine.php')
-rw-r--r--view/melaine.php113
1 files changed, 113 insertions, 0 deletions
diff --git a/view/melaine.php b/view/melaine.php
new file mode 100644
index 0000000..9fb8482
--- /dev/null
+++ b/view/melaine.php
@@ -0,0 +1,113 @@
1<?php
2// view/melaine.php
3//
4// variable $css
5ob_start();
6?>
7 <link rel="stylesheet" type="text/css" href="public/<?= $page_actuelle ?>.css" />
8 <link rel="stylesheet" type="text/css" href="public/donnees_hors_editeur.css" />
9<?php
10$css = ob_get_clean();
11
12
13//variable $js
14ob_start();
15?>
16 <script type="text/javascript" src="public/main.js" ></script>
17<?php
18if(isset($_GET['action']) && $_GET['action'] == 'editor')
19{
20
21 // bibliothèques JS ckeditor et ckfinder
22?>
23 <script src="lib/ckeditor5/build/ckeditor.js"></script>
24<?php
25}
26$js = ob_get_clean();
27
28
29// variable $header
30ob_start();
31echo "\n";
32?>
33 <header>
34 <div id="titre" >
35 <span class="police_titre" >Melaine Favennec</span>
36 </div>
37 <div id="photo" ></div>
38 </header>
39 <?php
40$header = ob_get_clean();
41
42
43// variable $content
44ob_start();
45if($_SESSION['admin'] == 1)
46{
47 // éditeur
48 if(isset($_GET['action']) && $_GET['action'] == 'editor' && !isset($_GET['article']))
49 {
50 echo("<p>Rédiger un nouvel article</p>");
51 echo($editeurHTML); // injection de template-editor.php
52 }
53
54 // bouton
55 else
56 {
57?>
58 <p class="boutonArticle" >
59 <a href="index.php?page=melaine&action=editor" >
60 Nouvel article
61 </a>
62 </p>
63<?php
64 }
65}
66
67// on pourrait paginer avec des onglets contenant 5 ou 10 articles chacun
68
69// tableau articles[] du dernier au premier (1 case = 1 article)
70for ($i=$nombreDarticles - 1; $i >= 0 ; $i--)
71{
72 $j = $i + 1;
73
74 // la div invisible sert à la compensation des liens d'ancre #
75?>
76 <div class="zoneVideNav" ></div>
77 <article id="article<?= $j ?>" >
78<?php
79
80// remplacer un article par l'éditeur
81if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['article']) && $_GET['article'] == $j)
82{
83 echo("\n<p>Modifier l'article " . $j . "</p>");
84 //echo("<p>Modification d'un article</p>");
85 echo "\n";
86
87 echo($editeurHTML); // injection de template-editor.php
88}
89
90// placer un article
91else
92{
93 // c'était pas compliqué
94 echo($articles[$i] . "\n");
95
96 // bouton
97 if($_SESSION['admin'] == 1)
98 {
99 ?>
100 <p class="boutonArticle" >
101 <a href="index.php?page=melaine&action=editor&article=<?= $j ?>#article<?= $j ?>" >
102 Modifier cet article
103 </a>
104 </p>
105 <?php
106 }
107}
108
109?>
110 </article>
111<?php
112}
113$content = ob_get_clean();