blob: 3007c86793e5442ebef402b69366e6929ab0eafd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
<?php
// view/discographie.php
// variable $css
ob_start();
?>
<link rel="stylesheet" type="text/css" href="public/css/<?= $page ?>.css" />
<link rel="stylesheet" type="text/css" href="public/css/donnees_hors_editeur.css" />
<?php
$css = ob_get_clean();
// variable $js
ob_start();
?>
<script type="text/javascript" src="public/main.js" ></script>
<?php
if(isset($_GET['action']) && $_GET['action'] == 'edition')
{
// bibliothèques JS ckeditor
?>
<script src="lib/ckeditor5/build/ckeditor.js"></script>
<?php
}
$js = ob_get_clean();
// variable $header
ob_start();
echo "\n";
?>
<header>
<div id="titre" >
<div class="police_titre" >Discographie</div>
</div>
<div id="photo" ></div>
</header>
<?php
$header = ob_get_clean();
// variable $content
ob_start();
?>
<aside>
<div>
<p id="bouton_chronologie" >Chronologie</p>
<div id="chronologie" >
<!-- ajouter à chaque entrée une ancre et un lien soit vers l'ancre soit vers la page dédiée -->
<?php
//for($i = $Albums->fileListCount - 1; $i >= 0; $i--)
for($i = 0; $i < $Albums->fileListCount; $i++)
{
// menu dessous la mouette
// comporte un lien si fichier html existe, sinon une ancre
?>
<p><a class="<?= $linkDiscoChrono[$i] ?>" href="index.php?<?= $lienAlbum[$i] ?>" ><?= $Albums->fileList[$i]['annee'] ?> - <?= $Albums->fileList[$i]['titre'] ?></a></p>
<?php
}
?>
</div>
</div>
</aside>
<section>
<?php
// éditeur ou bouton "Nouvel album"
if($_SESSION['admin'] == 1)
{
if(isset($_GET['action']) && $_GET['action'] == 'edition' && $fileCode == '')
{
$style = 'class="articleAvecEditeur"';
?>
<article <?= $style ?>>
<h3>Ajouter un album</h3>
<?= $editeurHTML ?>
</article>
<?php
}
else
{
$style = '';
?>
<!-- le bouton Nouvel album est considéré comme un article -->
<article>
<p class="boutonAlbum" >
<a href="index.php?page=discographie&action=edition" >
<span>Nouvel album</span>
</a>
</p>
</article>
<?php
}
}
?>
<div id="articles">
<?php
// tableau des albums
//for($i = $Albums->fileListCount - 1; $i >= 0; $i--)
for($i = 0; $i < $Albums->fileListCount; $i++)
{
// article modifié sur fond coloré
if(isset($fileCode) && $Albums->fileList[$i]['fileCode'] == $fileCode)
{
$style = 'class="articleAvecEditeur"';
}
else
{
$style = 'class="articleSansEditeur"';
}
?>
<article id="<?= $Albums->fileList[$i]['fileCode'] ?>" <?= $style ?>>
<?php
// formulaires et éditeur
if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1
&& isset($_GET['action']) && $_GET['action'] == 'edition'
&& $Albums->fileList[$i]['fileCode'] == $fileCode)
{
?>
<h3>Modifier un album</h3>
<?= $editeurHTML ?>
<?php
}
// affichage normal
else
{
// mettre une adresse lorsqu'un fichier html existe
if($avecLien[$i])
{
?>
<a href="index.php?<?= $lienAlbum[$i] ?>" >
<?php
}
?>
<figure>
<img class="vignette" src="data/discographie/images-mini/<?= $Albums->fileList[$i]['pochetteMini'] ?>" alt="" >
<figcaption><?= $Albums->fileList[$i]['titre'] ?><br><?= $Albums->fileList[$i]['annee'] ?></figcaption>
</figure>
<?php
if($avecLien[$i])
{
?>
</a>
<?php
}
// bouton
if($_SESSION['admin'] == 1)
{
?>
<p>
<a href="index.php?<?= $lienBoutonModif[$i] ?>" >
<img src="public/icone_modifier.png" >
</a>
<a href="index.php?page=<?= $page ?>&action=monter&file_code=<?= $Albums->fileList[$i]['fileCode'] ?>&position=<?= $Albums->fileList[$i]['position'] ?>#<?= $Albums->fileList[$i]['fileCode'] ?>" >
<img src="public/icone_monter.png" ></a>
<a href="index.php?page=<?= $page ?>&action=descendre&file_code=<?= $Albums->fileList[$i]['fileCode'] ?>&position=<?= $Albums->fileList[$i]['position'] ?>#<?= $Albums->fileList[$i]['fileCode'] ?>" >
<img src="public/icone_descendre.png" ></a>
<a href="index.php?page=discographie&action=suppression&file_code=<?= $Albums->fileList[$i]['fileCode'] ?>" onclick="confirmerSuppression()" >
<img src="public/icone_supprimer.png" >
</a>
</p>
<?php
}
// bouton pour modifier
if($_SESSION['admin'] == 1)
{}
}
?>
</article>
<?php
}
?>
</div>
</section>
<?php
$content = ob_get_clean();
|