summaryrefslogtreecommitdiff
path: root/view/discographie.php
diff options
context:
space:
mode:
Diffstat (limited to 'view/discographie.php')
-rw-r--r--view/discographie.php45
1 files changed, 11 insertions, 34 deletions
diff --git a/view/discographie.php b/view/discographie.php
index 6e560af..84358db 100644
--- a/view/discographie.php
+++ b/view/discographie.php
@@ -66,7 +66,7 @@ for($i = 0; $i < $Albums->fileListCount; $i++)
66 <section> 66 <section>
67<?php 67<?php
68// éditeur ou bouton "Nouvel album" 68// éditeur ou bouton "Nouvel album"
69if($_SESSION['admin'] == 1) 69if(isset($_SESSION))
70{ 70{
71 if(isset($_GET['action']) && $_GET['action'] === 'edition' && $fileCode === '') 71 if(isset($_GET['action']) && $_GET['action'] === 'edition' && $fileCode === '')
72 { 72 {
@@ -103,53 +103,31 @@ if($_SESSION['admin'] == 1)
103//for($i = $Albums->fileListCount - 1; $i >= 0; $i--) 103//for($i = $Albums->fileListCount - 1; $i >= 0; $i--)
104for($i = 0; $i < $Albums->fileListCount; $i++) 104for($i = 0; $i < $Albums->fileListCount; $i++)
105{ 105{
106 // article modifié sur fond coloré
107 if(isset($fileCode) && $Albums->fileList[$i]['fileCode'] == $fileCode)
108 {
109 $style = 'class="articleAvecEditeur"';
110 }
111 else
112 {
113 $style = 'class="articleSansEditeur"';
114 }
115?> 106?>
116 <article id="<?= $Albums->fileList[$i]['fileCode'] ?>" <?= $style ?>> 107 <article id="<?= $Albums->fileList[$i]['fileCode'] ?>" class="articleSansEditeur">
117<?php 108<?php
118 // formulaires et éditeur à la place de l'article à modifier 109 // mettre une adresse + cadre bleu lorsqu'un fichier html existe
119 if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1 110 if($avecLien[$i])
120 && isset($_GET['action']) && $_GET['action'] === 'edition'
121 && $Albums->fileList[$i]['fileCode'] == $fileCode)
122 { 111 {
123 ?>
124 <h3>Modifier un album</h3>
125<?= $editeurHTML ?>
126<?php
127 }
128 // affichage normal
129 else
130 {
131 // mettre une adresse lorsqu'un fichier html existe
132 if($avecLien[$i])
133 {
134?> 112?>
135 <a href="index.php?<?= $lienAlbum[$i] ?>" > 113 <a href="index.php?<?= $lienAlbum[$i] ?>" >
136<?php 114<?php
137 } 115 }
138?> 116?>
139 <figure> 117 <figure>
140 <img src="data/discographie/images-mini/<?= $Albums->fileList[$i]['pochetteMini'] ?>" alt="" > 118 <img src="data/discographie/images-mini/<?= $Albums->fileList[$i]['pochetteMini'] ?>" alt="" >
141 <figcaption><?= $Albums->fileList[$i]['titre'] ?><br><?= $Albums->fileList[$i]['annee'] ?></figcaption> 119 <figcaption><?= $Albums->fileList[$i]['titre'] ?><br><?= $Albums->fileList[$i]['annee'] ?></figcaption>
142 </figure> 120 </figure>
143<?php 121<?php
144 if($avecLien[$i]) 122 if($avecLien[$i])
145 { 123 {
146?> 124?>
147 </a> 125 </a>
148<?php 126<?php
149 } 127 }
150 // boutons 128 // boutons
151 if($_SESSION['admin'] == 1) 129 if(isset($_SESSION))
152 { 130 {
153?> 131?>
154 <p> 132 <p>
155 <a class="infobulle" href="index.php?<?= $lienBoutonModif[$i] ?>" > 133 <a class="infobulle" href="index.php?<?= $lienBoutonModif[$i] ?>" >
@@ -170,7 +148,6 @@ for($i = 0; $i < $Albums->fileListCount; $i++)
170 </a> 148 </a>
171 </p> 149 </p>
172<?php 150<?php
173 }
174 } 151 }
175?> 152?>
176 </article> 153 </article>