diff options
author | polo <ordipolo@gmx.fr> | 2022-02-28 02:15:31 +0100 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2022-02-28 02:15:31 +0100 |
commit | abd968a1c573b1862bd0728f0b7b6a88e307900a (patch) | |
tree | ef985fe5757b4516c199a06eb37a5e22f7c5b259 /view | |
parent | f19db76cc3b21785619ffd24bfb34692a3aaa66a (diff) | |
download | melaine-abd968a1c573b1862bd0728f0b7b6a88e307900a.zip |
sauvegarde zip
Diffstat (limited to 'view')
-rw-r--r-- | view/album.php | 21 | ||||
-rw-r--r-- | view/backup.php | 32 | ||||
-rw-r--r-- | view/discographie.php | 3 | ||||
-rw-r--r-- | view/menu.php | 6 | ||||
-rw-r--r-- | view/password.php | 6 | ||||
-rw-r--r-- | view/template-formulaires.php | 8 | ||||
-rw-r--r-- | view/template.php | 22 |
7 files changed, 63 insertions, 35 deletions
diff --git a/view/album.php b/view/album.php index e2731a1..86f1e58 100644 --- a/view/album.php +++ b/view/album.php | |||
@@ -23,7 +23,7 @@ echo "\n"; | |||
23 | ?> | 23 | ?> |
24 | <header> | 24 | <header> |
25 | <div id="titre" > | 25 | <div id="titre" > |
26 | <span class="police_titre" ><?= $albumName ?></span> | 26 | <span class="police_titre" ><?= $Albums->oneAlbum['titre'] ?> - <?= $Albums->oneAlbum['annee'] ?></span> |
27 | </div> | 27 | </div> |
28 | <div id="photo" ></div> | 28 | <div id="photo" ></div> |
29 | </header> | 29 | </header> |
@@ -33,6 +33,25 @@ $header = ob_get_clean(); | |||
33 | // variable $content | 33 | // variable $content |
34 | ob_start(); | 34 | ob_start(); |
35 | ?> | 35 | ?> |
36 | <aside> | ||
37 | <div> | ||
38 | <p id="bouton_chronologie" >Chronologie</p> | ||
39 | <div id="chronologie" > | ||
40 | <!-- ajouter à chaque entrée une ancre et un lien soit vers l'ancre soit vers la page dédiée --> | ||
41 | <?php | ||
42 | //for($i = $Albums->fileListCount - 1; $i >= 0; $i--) | ||
43 | for($i = 0; $i < $Albums->fileListCount; $i++) | ||
44 | { | ||
45 | // menu dessous la mouette | ||
46 | // comporte un lien si fichier html existe, sinon une ancre | ||
47 | ?> | ||
48 | <p><a class="<?= $linkDiscoChrono[$i] ?>" href="index.php?<?= $lienAlbum[$i] ?>" ><?= $Albums->fileList[$i]['annee'] ?> - <?= $Albums->fileList[$i]['titre'] ?></a></p> | ||
49 | <?php | ||
50 | } | ||
51 | ?> | ||
52 | </div> | ||
53 | </div> | ||
54 | </aside> | ||
36 | <article id="albumHTML" > | 55 | <article id="albumHTML" > |
37 | <?= $album ?> | 56 | <?= $album ?> |
38 | </article> | 57 | </article> |
diff --git a/view/backup.php b/view/backup.php index b4339e4..9fce805 100644 --- a/view/backup.php +++ b/view/backup.php | |||
@@ -25,12 +25,13 @@ if(isset($_GET['action']) && $_GET['action'] == 'sauvegarde') | |||
25 | { | 25 | { |
26 | ob_start(); | 26 | ob_start(); |
27 | ?> | 27 | ?> |
28 | <p>Toutes les données du sites (textes, photos) ont été rassemblées dans un gros fichier que vous pouvez garder si vous le souhaitez sur votre ordinateur.</p> | 28 | <h2>Sauvegarde complète</h2> |
29 | <p>Vous pourrez l'utiliser plus tard pour restaurer le site dans l'état où il se trouve aujourd'hui. Ceci est utile dans le cas d'un changement d'hébergement ou dans le cas d'un problème affectant le serveur.</p> | 29 | <p>Toutes les données du sites (textes, photos) ont été rassemblées dans un unique fichier que vous pouvez conserver si vous le souhaitez sur votre ordinateur.</p> |
30 | <p>Ce fichier se nomme <i>melaineDATA.zip</i>.</p><br/> | 30 | <p>Vous pourrez l'utiliser plus tard pour restaurer le site dans l'état où il se trouve aujourd'hui ou pour récupérer des fichiers effacés ou perdus. Ceci est utile dans le cas d'un changement d'hébergement, d'un problème affectant le serveur, ou encore d'une mauvaise manipulation.</p> |
31 | <p>Ce fichier se nomme <i><?= $nomFichier ?></i>.</p> | ||
31 | 32 | ||
32 | <p><a href="data/melaineDATA.zip" style="border: 2px black ridge; padding: 2px;" >Cliquez ici pour télécharger</a></p><br/> | 33 | <button class="boutonBackup" ><a href="data/<?= $nomFichier ?>" >Le télécharger</a></button> |
33 | <p><a href="index.php?page=<?= $from ?>" >Retour au site</a></p> | 34 | <button class="boutonBackup" ><a class="boutonBackup" href="index.php?page=<?= $from ?>" >Retour au site</a></button> |
34 | <?php | 35 | <?php |
35 | $content = ob_get_clean(); | 36 | $content = ob_get_clean(); |
36 | 37 | ||
@@ -43,22 +44,26 @@ if(isset($_GET['action']) && $_GET['action'] == 'sauvegarde') | |||
43 | <?php | 44 | <?php |
44 | $erreur = ob_get_clean(); | 45 | $erreur = ob_get_clean(); |
45 | } | 46 | } |
47 | |||
46 | // page restauration | 48 | // page restauration |
49 | // attention à la taille maximale des fichiers téléchargés en fonction de l'hébergeur | ||
50 | // si le fichier est trop gros il faut l'ouvrir en javascript en envoyer les données petit à petit | ||
47 | elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') | 51 | elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') |
48 | { | 52 | { |
49 | ob_start(); | 53 | ob_start(); |
50 | ?> | 54 | ?> |
51 | <p>Restauration des données à partir d'une sauvegarde.</p> | 55 | <h2>Restauration des données à partir d'une sauvegarde.</h2> |
52 | <p>Vous devez avoir créé un fichier nommé <i>melaineDATA.zip</i><br/> | 56 | <p>Vous devez avoir créé précédemment un fichier <i>melaineDATA.zip</i><br/> |
53 | en cliquant sur <i>Extraire les données</i>.</p><br/> | 57 | à la page <i>Sauvegarder les données.</i></p><br/> |
54 | 58 | ||
55 | <form action="index.php?from=<?= $from ?>&action=insertion" method="post" > | 59 | <form method="post" enctype="multipart/form-data" action="index.php?from=<?= $from ?>&action=restauration" > |
56 | <input type="file" accept=".zip" ><br/> | 60 | <input type="file" name="archive" accept=".zip" class="boutonBackup" ><br/> |
57 | 61 | ||
58 | <!-- demande de confirmation en JS au submit --> | 62 | <!-- demande de confirmation en JS au submit --> |
59 | 63 | ||
60 | <input type="submit" value="Injecter les données" ><br/><br/> | 64 | <input type="submit" class="boutonBackup" value="Valider" ><br/><br/> |
61 | <a href="index.php?page=<?= $from ?>" >Retour au site</a> | 65 | <?= $message ?> |
66 | <button class="boutonBackup" ><a href="index.php?page=<?= $from ?>" >Retour au site</a></button> | ||
62 | </form> | 67 | </form> |
63 | <?php | 68 | <?php |
64 | $content = ob_get_clean(); | 69 | $content = ob_get_clean(); |
@@ -69,6 +74,9 @@ elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') | |||
69 | <head> | 74 | <head> |
70 | <meta charset="utf-8" /> | 75 | <meta charset="utf-8" /> |
71 | <title><?= $title ?></title> | 76 | <title><?= $title ?></title> |
77 | <!-- <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> --> | ||
78 | <link rel="icon" type="image/png" href="public/mouette-logo.png" > | ||
79 | <link rel="stylesheet" type="text/css" href="public/css/normalize.css" /> | ||
72 | <link rel="stylesheet" type="text/css" href="public/css/accueil.css" /> | 80 | <link rel="stylesheet" type="text/css" href="public/css/accueil.css" /> |
73 | <?php | 81 | <?php |
74 | if(isset($_GET['action']) && $_GET['action'] == 'restauration') | 82 | if(isset($_GET['action']) && $_GET['action'] == 'restauration') |
diff --git a/view/discographie.php b/view/discographie.php index 904201a..e234f58 100644 --- a/view/discographie.php +++ b/view/discographie.php | |||
@@ -158,9 +158,6 @@ for($i = 0; $i < $Albums->fileListCount; $i++) | |||
158 | </p> | 158 | </p> |
159 | <?php | 159 | <?php |
160 | } | 160 | } |
161 | ?> | ||
162 | <!-- </article> --> | ||
163 | <?php | ||
164 | 161 | ||
165 | // bouton pour modifier | 162 | // bouton pour modifier |
166 | if($_SESSION['admin'] == 1) | 163 | if($_SESSION['admin'] == 1) |
diff --git a/view/menu.php b/view/menu.php index c20acf9..4c9e341 100644 --- a/view/menu.php +++ b/view/menu.php | |||
@@ -4,7 +4,7 @@ | |||
4 | // variable $css | 4 | // variable $css |
5 | ob_start(); | 5 | ob_start(); |
6 | ?> | 6 | ?> |
7 | <link rel="stylesheet" type="text/css" href="public/<?= $page_actuelle ?>.css" /> | 7 | <link rel="stylesheet" type="text/css" href="public/css/<?= $page_actuelle ?>.css" /> |
8 | <?php | 8 | <?php |
9 | $css = ob_get_clean(); | 9 | $css = ob_get_clean(); |
10 | 10 | ||
@@ -25,8 +25,8 @@ echo "\n\n"; | |||
25 | </div> | 25 | </div> |
26 | </header> | 26 | </header> |
27 | <?php | 27 | <?php |
28 | $header = ob_get_clean(); | 28 | $header = ob_get_clean(); |
29 | 29 | ||
30 | // variable $content | 30 | // variable $content |
31 | ob_start(); | 31 | ob_start(); |
32 | echo "\n"; | 32 | echo "\n"; |
diff --git a/view/password.php b/view/password.php index d63e986..1509f68 100644 --- a/view/password.php +++ b/view/password.php | |||
@@ -38,6 +38,9 @@ ob_start(); | |||
38 | <input type="password" name="nouveauMotdepasse" required > | 38 | <input type="password" name="nouveauMotdepasse" required > |
39 | <br /><br /> | 39 | <br /><br /> |
40 | <input type="submit" value="Valider" > | 40 | <input type="submit" value="Valider" > |
41 | <a href="index.php?page=<?= $_GET['from'] ?>" > | ||
42 | <input type="button" value="Annuler" /> | ||
43 | </a> | ||
41 | </form> | 44 | </form> |
42 | <?php | 45 | <?php |
43 | $formulaireModifMDP = ob_get_clean(); | 46 | $formulaireModifMDP = ob_get_clean(); |
@@ -97,8 +100,7 @@ $warning = ob_get_clean(); | |||
97 | ob_start(); | 100 | ob_start(); |
98 | ?> | 101 | ?> |
99 | <p class="connexionFooter" > | 102 | <p class="connexionFooter" > |
100 | <i>N'oubliez de cliquer sur "déconnexion" quand vous aurez fini.</i><br /> | 103 | <i>N'oubliez de cliquer sur "déconnexion" quand vous aurez fini.</i> |
101 | <a href="index.php?page=<?= $_GET['from'] ?>" >Retour à la page précédente</a> | ||
102 | </p> | 104 | </p> |
103 | </div> | 105 | </div> |
104 | </body> | 106 | </body> |
diff --git a/view/template-formulaires.php b/view/template-formulaires.php index 7873500..d1d47c4 100644 --- a/view/template-formulaires.php +++ b/view/template-formulaires.php | |||
@@ -69,7 +69,9 @@ if($page_actuelle == 'discographie') | |||
69 | // barre d'outils à adapter au "custom build" | 69 | // barre d'outils à adapter au "custom build" |
70 | // la liste ici: lib/ckeditor5/src/ckeditor.js | 70 | // la liste ici: lib/ckeditor5/src/ckeditor.js |
71 | toolbar: { | 71 | toolbar: { |
72 | items: [ 'undo', 'redo', 'selectAll', '|', 'heading', '|', 'alignment', 'bulletedList', 'numberedList', 'todoList', 'blockQuote', 'horizontalLine', '-', 'bold', 'italic', 'underline', | 72 | items: [ 'undo', 'redo', 'selectAll', '|', 'heading', '|', 'alignment', 'bulletedList', 'numberedList', |
73 | //'todoList', | ||
74 | 'blockQuote', 'horizontalLine', '-', 'bold', 'italic', 'underline', | ||
73 | //'strikethrough', | 75 | //'strikethrough', |
74 | '|', | 76 | '|', |
75 | //'fontFamily', | 77 | //'fontFamily', |
@@ -149,8 +151,8 @@ if($page_actuelle == 'discographie') | |||
149 | // Headers supplémentaires envoyés avec la requête | 151 | // Headers supplémentaires envoyés avec la requête |
150 | // c'est ici qu'on installe les mécanismes de sécurités comme l'authentification et la protection au CSRF | 152 | // c'est ici qu'on installe les mécanismes de sécurités comme l'authentification et la protection au CSRF |
151 | headers: { | 153 | headers: { |
152 | 'X-CSRF-TOKEN': 'CSRF-Token', | 154 | //'X-CSRF-TOKEN': 'CSRF-Token', |
153 | Authorization: 'Bearer <JSON Web Token>' | 155 | //Authorization: 'Bearer <JSON Web Token>' |
154 | } | 156 | } |
155 | }, | 157 | }, |
156 | // formats acceptés par défaut: jpeg, png, gif, bmp, webp, tiff | 158 | // formats acceptés par défaut: jpeg, png, gif, bmp, webp, tiff |
diff --git a/view/template.php b/view/template.php index 9422736..4cf0e52 100644 --- a/view/template.php +++ b/view/template.php | |||
@@ -71,18 +71,18 @@ if($_SESSION['admin'] == 1) | |||
71 | 71 | ||
72 | <div id="modeAdmin" > | 72 | <div id="modeAdmin" > |
73 | <p>Vous êtes en mode administrateur. | 73 | <p>Vous êtes en mode administrateur. |
74 | <a id="options" >Options</a> | 74 | <!-- <button id="boutonOptions" >Options</button> --> |
75 | <a href="index.php?page=<?= $page_actuelle ?>&action=deconnexion" >Déconnexion</a> | 75 | <button><a href="index.php?page=<?= $page_actuelle ?>&action=deconnexion" >Déconnexion</a></button> |
76 | </p> | 76 | </p> |
77 | <div> | 77 | <div id="options" > |
78 | <p><a href="index.php?from=<?= $page_actuelle ?>&action=modif_mdp" > | 78 | <button class="boutonBackup" ><a href="index.php?from=<?= $page_actuelle ?>&action=modif_mdp" > |
79 | Changer le mot de passe de connexion.</a></p> | 79 | Changer de mot de passe</a></button> |
80 | <p><a href="index.php?from=<?= $page_actuelle ?>&action=sauvegarde" > | 80 | <button class="boutonBackup" ><a href="index.php?from=<?= $page_actuelle ?>&action=sauvegarde" > |
81 | Sauvegarder les données de tout le site.</a></p> | 81 | Sauvegarder les données</a></button> |
82 | <p><a href="index.php?from=<?= $page_actuelle ?>&action=restauration" >Restaurer les données avec une sauvegarde.</a></p> | 82 | <button class="boutonBackup" ><a href="index.php?from=<?= $page_actuelle ?>&action=restauration" >Les restaurer avec une sauvegarde</a></button> |
83 | <p><a href="data/melainePHP.zip" > | 83 | <button class="boutonBackup" ><a href="data/melainePHP.zip" > |
84 | Télécharger le code PHP pour migration. | 84 | Télécharger le code PHP |
85 | </a></p> | 85 | </a></button> |
86 | </div> | 86 | </div> |
87 | </div> | 87 | </div> |
88 | <?php | 88 | <?php |