From c0b176ae142624d6a6daa0f65ea6fead448b8b47 Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 3 Mar 2023 23:44:43 +0100 Subject: inversion de positions --- controller/admin.php | 34 +- controller/ajax.php | 46 ++- controller/installation.php | 24 +- controller/password.php | 2 +- controller/visitor.php | 2 +- index.php | 77 ++++- lib/ckeditor5/config online builder.png | Bin 0 -> 33029 bytes model/Article.php | 102 +++++- public/css/accueil.css | 544 ------------------------------- public/css/discographie.css | 11 +- public/css/main.css | 555 ++++++++++++++++++++++++++++++++ public/css/menu.css | 4 +- public/css/pages_articles_simples.css | 8 +- public/icone_descendre.png | Bin 0 -> 8648 bytes "public/icone_fl\303\250che.xcf" | Bin 0 -> 6734 bytes public/icone_monter.png | Bin 0 -> 8655 bytes public/inversion.js | 16 + view/articlesContent.php | 15 +- view/backup.php | 6 +- view/discographie.php | 7 +- view/pageArticlesSimples.php | 4 +- view/password.php | 2 +- view/template.php | 2 +- 23 files changed, 855 insertions(+), 606 deletions(-) create mode 100644 lib/ckeditor5/config online builder.png delete mode 100644 public/css/accueil.css create mode 100644 public/css/main.css create mode 100644 public/icone_descendre.png create mode 100644 "public/icone_fl\303\250che.xcf" create mode 100644 public/icone_monter.png create mode 100644 public/inversion.js diff --git a/controller/admin.php b/controller/admin.php index 93d1900..845fab1 100644 --- a/controller/admin.php +++ b/controller/admin.php @@ -33,16 +33,14 @@ function pageArticlesSimplesAdmin(string $page, string $title, string $headerPai $Articles->fileCode = $fileCode; $_SESSION['target'] = $Articles->fileCode; - // suppression if($suppression) { $Articles->delete(); - // redirection immédiate avant affichage + // c'est fait, on recharge header('Location: index.php?page=' . $page); exit(); } - // modification else { $title = "Modifier un article"; @@ -91,7 +89,7 @@ function pageArticlesSimplesAdmin(string $page, string $title, string $headerPai } // un article (= actualité) -function menuEdit($fileCode, $suppression) +function menuEdit($fileCode, int $suppression) { $page = "menu"; $title = "Melaine Favennec - menu BD"; @@ -100,56 +98,56 @@ function menuEdit($fileCode, $suppression) } // plusieurs articles -function melaineEdit($fileCode, $suppression) +function melaineEdit($fileCode, int $suppression) { $page = "melaine"; $title = "Mais qui est Melaine Favennec?"; $headerPaintedTitle = 'Melaine Favennec'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function musiqueEdit($fileCode, $suppression) +function musiqueEdit($fileCode, int $suppression) { $page = "musique"; $title = "Musique"; $headerPaintedTitle = 'Musique'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function presseEdit($fileCode, $suppression) +function presseEdit($fileCode, int $suppression) { $page = "presse"; $title = "La presse"; $headerPaintedTitle = 'La Presse'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function livresEdit($fileCode, $suppression) +function livresEdit($fileCode, int $suppression) { $page = "livres"; $title = "Livres"; $headerPaintedTitle = 'Dans les livres'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function jaimeEdit($fileCode, $suppression) +function jaimeEdit($fileCode, int $suppression) { $page = "jaime"; $title = "J'aime"; $headerPaintedTitle = 'J\'aime'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function peintureEdit($fileCode, $suppression) +function peintureEdit($fileCode, int $suppression) { $page = "peinture"; $title = "peinture"; $headerPaintedTitle = 'Celtic Boats'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function archivesEdit($fileCode, $suppression) +function archivesEdit($fileCode, int $suppression) { $page = "archives"; $title = "Archives"; $headerPaintedTitle = 'Archives'; pageArticlesSimplesAdmin($page, $title, $headerPaintedTitle, $fileCode, $suppression); } -function legalEdit($fileCode, $suppression) +function legalEdit($fileCode, int $suppression) { $page = "legal"; $title = "Mentions légales"; @@ -159,7 +157,7 @@ function legalEdit($fileCode, $suppression) // page plus complexe que les autres -function discoEdit($fileCode, $suppression) +function discoEdit($fileCode, int $suppression) { $page = "discographie"; $title = "Discographie"; @@ -270,3 +268,13 @@ function discoEdit($fileCode, $suppression) // fin de l'assemblage require('view/template.php'); } + + +// version sans JS (l'autre est dans ajax.php) +function inversionPositions(string $page, $fileCode, string $class, int $direction) +{ + $Object = new $class($page); + $Object->fileCode = $fileCode; + // direction: 1 = monter, -1 = descendre + $Object->inversionPositions($direction); +} \ No newline at end of file diff --git a/controller/ajax.php b/controller/ajax.php index 24710d8..188b01f 100644 --- a/controller/ajax.php +++ b/controller/ajax.php @@ -1,7 +1,9 @@ insertion d'une image dans l'éditeur if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_image') { @@ -30,6 +32,48 @@ if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_ } +// inversion des positions de deux éléments d'une page +/*if(isset($_GET['action']) && isset($_GET['page']) && ($_GET['action'] == 'monter' || $_GET['action'] == 'descendre') && isset($_GET['file_code']) && !empty($_GET['file_code'])) +{ + // sécurité !! + if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) + { + header('Location: index.php?erreur=interdit'); + } + else + { + require('controller/admin.php'); + require('model/Article.php'); + + $pagesArticlesSimples = ['menu', 'melaine', 'musique', 'presse', 'livres', 'jaime', 'peinture', 'archives', 'legal']; + $sens = 0; + + if($_GET['action'] == 'monter') + { + $sens = 1; + } + if($_GET['action'] == 'descendre') + { + $sens = 0; + } + + if(in_array($_GET['page'], $pagesArticlesSimples)) + { + // 1 pour monter + inversionPositions($_GET['page'], $_GET['file_code'], 'Article', $sens); + } + elseif($_GET['page'] == 'discographie') + { + require('model/Album.php'); + + // 1 pour monter + inversionPositions($_GET['page'], $_GET['file_code'], 'Album', $sens); + } + } + exit(); // stop !! +}*/ + + // page restauration quand le fichier zip est lourd // -> input file onchange if(isset($_GET['action']) && $_GET['action'] == 'restauration' diff --git a/controller/installation.php b/controller/installation.php index 5aa5ac9..2e4e1c3 100644 --- a/controller/installation.php +++ b/controller/installation.php @@ -32,8 +32,8 @@ function installation() // - créer le dossier data à la racine du site // - lui donner les droits du dossier data pour 777 - // valeur en octal - $droitsDossiers = 0777; // mettre 0755 en production + // droits en octal + $droitsDossiers = 0777; $droitsFichiers = 0666; if(!file_exists('data') && !mkdir('data')) @@ -68,16 +68,22 @@ function installation() { createIndexPHP('data/' . $page . '/index.php', $droitsFichiers); } - foreach ($sousDossiers as $dossier) + if(!file_exists('data/' . $page . '/positions.json')) { - if(!file_exists('data/' . $page . '/' . $dossier)) + // création de fichiers VIDES (gestion par le modèle) + touch('data/' . $page . '/positions.json'); + chmod('data/' . $page . '/positions.json', $droitsFichiers); + } + foreach ($sousDossiers as $sousDossier) + { + if(!file_exists('data/' . $page . '/' . $sousDossier)) { - mkdir('data/' . $page . '/' . $dossier); - chmod('data/' . $page . '/' . $dossier, $droitsDossiers); + mkdir('data/' . $page . '/' . $sousDossier); + chmod('data/' . $page . '/' . $sousDossier, $droitsDossiers); } - if(!file_exists('data/' . $page . '/' . $dossier . '/index.php')) + if(!file_exists('data/' . $page . '/' . $sousDossier . '/index.php')) { - createIndexPHP('data/' . $page . '/' . $dossier . '/index.php', $droitsFichiers); + createIndexPHP('data/' . $page . '/' . $sousDossier . '/index.php', $droitsFichiers); } } // if(!file_exists('data/' . $page . '/multimedia')) @@ -87,7 +93,7 @@ function installation() // } } - // dossier supplémentaire dans discographie + // dossier "json" dans discographie if(!file_exists('data/discographie/json')) { mkdir('data/discographie/json'); diff --git a/controller/password.php b/controller/password.php index 9d9b45b..efc8975 100644 --- a/controller/password.php +++ b/controller/password.php @@ -1,7 +1,7 @@ fileList['content'] $Articles->readAll(); + // lourd? $Articles->fileList = array_reverse($Articles->fileList); - //var_dump($Articles->fileList[0]); } // Assemblage diff --git a/index.php b/index.php index 87c020e..66b2f89 100644 --- a/index.php +++ b/index.php @@ -17,18 +17,17 @@ if(!empty($_SESSION['erreur'])) // variables globales, dépendances et config par l'utilisateur require('controller/config.php'); -// au premier démarrage du site (création du dossier "data") -require('controller/installation.php'); - -// penser à faire qu'on ne l'ouvre pas tout le temps // -> présence du data/password.txt? require('controller/password.php'); +// au premier démarrage du site (création du dossier "data") +require('controller/installation.php'); installation(); -// traitement des requêtes AJAX +// traitement des requêtes AJAX, execute exit() à la fin require('controller/ajax.php'); + // traitement des POST du ckeditor // la fonction submitCKeditor est "autonome", elle n'affiche rien puis redirige sans GET if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1 @@ -67,13 +66,7 @@ if(isset($_GET['action']) && isset($_GET['page'])) -// construction des pages - -// mode visiteur (sans l'éditeur) -require('controller/visitor.php'); - // modèle -//if(isset($_GET['page']) && $_GET['page'] != 'menu') if(isset($_GET['page'])) // utile? { require('model/Article.php'); @@ -84,6 +77,11 @@ if(isset($_GET['page'])) // utile? } + +// contrôleurs +// mode visiteur (sans l'éditeur) +require('controller/visitor.php'); + // contrôleur des pages en mode admin if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1) { @@ -97,7 +95,8 @@ else } -// page du site demandée + +// traitements des GET (page du site et action souhaitée) if(isset($_GET['page'])) { $pagesArticlesSimples = ['menu', 'melaine', 'musique', 'presse', 'livres', 'jaime', 'peinture', 'archives', 'legal']; @@ -138,6 +137,33 @@ if(isset($_GET['page'])) $fonctionEdit('', 0); } } + // modification d'un positions.json (version sans JS) + else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'monter') + { + if(isset($_GET['file_code']) && !empty($_GET['file_code'])) + { + // 1 pour monter + inversionPositions($_GET['page'], $_GET['file_code'], 'Article', 1); + $fonctionVisitor(); + } + else + { + $fonctionVisitor(); + } + } + else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'descendre') + { + if(isset($_GET['file_code']) && !empty($_GET['file_code'])) + { + // -1 pour descendre + inversionPositions($_GET['page'], $_GET['file_code'], 'Article', -1); + $fonctionVisitor(); + } + else + { + $fonctionVisitor(); + } + } // suppression else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'suppression') { @@ -171,6 +197,33 @@ if(isset($_GET['page'])) discoEdit('', 0); } } + // modification d'un positions.json (version sans JS) + else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'monter') + { + if(isset($_GET['file_code']) && !empty($_GET['file_code'])) + { + // 1 pour monter + inversionPositions($_GET['page'], $_GET['file_code'], 'Album', 1); + discoVisitor(); + } + else + { + discoVisitor(); + } + } + else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'descendre') + { + if(isset($_GET['file_code']) && !empty($_GET['file_code'])) + { + // 0 pour descendre + inversionPositions($_GET['page'], $_GET['file_code'], 'Album', -1); + discoVisitor(); + } + else + { + discoVisitor(); + } + } // suppression else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'suppression') { diff --git a/lib/ckeditor5/config online builder.png b/lib/ckeditor5/config online builder.png new file mode 100644 index 0000000..77cab31 Binary files /dev/null and b/lib/ckeditor5/config online builder.png differ diff --git a/model/Article.php b/model/Article.php index d0fb019..f4fe65a 100644 --- a/model/Article.php +++ b/model/Article.php @@ -10,8 +10,9 @@ class Article { // pour tous les articles public $page; // page et donc dossier concerné - public $format = 'html'; // vaut 'html' ou 'json' - public $fileListCount; + public $format = 'html'; // 'html' ou 'json' + public $fileListCount; // pour les boucles "for" + // pas de "foreach", on a besoin des compteurs $i public $fileList; // = toutes les données // pour un article (ou album) spécifique @@ -30,11 +31,17 @@ class Article // noter que le chemin et l'extension ne varient pas public function makeFileList() { + // noms des fichiers // globbing = utiliser un pattern pour cibler des fichiers $nameList = glob('data/' . $this->page . '/' . $this->format . '/*.' . $this->format); $this->fileListCount = count($nameList); + // associations: fileCode => position + $positions = $this->readPositionsJSON(); + + // $this->fileList[] + $positionMax = 0; for($i = 0; $i < $this->fileListCount; $i++) { $pathInfo = pathinfo($nameList[$i]); @@ -45,9 +52,100 @@ class Article 'content' => '', //'date' => getdate() // peut-être utile plus tard ]; + + // récupération des positions disponibles + // celles inutilisées sont ignorées + // une case dans $positions: "1677796758" => 2 + if(isset($positions[$fileCode]) && $positions[$fileCode] > 0) + { + $this->fileList[$i]['position'] = $positions[$fileCode]; + $positionMax = max($positions[$fileCode], $positionMax); + } + else + { + $this->fileList[$i]['position'] = 0; + } + } + $this->updatePositionsJSON($positionMax); + + // réordonner "fileList" par rapport aux positions + if(!empty($this->fileList)) + { + $this->sortFileListByPositions(); + } + } + + private function readPositionsJSON() // retourne array ou NULL + { + if(file_exists('data/' . $this->page . '/positions.json')) + { + // "true" pour retourner un tableau et non un objet + $positions = json_decode(file_get_contents('data/' . $this->page . '/positions.json'), true); + } + return $positions; + } + + private function updatePositionsJSON(int $positionMax = -1) + { + // créer les positions manquantes + $positions = []; + for($i = 0; $i < $this->fileListCount; $i++) + { + // fonction appelée par makeFileList() + if($positionMax >= 0) + { + if($this->fileList[$i]['position'] == 0) + { + $positionMax++; + $this->fileList[$i]['position'] = $positionMax; + } + } + + // remplissage comme ceci: "1677796758" => 2 + $positions[$this->fileList[$i]['fileCode']] = $this->fileList[$i]['position']; + } + + file_put_contents('data/' . $this->page . '/positions.json', json_encode($positions)); + } + + private function sortFileListByPositions() + { + // contient les positions seules + $positions = array_column($this->fileList, 'position'); + + // magique! + array_multisort($positions, SORT_ASC, $this->fileList); + } + + // pour modifier l'ordre des éléments de la page + // faire plus tard une version statique pour traitement AJAX + public function inversionPositions(int $direction) + { + for($i = 0; $i < $this->fileListCount; $i++) + { + if($this->fileList[$i]['fileCode'] == $this->fileCode) + { + // si direction vaut 1, inversion avec l'élément au dessus (puisqu'on les affiche dans l'ordre décroissant) + if(($direction === 1 || $direction === -1) && + isset($this->fileList[$i + $direction]['position'])) + { + $c = $this->fileList[$i]['position']; + $this->fileList[$i]['position'] = $this->fileList[$i + $direction]['position']; + $this->fileList[$i + $direction]['position'] = $c; + + // sortie de la boucle + $i = $this->fileListCount; + } + else // inversion du premier avec le précédent ou du dernier avec le suivant + {} + } } + + // écriture du positions.json + $this->updatePositionsJSON(); } + // du code html pour utiliser les miniatures private function makeHtmlMiniImages($content) { // insérer -mini au nom du dossier et au fichier diff --git a/public/css/accueil.css b/public/css/accueil.css deleted file mode 100644 index 2a42e29..0000000 --- a/public/css/accueil.css +++ /dev/null @@ -1,544 +0,0 @@ -/* public/accueil.css */ - -/*@font-face -{ - font-family: "you_are_loved"; - src: url('../fonts/you_are_loved.ttf') format('truetype'), - url('../fonts/you_are_loved.eot'), - url('../fonts/you_are_loved.eot?#iefix') format('embedded-opentype'), - url('../fonts/you_are_loved.woff2') format('woff2'), - url('../fonts/you_are_loved.woff') format('woff'); -}*/ - -@font-face /* pour .police_titre */ -{ - font-family: "IMPACTED"; - src: url('../fonts/IMPACTED.TTF') format('truetype'); -} - -.no_underline -{ - text-decoration: none; -} - -body -{ - margin: 0px; - background-color: #326892; -} - -#bloc_page -{ - max-width: 700px; - margin: auto; - background-color: #FFFFFF; - font-family: Sans-serif; - font-size: 100%; -} - -nav -{ - position: fixed; - z-index: 2; - background-color: white; -} - -/* agir sur ul et li directement affecte le ckeditor */ -#ul_menu -{ - margin: 0px; - padding: 5px; - display: flex; - flex-wrap: wrap; - justify-content: center; -} - -#ul_menu li -{ - list-style-type: none; - white-space: nowrap; -} - -li a -{ - text-decoration: none; - color: #666; -} - -.police_titre -{ - font-family: IMPACTED, Arial, sans; - color: #ddc97a; -} - -a:hover:not(.police_titre) /* :not() = sauf */ -{ - color: #000000; -} - -#actuelle -{ - color: #463c3c; - font-weight: bold; -} - -img -{ - vertical-align: bottom; -} - -.boutonSubmitEditeur -{ - margin-top: 5px; -} - -.boutonAnnuler:hover -{ - border: none; -} - -h3 -{ - margin: 5px; -} -.conteneur_article -{ - margin: 3px; -} - -article -{ - font-size: 90%; - margin: 5px 0; -} -.articleAvecEditeur -{ - background-color: #a8b3d9; - padding: 2px 0px; - margin-bottom: 15px; -} - -form -{ - padding-bottom: 14px; - /*border-bottom: 1px black solid;*/ -} - -#courriel -{ - /*padding-top: 30px;*/ - font-size: 90%; -} - -#courriel * -{ - max-width: 220px; - color: black; - text-decoration: none; -} - -#courriel>button /* bouton pour remonter */ -{ - float: right; -} - -#courrielJS -{ - display: inline; - margin: 2px; -} - -.zoneVideAdmin -{ - padding-top: 10px; -} - -#modeAdmin -{ - background-color: orange; - position: fixed; - bottom: 0px; - width: 700px; - z-index: 2; - padding-top: 2px; - font-size: 90%; -} - -#modeAdmin p -{ - text-align: center; - margin: 0px; - padding: 2px; -} -#modeAdmin>p a -{ - text-decoration: none; - color: initial; -} - -#lienModeAdmin -{ - font-size: 90%; - margin-top: 10px; - margin-right: 30px; - text-align: right; - /* enlever la bande bleue en dessous du bloc_page */ - /*margin-bottom: 0;*/ - padding-bottom: 8px; -} - -#lienModeAdmin a -{ - text-decoration: none; - color: black; -} - -.connexionTitre -{ - margin-top: 0px; - text-align: center; -} -.connexionP -{ - margin: 20px; - text-align: center; -} -.avertissement -{ - color: red; - font-size: 90%; - text-align: center; - padding-bottom: 10px; -} - -.connexionFormulaire -{ - margin: 30px; -} - -.connexionFooter -{ - text-align: right; - padding: 5px; -} - -.connexionFooter a -{ - color: #666; -} - -.boutonBackup -{ - /*font-size: initial;*/ /* corrigé par normalize.css */ - margin: 2px; -} -.boutonBackup a -{ - text-decoration: none; - color: initial; -} - -button -{ - padding: 1px; -} - -/* options au survol */ -#options -{ - /*display: none;*/ - display: flex; -} - - -/* PC, y compris vieux écrans 800x600 */ -@media screen and (min-width: 700px) -{ - .police_titre - { - max-width: 550px; - font-size: 250%; - margin-left: 30px; - padding-top: 20px; - } - - /* compensation des cibles de liens # - superposées au "nav" hors flux */ - .articleSansEditeur:target - { - padding-top: 70px; - margin-top: -70px; - } - - nav - { - border-bottom: 1px black solid; - margin: 0px 35px; - max-width: 630px; - } - - li - { - margin: 6px 15px; - } - - header - { - margin: 0px 35px; - padding-top: 92px; - } - - #bienvenue - { - background-image: url("../accueil/bienvenue.png"); - width: 630px; - height: 596px; - } - - #contenu - { - width: 630px; - margin: auto; - padding-bottom: 40px; - } - - #courriel - { - margin: 0px 35px; - } - - .zoneVideAdmin, #modeAdmin - { - /*height: 30px;*/ - height: 76px; - } - - /*#modeAdmin:hover - { - height: 76px; - }*/ -} - -/* "tablettes" et vieux écrans 640x480 */ -@media screen and (max-width: 699px) -{ - #bloc_page - { - max-width: 540px; - font-size: 90%; - } - - .police_titre - { - font-size: 200%; - margin-left: 25px; - } - .police_titre:not(.police_titre_header) - { - padding-top: 20px; - } - - #bienvenue .police_titre - { - font-size: 250%; - top: 0px; - left: 65px; - } - - .articleSansEditeur:target - { - padding-top: 59px; - margin-top: -59px; - } - - nav - { - margin: 0px 30px; - max-width: 480px; - } - - li - { - margin: 4px 10px; - } - - header - { - margin: 0px 30px; - padding-top: 61px; - } - - #bienvenue - { - background-image: url("../accueil/bienvenue_petit.png"); - width: 480px; - height: 463px; - margin: auto; - } - - #contenu - { - width: 480px; - margin: auto; - padding-bottom: 30px; - } - - #courriel - { - margin: 0px 30px; - } - - .zoneVideAdmin, #modeAdmin - { - height: 71px; - } - - #modeAdmin - { - max-width: 540px; - } -} - - /* on grignote les colonnes autour du texte */ -@media screen and (max-width: 539px) -{ - #modeAdmin div - { - max-width: 480px; - margin: 0px; - border: none; - } - #modeAdmin - { - font-size: 90%; - } - .zoneVideAdmin, #modeAdmin - { - height: 66px; - } -} - -@media screen and (max-width: 479px) -{ - #bloc_page - { - max-width: 380px; - font-size: 85%; - } - - .police_titre - { - font-size: 150%; - margin-left: 15px; - } - .police_titre:not(.police_titre_header) - { - /*padding-top: 10px;*/ - } - - #bienvenue .police_titre - { - font-size: 200%; - top: 0px; - left: 25px; - } - - .articleSansEditeur:target - { - padding-top: 56px; - margin-top: -56px; - } - - nav - { - margin: 0px 30px; - max-width: 320px; - } - - li - { - margin: 0px 10px; - } - - header - { - padding-top: 60px; - } - - #bienvenue - { - background-image: url("../accueil/bienvenue_mini.png"); - width: 320px; - height: 316px; - } - - #contenu - { - width: 320px; - margin: auto; - } - - #courriel - { - margin: 0px 20px; - } - - #courriel * - { - max-width: 180px; - } - - #lienModeAdmin - { - margin-right: 20px; - } - - .zoneVideAdmin, #modeAdmin - { - height: 61px; - } - - #modeAdmin - { - max-width: 380px; - } -} - -/* spécialement pour les petits smartphones*/ -@media screen and (max-width: 379px) -{ - .zoneVideAdmin, #modeAdmin - { - height: 76px; - } - - #modeAdmin - { - /*font-size: 95%;*/ - padding: 0px; - } - #modeAdmin>p - { - /*font-size: 90%;*/ - /*margin: 1px;*/ - text-align: left; - } - - #modeAdmin div - { - max-width: 320px; - } - #modeAdmin>div p - { - /*margin: 0px 5px;*/ - } -} - -/* spécial */ -@media screen and (max-width: 320px) -{ - nav - { - margin: auto; - } -} \ No newline at end of file diff --git a/public/css/discographie.css b/public/css/discographie.css index 0362bb4..4d602fa 100644 --- a/public/css/discographie.css +++ b/public/css/discographie.css @@ -45,6 +45,7 @@ aside div z-index: 1; /* placer le menu déroulant au dessus */ /*background-color: #9fa8d0;*/ background-color: #a4afd4; + /*background-color: white;*/ border: 2px #3d4c9d solid; } @@ -60,6 +61,8 @@ aside div #chronologie p a:hover { color: black; + /*background-color: #a4afd4;*/ + background-color: white; } .linkChrono @@ -115,7 +118,8 @@ input padding-bottom: 20px; border-bottom: 1px black solid; } -.boutonAlbum a +/* mêmes règles que .boutonArticle dans main.css */ +.boutonAlbum span { padding: 2px; border: 4px black groove; @@ -132,7 +136,6 @@ input article { margin: 5px 0px; - width: 22%; /*min-width: 300px;*/ } .articleAvecEditeur @@ -230,6 +233,10 @@ a:hover figure figcaption /* annuler le positionnement du contenu */ margin-top: 55px; } + article + { + width: 32%; + } } @media screen and (max-width: 699px) diff --git a/public/css/main.css b/public/css/main.css new file mode 100644 index 0000000..77ab7ff --- /dev/null +++ b/public/css/main.css @@ -0,0 +1,555 @@ +/* public/main.css */ + +/*@font-face +{ + font-family: "you_are_loved"; + src: url('../fonts/you_are_loved.ttf') format('truetype'), + url('../fonts/you_are_loved.eot'), + url('../fonts/you_are_loved.eot?#iefix') format('embedded-opentype'), + url('../fonts/you_are_loved.woff2') format('woff2'), + url('../fonts/you_are_loved.woff') format('woff'); +}*/ + +@font-face /* pour .police_titre */ +{ + font-family: "IMPACTED"; + src: url('../fonts/IMPACTED.TTF') format('truetype'); +} + +.no_underline +{ + text-decoration: none; +} + +body +{ + margin: 0px; + background-color: #326892; +} + +#bloc_page +{ + max-width: 700px; + margin: auto; + background-color: #FFFFFF; + font-family: Sans-serif; + font-size: 100%; +} + +nav +{ + position: fixed; + z-index: 2; + background-color: white; +} + +/* agir sur ul et li directement affecte le ckeditor */ +#ul_menu +{ + margin: 0px; + padding: 5px; + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +#ul_menu li +{ + list-style-type: none; + white-space: nowrap; +} + +li a +{ + text-decoration: none; + color: #666; +} + +.police_titre +{ + font-family: IMPACTED, Arial, sans; + color: #ddc97a; +} + +a:hover:not(.police_titre) /* :not() = sauf */ +{ + color: #000000; +} + +#actuelle +{ + color: #463c3c; + font-weight: bold; +} + +img +{ + vertical-align: bottom; +} + +.boutonArticle span +{ + padding: 2px; + border: 4px black groove; +} +.boutonSubmitEditeur +{ + margin-top: 5px; +} + +.boutonAnnuler:hover +{ + border: none; +} + +h3 +{ + margin: 5px; +} +.conteneur_article +{ + margin: 3px; +} + +article +{ + font-size: 90%; + margin: 5px 0; +} +/* Eviter la superposition d’une entête fixe sur une ancre */ +article:target +{ + padding-top: 71px; + margin-top: -71px; +} +.articleAvecEditeur +{ + background-color: #a8b3d9; + padding: 2px 0px; + margin-bottom: 15px; +} + +form +{ + padding-bottom: 14px; + /*border-bottom: 1px black solid;*/ +} + +#courriel +{ + /*padding-top: 30px;*/ + font-size: 90%; +} + +#courriel * +{ + max-width: 220px; + color: black; + text-decoration: none; +} + +#courriel>button /* bouton pour remonter */ +{ + float: right; +} + +#courrielJS +{ + display: inline; + margin: 2px; +} + +.zoneVideAdmin +{ + padding-top: 10px; +} + +#modeAdmin +{ + background-color: orange; + position: fixed; + bottom: 0px; + width: 700px; + z-index: 2; + padding-top: 2px; + font-size: 90%; +} + +#modeAdmin p +{ + text-align: center; + margin: 0px; + padding: 2px; +} +#modeAdmin>p a +{ + text-decoration: none; + color: initial; +} + +#lienModeAdmin +{ + font-size: 90%; + margin-top: 10px; + margin-right: 30px; + text-align: right; + /* enlever la bande bleue en dessous du bloc_page */ + /*margin-bottom: 0;*/ + padding-bottom: 8px; +} + +#lienModeAdmin a +{ + text-decoration: none; + color: black; +} + +.connexionTitre +{ + margin-top: 0px; + text-align: center; +} +.connexionP +{ + margin: 20px; + text-align: center; +} +.avertissement +{ + color: red; + font-size: 90%; + text-align: center; + padding-bottom: 10px; +} + +.connexionFormulaire +{ + margin: 30px; +} + +.connexionFooter +{ + text-align: right; + padding: 5px; +} + +.connexionFooter a +{ + color: #666; +} + +.boutonBackup +{ + /*font-size: initial;*/ /* corrigé par normalize.css */ + margin: 2px; +} +.boutonBackup a +{ + text-decoration: none; + color: initial; +} + +button +{ + padding: 1px; +} + +/* options au survol */ +#options +{ + /*display: none;*/ + display: flex; +} + + +/* PC, y compris vieux écrans 800x600 */ +@media screen and (min-width: 700px) +{ + .police_titre + { + max-width: 550px; + font-size: 250%; + margin-left: 30px; + padding-top: 20px; + } + + /* compensation des cibles de liens # + superposées au "nav" hors flux */ + .articleSansEditeur:target + { + padding-top: 70px; + margin-top: -70px; + } + + nav + { + border-bottom: 1px black solid; + margin: 0px 35px; + max-width: 630px; + } + + li + { + margin: 6px 15px; + } + + header + { + margin: 0px 35px; + padding-top: 92px; + } + + #bienvenue + { + background-image: url("../accueil/bienvenue.png"); + width: 630px; + height: 596px; + } + + #contenu + { + width: 630px; + margin: auto; + padding-bottom: 40px; + } + + #courriel + { + margin: 0px 35px; + } + + .zoneVideAdmin, #modeAdmin + { + /*height: 30px;*/ + height: 76px; + } + + /*#modeAdmin:hover + { + height: 76px; + }*/ +} + +/* "tablettes" et vieux écrans 640x480 */ +@media screen and (max-width: 699px) +{ + #bloc_page + { + max-width: 540px; + font-size: 90%; + } + + .police_titre + { + font-size: 200%; + margin-left: 25px; + } + .police_titre:not(.police_titre_header) + { + padding-top: 20px; + } + + #bienvenue .police_titre + { + font-size: 250%; + top: 0px; + left: 65px; + } + + .articleSansEditeur:target + { + padding-top: 59px; + margin-top: -59px; + } + + nav + { + margin: 0px 30px; + max-width: 480px; + } + + li + { + margin: 4px 10px; + } + + header + { + margin: 0px 30px; + padding-top: 61px; + } + + #bienvenue + { + background-image: url("../accueil/bienvenue_petit.png"); + width: 480px; + height: 463px; + margin: auto; + } + + #contenu + { + width: 480px; + margin: auto; + padding-bottom: 30px; + } + + #courriel + { + margin: 0px 30px; + } + + .zoneVideAdmin, #modeAdmin + { + height: 71px; + } + + #modeAdmin + { + max-width: 540px; + } +} + + /* on grignote les colonnes autour du texte */ +@media screen and (max-width: 539px) +{ + #modeAdmin div + { + max-width: 480px; + margin: 0px; + border: none; + } + #modeAdmin + { + font-size: 90%; + } + .zoneVideAdmin, #modeAdmin + { + height: 66px; + } +} + +@media screen and (max-width: 479px) +{ + #bloc_page + { + max-width: 380px; + font-size: 85%; + } + + .police_titre + { + font-size: 150%; + margin-left: 15px; + } + .police_titre:not(.police_titre_header) + { + /*padding-top: 10px;*/ + } + + #bienvenue .police_titre + { + font-size: 200%; + top: 0px; + left: 25px; + } + + .articleSansEditeur:target + { + padding-top: 56px; + margin-top: -56px; + } + + nav + { + margin: 0px 30px; + max-width: 320px; + } + + li + { + margin: 0px 10px; + } + + header + { + padding-top: 60px; + } + + #bienvenue + { + background-image: url("../accueil/bienvenue_mini.png"); + width: 320px; + height: 316px; + } + + #contenu + { + width: 320px; + margin: auto; + } + + #courriel + { + margin: 0px 20px; + } + + #courriel * + { + max-width: 180px; + } + + #lienModeAdmin + { + margin-right: 20px; + } + + .zoneVideAdmin, #modeAdmin + { + height: 61px; + } + + #modeAdmin + { + max-width: 380px; + } +} + +/* spécialement pour les petits smartphones*/ +@media screen and (max-width: 379px) +{ + .zoneVideAdmin, #modeAdmin + { + height: 76px; + } + + #modeAdmin + { + /*font-size: 95%;*/ + padding: 0px; + } + #modeAdmin>p + { + /*font-size: 90%;*/ + /*margin: 1px;*/ + text-align: left; + } + + #modeAdmin div + { + max-width: 320px; + } + #modeAdmin>div p + { + /*margin: 0px 5px;*/ + } +} + +/* spécial */ +@media screen and (max-width: 320px) +{ + nav + { + margin: auto; + } +} \ No newline at end of file diff --git a/public/css/menu.css b/public/css/menu.css index 28cba08..4bf5262 100644 --- a/public/css/menu.css +++ b/public/css/menu.css @@ -13,11 +13,11 @@ { font-size: 90%; } -.boutonArticle a +/*.boutonArticle span { padding: 2px; border: 4px black groove; -} +}*/ .sectionActu {} diff --git a/public/css/pages_articles_simples.css b/public/css/pages_articles_simples.css index 9b6d2c3..2f3e901 100644 --- a/public/css/pages_articles_simples.css +++ b/public/css/pages_articles_simples.css @@ -26,14 +26,14 @@ figure } .boutonNouvelArticle { + /* comme "article" dans main.css */ font-size: 90%; } -.boutonArticle a +.boutonArticle span { - padding: 2px; - border: 4px black groove; + position: relative; + bottom: 6px; } - @media screen and (min-width: 700px) { #titre diff --git a/public/icone_descendre.png b/public/icone_descendre.png new file mode 100644 index 0000000..7980297 Binary files /dev/null and b/public/icone_descendre.png differ diff --git "a/public/icone_fl\303\250che.xcf" "b/public/icone_fl\303\250che.xcf" new file mode 100644 index 0000000..7fcf5d6 Binary files /dev/null and "b/public/icone_fl\303\250che.xcf" differ diff --git a/public/icone_monter.png b/public/icone_monter.png new file mode 100644 index 0000000..8e213ec Binary files /dev/null and b/public/icone_monter.png differ diff --git a/public/inversion.js b/public/inversion.js new file mode 100644 index 0000000..20a6871 --- /dev/null +++ b/public/inversion.js @@ -0,0 +1,16 @@ +// public/inversion.js + +// inverser la position de deux "articles" ou albums d'une page +function inversion() +{ + var page = ''; + var action = ''; // monter ou descendre + var fileCode = ''; // fileList[$i]['fileCode'] ?> + var position = ''; // fileList[$i]['position'] ?> + + const xhr = new XMLHttpRequest(); + url = 'index.php?page='+page+'&action='+action+'&file_code='+fileCode+'&position='+position+'#'+fileCode; + url = 'index.php?action=restauration&file_name='+fileInfos.name+'&file_size='+fileInfos.size; + xhr.open("GET", url); + xhr.send(); +} \ No newline at end of file diff --git a/view/articlesContent.php b/view/articlesContent.php index 5f6b587..c07ba75 100644 --- a/view/articlesContent.php +++ b/view/articlesContent.php @@ -1,7 +1,7 @@

- Nouvel article + Nouvel article

fileListCount; $i++)

