diff options
author | polo <ordipolo@gmx.fr> | 2023-05-30 23:19:28 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2023-05-30 23:19:28 +0200 |
commit | 082ae3df0b9dd759d56684b0221df62ea171f8ec (patch) | |
tree | 6e442ccd65214d3654f7aceeb9dd931297212cc9 /view | |
parent | 839981c313ee806ea8cc263a081e911a164d1c4f (diff) | |
download | melaine-082ae3df0b9dd759d56684b0221df62ea171f8ec.zip |
bouton partager pour visiteurs
Diffstat (limited to 'view')
-rw-r--r-- | view/album.php | 17 | ||||
-rw-r--r-- | view/articlesContent.php | 28 | ||||
-rw-r--r-- | view/template-formulaires.php | 8 |
3 files changed, 29 insertions, 24 deletions
diff --git a/view/album.php b/view/album.php index 795491d..f8879aa 100644 --- a/view/album.php +++ b/view/album.php | |||
@@ -84,18 +84,19 @@ else | |||
84 | ?> | 84 | ?> |
85 | </article> | 85 | </article> |
86 | <?php | 86 | <?php |
87 | // boutons modifier et supprimer, mais pas monter ni descendre | 87 | |
88 | // modifier ouvre l'éditeur, supprimer renvoie vers la discographie | ||
89 | if($_SESSION['admin'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== 'edition')) | ||
90 | { | ||
91 | $lien_partage = 'index.php?page=' . $page . '&file_code=' . $fileCode; | ||
92 | global $host; | ||
93 | ?> | 88 | ?> |
94 | <p> | 89 | <p> |
95 | <a class="infobulle" href="<?= $lien_partage ?>" > | 90 | <a class="infobulle" href="<?= $lien_partage ?>" > |
96 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" > | 91 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" > |
97 | <button>Partager</button> | 92 | <button>Partager</button> |
98 | </a> | 93 | </a> |
94 | <?php | ||
95 | // boutons modifier et supprimer, mais pas monter ni descendre | ||
96 | // modifier ouvre l'éditeur, supprimer renvoie vers la discographie | ||
97 | if($_SESSION['admin'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== 'edition')) | ||
98 | { | ||
99 | ?> | ||
99 | <a class="infobulle" href="index.php?page=album&action=edition&file_code=<?= $fileCode ?>" > | 100 | <a class="infobulle" href="index.php?page=album&action=edition&file_code=<?= $fileCode ?>" > |
100 | <img src="public/icone_modifier.png" > | 101 | <img src="public/icone_modifier.png" > |
101 | <button>Modifier</button> | 102 | <button>Modifier</button> |
@@ -104,8 +105,10 @@ if($_SESSION['admin'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== 'e | |||
104 | <img src="public/icone_supprimer.png" > | 105 | <img src="public/icone_supprimer.png" > |
105 | <button>Supprimer</button> | 106 | <button>Supprimer</button> |
106 | </a> | 107 | </a> |
108 | <?php | ||
109 | } | ||
110 | ?> | ||
107 | <button><a href="index.php?page=discographie" >Retour page discographie</a></button> | 111 | <button><a href="index.php?page=discographie" >Retour page discographie</a></button> |
108 | </p> | 112 | </p> |
109 | <?php | 113 | <?php |
110 | } | ||
111 | $content = ob_get_clean(); | 114 | $content = ob_get_clean(); |
diff --git a/view/articlesContent.php b/view/articlesContent.php index 87b3676..a03b39d 100644 --- a/view/articlesContent.php +++ b/view/articlesContent.php | |||
@@ -61,7 +61,9 @@ for($i = 0; $i < $Articles->fileListCount; $i++) | |||
61 | <article id="<?= $Articles->fileList[$i]['fileCode'] ?>"> | 61 | <article id="<?= $Articles->fileList[$i]['fileCode'] ?>"> |
62 | <div <?= $style ?>> | 62 | <div <?= $style ?>> |
63 | <?php | 63 | <?php |
64 | 64 | $lien_partage = 'index.php?page=' . $page . '#' . $Articles->fileList[$i]['fileCode']; | |
65 | global $host; | ||
66 | |||
65 | // remplacer un article par l'éditeur | 67 | // remplacer un article par l'éditeur |
66 | if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['file_code']) | 68 | if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['file_code']) |
67 | && $_GET['file_code'] == $Articles->fileList[$i]['fileCode'] | 69 | && $_GET['file_code'] == $Articles->fileList[$i]['fileCode'] |
@@ -72,6 +74,15 @@ for($i = 0; $i < $Articles->fileListCount; $i++) | |||
72 | <h3>Modification d'un article</h3> | 74 | <h3>Modification d'un article</h3> |
73 | <?php | 75 | <?php |
74 | echo($editeurHTML); // injection de template-editor.php | 76 | echo($editeurHTML); // injection de template-editor.php |
77 | ?> | ||
78 | </div> | ||
79 | <p class="boutonArticle" > | ||
80 | <a class="infobulle" href="<?= $lien_partage ?>" > | ||
81 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" > | ||
82 | <button>Partager</button> | ||
83 | </a> | ||
84 | </p> | ||
85 | <?php | ||
75 | } | 86 | } |
76 | 87 | ||
77 | // placer un article | 88 | // placer un article |
@@ -79,19 +90,18 @@ for($i = 0; $i < $Articles->fileListCount; $i++) | |||
79 | { | 90 | { |
80 | // et voila | 91 | // et voila |
81 | echo($Articles->fileList[$i]['content'] . "\n"); | 92 | echo($Articles->fileList[$i]['content'] . "\n"); |
82 | 93 | ?> | |
83 | // bouton | ||
84 | if($_SESSION['admin'] == 1) | ||
85 | { | ||
86 | $lien_partage = 'index.php?page=' . $page . '#' . $Articles->fileList[$i]['fileCode']; | ||
87 | global $host; | ||
88 | ?> | ||
89 | </div> | 94 | </div> |
90 | <p class="boutonArticle" > | 95 | <p class="boutonArticle" > |
91 | <a class="infobulle" href="<?= $lien_partage ?>" > | 96 | <a class="infobulle" href="<?= $lien_partage ?>" > |
92 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" > | 97 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" > |
93 | <button>Partager</button> | 98 | <button>Partager</button> |
94 | </a> | 99 | </a> |
100 | <?php | ||
101 | // bouton | ||
102 | if($_SESSION['admin'] == 1) | ||
103 | { | ||
104 | ?> | ||
95 | <a class="infobulle" href="index.php?page=<?= $page ?>&action=editor&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>#<?= $Articles->fileList[$i]['fileCode'] ?>" > | 105 | <a class="infobulle" href="index.php?page=<?= $page ?>&action=editor&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>#<?= $Articles->fileList[$i]['fileCode'] ?>" > |
96 | <img src="public/icone_modifier.png" > | 106 | <img src="public/icone_modifier.png" > |
97 | <button>Modifier</button> | 107 | <button>Modifier</button> |
@@ -109,7 +119,7 @@ for($i = 0; $i < $Articles->fileListCount; $i++) | |||
109 | <button>Supprimer</button> | 119 | <button>Supprimer</button> |
110 | </a> | 120 | </a> |
111 | </p> | 121 | </p> |
112 | <?php | 122 | <?php |
113 | } | 123 | } |
114 | } | 124 | } |
115 | ?> | 125 | ?> |
diff --git a/view/template-formulaires.php b/view/template-formulaires.php index 8c1d161..0ffbba3 100644 --- a/view/template-formulaires.php +++ b/view/template-formulaires.php | |||
@@ -55,14 +55,6 @@ if($page === 'discographie' || $page === 'album') | |||
55 | <input class="boutonSubmitEditeur" type="submit" value="Valider" /> | 55 | <input class="boutonSubmitEditeur" type="submit" value="Valider" /> |
56 | <a class="boutonAnnuler" href="index.php?page=<?= $lienBoutonAnnuler ?>" > | 56 | <a class="boutonAnnuler" href="index.php?page=<?= $lienBoutonAnnuler ?>" > |
57 | <input type="button" value="Annuler" /></a> | 57 | <input type="button" value="Annuler" /></a> |
58 | <?php | ||
59 | if($page === 'album') | ||
60 | { | ||
61 | ?> | ||
62 | <button><a href="index.php?page=discographie" >Retour page discographie</a></button> | ||
63 | <?php | ||
64 | } | ||
65 | ?> | ||
66 | <script> | 58 | <script> |
67 | let editor; // variable utilisable depuis une fonction | 59 | let editor; // variable utilisable depuis une fonction |
68 | 60 | ||