diff options
author | polo <ordipolo@gmx.fr> | 2022-07-19 13:43:33 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2022-07-19 13:43:33 +0200 |
commit | 66ee0f5f5416aed9f7a7264f18ae6bdf4c8ed50f (patch) | |
tree | 6ac70ed4c4df9b60ef19b0f720ff04ddbde6ef8f /controller | |
parent | ed5df18ed28a338ecd763e6492991ccbf5e23eb0 (diff) | |
download | melaine-66ee0f5f5416aed9f7a7264f18ae6bdf4c8ed50f.zip |
miniatures articles 1
Diffstat (limited to 'controller')
-rw-r--r-- | controller/ajax.php | 7 | ||||
-rw-r--r-- | controller/ckeditor.php | 20 | ||||
-rw-r--r-- | controller/installation.php | 9 |
3 files changed, 26 insertions, 10 deletions
diff --git a/controller/ajax.php b/controller/ajax.php index 489e814..13f5c08 100644 --- a/controller/ajax.php +++ b/controller/ajax.php | |||
@@ -19,10 +19,15 @@ if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_ | |||
19 | $Image = new Image(true); | 19 | $Image = new Image(true); |
20 | $Image->upload(); | 20 | $Image->upload(); |
21 | echo($Image->reponseAjax); // attendu par l'éditeur | 21 | echo($Image->reponseAjax); // attendu par l'éditeur |
22 | |||
23 | $Image->makeThumbnail(630); // => taille de la <div> | ||
24 | // on pourra l'agrandir en cliquant dessus | ||
25 | // code exécuté alors que l'utilisateur récupère la main | ||
22 | } | 26 | } |
23 | exit; // stop !! | 27 | exit(); // stop !! |
24 | } | 28 | } |
25 | 29 | ||
30 | |||
26 | // page restauration quand le fichier zip est lourd | 31 | // page restauration quand le fichier zip est lourd |
27 | // -> input file onchange | 32 | // -> input file onchange |
28 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' | 33 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' |
diff --git a/controller/ckeditor.php b/controller/ckeditor.php index 43fd2e2..3e14494 100644 --- a/controller/ckeditor.php +++ b/controller/ckeditor.php | |||
@@ -34,12 +34,10 @@ function preparationCKeditor($html) | |||
34 | // réception du HTML créé par l'éditeur | 34 | // réception du HTML créé par l'éditeur |
35 | function submitCKeditor() | 35 | function submitCKeditor() |
36 | { | 36 | { |
37 | $page = $_GET['page']; | ||
38 | |||
39 | // déjà fait mais on ne sait jamais | 37 | // déjà fait mais on ne sait jamais |
40 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) | 38 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) |
41 | { | 39 | { |
42 | header('Location: index.php?page=' . $page . '&erreur=connexion'); | 40 | header('Location: index.php?page=' . $_GET['page'] . '&erreur=connexion'); |
43 | exit(); | 41 | exit(); |
44 | } | 42 | } |
45 | 43 | ||
@@ -56,32 +54,36 @@ function submitCKeditor() | |||
56 | //$contenu = mediaSubmit($contenu); | 54 | //$contenu = mediaSubmit($contenu); |
57 | 55 | ||
58 | // ne pas continuer si la variable est vide (javascript mal supporté ou utilisation de IE, bug?, erreur de l'utilisateur), risque perte de contenu !! | 56 | // ne pas continuer si la variable est vide (javascript mal supporté ou utilisation de IE, bug?, erreur de l'utilisateur), risque perte de contenu !! |
59 | if($page != 'discographie' && $contenu == '') | 57 | if($_GET['page'] != 'discographie' && $contenu == '') |
60 | { | 58 | { |
61 | header('Location: index.php?page=' . $page . '&erreur=contenu_vide'); | 59 | header('Location: index.php?page=' . $_GET['page'] . '&erreur=contenu_vide'); |
62 | exit(); | 60 | exit(); |
63 | } | 61 | } |
64 | } | 62 | } |
65 | 63 | ||
66 | // pages avec des articles simples (melaine...) | 64 | // pages avec des articles simples (melaine...) |
67 | if($page != 'discographie') | 65 | if($_GET['page'] != 'discographie') |
68 | { | 66 | { |
69 | $Article = new Article($page); | 67 | $Article = new Article($_GET['page']); |
70 | 68 | ||
71 | if(!isset($_SESSION['target']) || $_SESSION['target'] == '') | 69 | if(!isset($_SESSION['target']) || $_SESSION['target'] == '') |
72 | { | 70 | { |
73 | $Article->create($contenu); | 71 | $Article->create($contenu); |
72 | |||
73 | // create html-mini | ||
74 | } | 74 | } |
75 | else | 75 | else |
76 | { | 76 | { |
77 | $Article->fileCode = $_SESSION['target']; // erreur ici? | 77 | $Article->fileCode = $_SESSION['target']; // erreur ici? |
78 | $Article->update($contenu); | 78 | $Article->update($contenu); |
79 | |||
80 | // update html-mini | ||
79 | } | 81 | } |
80 | } | 82 | } |
81 | // page discographie | 83 | // page discographie |
82 | else if($page == 'discographie') | 84 | else if($_GET['page'] == 'discographie') |
83 | { | 85 | { |
84 | $Album = new Album($page); | 86 | $Album = new Album($_GET['page']); |
85 | 87 | ||
86 | // on retrouve les données si nécessaire | 88 | // on retrouve les données si nécessaire |
87 | if(isset($_SESSION['target']) && $_SESSION['target'] != '') | 89 | if(isset($_SESSION['target']) && $_SESSION['target'] != '') |
diff --git a/controller/installation.php b/controller/installation.php index b2a687c..3745189 100644 --- a/controller/installation.php +++ b/controller/installation.php | |||
@@ -77,6 +77,15 @@ function installation() | |||
77 | { | 77 | { |
78 | createIndexPHP('data/' . $page . '/html/index.php', $droitsFichiers); | 78 | createIndexPHP('data/' . $page . '/html/index.php', $droitsFichiers); |
79 | } | 79 | } |
80 | if(!file_exists('data/' . $page . '/html-mini-images')) | ||
81 | { | ||
82 | mkdir('data/' . $page . '/html-mini-images'); | ||
83 | chmod('data/' . $page . '/html-mini-images', $droitsDossiers); | ||
84 | } | ||
85 | if(!file_exists('data/' . $page . '/html-mini-images/index.php')) | ||
86 | { | ||
87 | createIndexPHP('data/' . $page . '/html-mini-images/index.php', $droitsFichiers); | ||
88 | } | ||
80 | if(!file_exists('data/' . $page . '/images')) | 89 | if(!file_exists('data/' . $page . '/images')) |
81 | { | 90 | { |
82 | mkdir('data/' . $page . '/images'); | 91 | mkdir('data/' . $page . '/images'); |