- Modifier cet article - -   + + + + + - Supprimer cet article - +

Restauration des données à partir d'une sauvegarde.

-

Vous devez avoir créé précédemment un fichier dont le nom commence par melaineDATA
- à la page Sauvegarder les données.


+

Vous devez avoir précédemment créé et téléchargé un fichier dont le nom commence par melaineDATA
+ sur la page Sauvegarder les données.



@@ -78,7 +78,7 @@ elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') - + + @@ -151,6 +152,10 @@ for($i = 0; $i < $Albums->fileListCount; $i++) + + + + diff --git a/view/pageArticlesSimples.php b/view/pageArticlesSimples.php index 34f5dca..95f8c46 100644 --- a/view/pageArticlesSimples.php +++ b/view/pageArticlesSimples.php @@ -39,9 +39,9 @@ $js = ob_get_clean(); // message lecteur multimedia if($page == 'archives') { - $explications = '

+ $explications = '

- Certains liens vidéos nécessitent le lecteur Real Media (windows, android et iOS) pour être lus.

+ Certains liens vidéos nécessitent le lecteur Real Player (windows, android et iOS) pour être lus.

Vous pouvez aussi utiliser le
lecteur VLC.

'; diff --git a/view/password.php b/view/password.php index a72766e..93cae95 100644 --- a/view/password.php +++ b/view/password.php @@ -78,7 +78,7 @@ ob_start(); - + diff --git a/view/template.php b/view/template.php index 7fafbbb..b86a41c 100644 --- a/view/template.php +++ b/view/template.php @@ -11,7 +11,7 @@ - +