summaryrefslogtreecommitdiff
path: root/view/discographie.php
blob: 47ee377dd774fb6cf2327a084400a210ebbc594f (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
<?php
// view/discographie.php

// variable $css
ob_start();
?>
        <link rel="stylesheet" type="text/css" href="public/<?= $page_actuelle ?>.css" />
        <link rel="stylesheet" type="text/css" href="public/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" >
                    <span class="police_titre" >Discographie</span>
                </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
$i = 0;
foreach($albumsJSON as $oneAlbum)
{
	// mettre une adresse lorsqu'un fichier html existe
	// si il n'existe pas, mettre une ancre vers l'endroit sur la page
?>
                            <p><a href="index.php?page=<?= $lienAlbum[$i] ?>" ><?= $oneAlbum[0] ?> (<?= $oneAlbum[1] ?>)</a></p>
<?php
	$i++;
}
?>
						</div>
                    	</div>
					</aside>
					<section>
<?php
if($_SESSION['admin'] == 1)
{
	if(isset($_GET['action']) && $_GET['action'] == 'edition' && !isset($_GET['album']))
	{
?>
						<h3>Ajouter un album</h3>
<?= $editeurHTML ?>
<?php
	}
	else
	{
?>
						<p class="boutonAlbum" >
		                    <a href="index.php?page=discographie&action=edition" >
		                        Nouvel album
		                    </a>
		                </p>
<?php
	}
}

// tableau des albums
//$j = count($albums);
$i = 0;
foreach($albumsJSON as $oneAlbum)
{
	// modification
	if(false)
	{}
	else
	{
		// mettre une adresse lorsqu'un fichier html existe
?>
						<article id="<?= $oneAlbum[0] ?>" >
                            <a href="index.php?page=<?= $lienAlbum[$i] ?>" >
                                <figure>
                                    <img class="vignette" src="data/discographie/images/<?= $oneAlbum[2] ?>" alt="" >
                                    <figcaption><?= $oneAlbum[0] ?><br><?= $oneAlbum[1] ?></figcaption>
                                </figure>
                            </a>
                        </article>
<?php

        // bouton pour modifier
        if($_SESSION['admin'] == 1)
        {}
	}
	$i++;
}
?>
	            	</section>
<?php
$content = ob_get_clean();