summaryrefslogtreecommitdiff
path: root/view/discographie.php
blob: 84358dbc2702d7b4397ff9007f480d3f3ee2919a (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
<?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 src="public/main.js"></script>
        <!-- <script type="text/javascript" src="public/file_upload.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(isset($_SESSION))
{
    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" >
                            <button>
                                <a href="index.php?page=discographie&action=edition" >
                                Nouvel album
                                </a>
                            </button>
                        </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 id="<?= $Albums->fileList[$i]['fileCode'] ?>" class="articleSansEditeur">
<?php
    // mettre une adresse + cadre bleu lorsqu'un fichier html existe
    if($avecLien[$i])
    {
?>
                        <a href="index.php?<?= $lienAlbum[$i] ?>" >
<?php
    }
?>
                        <figure>
                            <img 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
    }
    // boutons
    if(isset($_SESSION))
    {
?>
                        <p>
                            <a class="infobulle" href="index.php?<?= $lienBoutonModif[$i] ?>" >
                                <img src="public/icone_modifier.png" >
                                <button>Modifier</button>
                            </a>
                            <a class="infobulle" 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" >
                                <button>Monter</button>
                            </a>
                            <a class="infobulle" 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" >
                                <button>Descendre</button>
                            </a>
                            <a class="infobulle" href="index.php?page=discographie&action=suppression&file_code=<?= $Albums->fileList[$i]['fileCode'] ?>" onclick="confirmerSuppression()" >
                                <img src="public/icone_supprimer.png" >
                                <button>Supprimer</button>
                            </a>
                        </p>
<?php
    }
?>
                    </article>
<?php
}
?>
                </div>
                </section>
<?php
$content = ob_get_clean();