diff options
Diffstat (limited to 'view/melaine.php')
| -rw-r--r-- | view/melaine.php | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/view/melaine.php b/view/melaine.php deleted file mode 100644 index ea8434a..0000000 --- a/view/melaine.php +++ /dev/null | |||
| @@ -1,138 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | // view/melaine.php | ||
| 3 | |||
| 4 | // variable $css | ||
| 5 | ob_start(); | ||
| 6 | ?> | ||
| 7 | <link rel="stylesheet" type="text/css" href="public/css/<?= $page_actuelle ?>.css" /> | ||
| 8 | <link rel="stylesheet" type="text/css" href="public/css/donnees_hors_editeur.css" /> | ||
| 9 | <?php | ||
| 10 | $css = ob_get_clean(); | ||
| 11 | |||
| 12 | |||
| 13 | //variable $js | ||
| 14 | ob_start(); | ||
| 15 | ?> | ||
| 16 | <script type="text/javascript" src="public/main.js" ></script> | ||
| 17 | <?php | ||
| 18 | if(isset($_GET['action']) && $_GET['action'] == 'editor') | ||
| 19 | { | ||
| 20 | |||
| 21 | // bibliothèques JS ckeditor | ||
| 22 | ?> | ||
| 23 | <script src="lib/ckeditor5/build/ckeditor.js"></script> | ||
| 24 | <?php | ||
| 25 | } | ||
| 26 | $js = ob_get_clean(); | ||
| 27 | |||
| 28 | |||
| 29 | // variable $header | ||
| 30 | ob_start(); | ||
| 31 | echo "\n"; | ||
| 32 | ?> | ||
| 33 | <header> | ||
| 34 | <div id="titre" > | ||
| 35 | <span class="police_titre" >Melaine Favennec</span> | ||
| 36 | </div> | ||
| 37 | <div id="photo" ></div> | ||
| 38 | </header> | ||
| 39 | <?php | ||
| 40 | $header = ob_get_clean(); | ||
| 41 | |||
| 42 | |||
| 43 | // variable $content | ||
| 44 | ob_start(); | ||
| 45 | if($_SESSION['admin'] == 1) | ||
| 46 | { | ||
| 47 | // à la place du bouton après rechargement | ||
| 48 | if(isset($_GET['action']) && $_GET['action'] == 'editor' && !isset($_GET['file_code'])) | ||
| 49 | { | ||
| 50 | $style = 'class="articleAvecEditeur"'; | ||
| 51 | ?> | ||
| 52 | <div <?= $style ?>> | ||
| 53 | <h3>Rédiger un nouvel article</h3> | ||
| 54 | <?php | ||
| 55 | |||
| 56 | |||
| 57 | echo($editeurHTML); // injection de template-editor.php | ||
| 58 | } | ||
| 59 | |||
| 60 | // bouton | ||
| 61 | else | ||
| 62 | { | ||
| 63 | ?> | ||
| 64 | <div> | ||
| 65 | <p class="boutonArticle" > | ||
| 66 | <a href="index.php?page=melaine&action=editor" > | ||
| 67 | Nouvel article | ||
| 68 | </a> | ||
| 69 | </p> | ||
| 70 | <?php | ||
| 71 | } | ||
| 72 | ?> | ||
| 73 | </div> | ||
| 74 | <?php | ||
| 75 | } | ||
| 76 | |||
| 77 | // on pourrait paginer avec des onglets de par exemple 10 articles | ||
| 78 | |||
| 79 | // tableau articles[] du plus récent au plus ancien | ||
| 80 | for($i = 0; $i < $Articles->fileListCount; $i++) | ||
| 81 | { | ||
| 82 | // la div invisible sert à la compensation des liens d'ancre # | ||
| 83 | |||
| 84 | // article modifié sur fond coloré | ||
| 85 | if(isset($fileCode) && $Articles->fileList[$i]['fileCode'] == $fileCode) | ||
| 86 | { | ||
| 87 | $style = 'class="articleAvecEditeur"'; | ||
| 88 | } | ||
| 89 | else | ||
| 90 | { | ||
| 91 | $style = ''; | ||
| 92 | } | ||
| 93 | ?> | ||
| 94 | <div class="zoneVideNav" ></div> | ||
| 95 | <article id="<?= $Articles->fileList[$i]['fileCode'] ?>"> | ||
| 96 | <div <?= $style ?>> | ||
| 97 | <?php | ||
| 98 | |||
| 99 | // remplacer un article par l'éditeur | ||
| 100 | if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['file_code']) | ||
| 101 | && $_GET['file_code'] == $Articles->fileList[$i]['fileCode'] | ||
| 102 | ) | ||
| 103 | { | ||
| 104 | // on pourrait utiliser ici le timedate, ou encore le nom de l'article | ||
| 105 | ?> | ||
| 106 | <h3>Modification d'un article</h3> | ||
| 107 | <?php | ||
| 108 | echo($editeurHTML); // injection de template-editor.php | ||
| 109 | } | ||
| 110 | |||
| 111 | // placer un article | ||
| 112 | else | ||
| 113 | { | ||
| 114 | // et voila | ||
| 115 | echo($Articles->fileList[$i]['content'] . "\n"); | ||
| 116 | |||
| 117 | // bouton | ||
| 118 | if($_SESSION['admin'] == 1) | ||
| 119 | { | ||
| 120 | ?> | ||
| 121 | <p class="boutonArticle" > | ||
| 122 | <a href="index.php?page=melaine&action=editor&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>#<?= $Articles->fileList[$i]['fileCode'] ?>" > | ||
| 123 | Modifier cet article | ||
| 124 | </a> | ||
| 125 | <!-- un espace --> | ||
| 126 | <a href="index.php?page=melaine&action=suppression&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>" onclick="confirmerSuppression()" > | ||
| 127 | Supprimer cet article | ||
| 128 | </a> | ||
| 129 | </p> | ||
| 130 | <?php | ||
| 131 | } | ||
| 132 | } | ||
| 133 | ?> | ||
| 134 | </div> | ||
| 135 | </article> | ||
| 136 | <?php | ||
| 137 | } | ||
| 138 | $content = ob_get_clean(); | ||
