summaryrefslogtreecommitdiff
path: root/controller
diff options
context:
space:
mode:
authorpolo <contact@ordipolo.fr>2022-07-20 02:32:22 +0200
committerpolo <contact@ordipolo.fr>2022-07-20 02:32:22 +0200
commita47fe7f5d16f598916b0b6095bd41085bcb03b64 (patch)
treeee2a08ee4a3ee221b24b2b9707c7c2b6d4e549c4 /controller
parent66ee0f5f5416aed9f7a7264f18ae6bdf4c8ed50f (diff)
downloadmelaine-a47fe7f5d16f598916b0b6095bd41085bcb03b64.zip
miniatures articles 2
Diffstat (limited to 'controller')
-rw-r--r--controller/ajax.php4
-rw-r--r--controller/installation.php51
2 files changed, 17 insertions, 38 deletions
diff --git a/controller/ajax.php b/controller/ajax.php
index 13f5c08..24710d8 100644
--- a/controller/ajax.php
+++ b/controller/ajax.php
@@ -18,7 +18,9 @@ if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_
18 // paramètre "true" parce qu'on reçoit une requête AJAX 18 // paramètre "true" parce qu'on reçoit une requête AJAX
19 $Image = new Image(true); 19 $Image = new Image(true);
20 $Image->upload(); 20 $Image->upload();
21
21 echo($Image->reponseAjax); // attendu par l'éditeur 22 echo($Image->reponseAjax); // attendu par l'éditeur
23 // attention ici aux var_dump() ou echo() qui trainent
22 24
23 $Image->makeThumbnail(630); // => taille de la <div> 25 $Image->makeThumbnail(630); // => taille de la <div>
24 // on pourra l'agrandir en cliquant dessus 26 // on pourra l'agrandir en cliquant dessus
@@ -42,7 +44,7 @@ if(isset($_GET['action']) && $_GET['action'] == 'restauration'
42 $_SESSION['fileSize'] = $_GET['file_size']; 44 $_SESSION['fileSize'] = $_GET['file_size'];
43 $_SESSION['fileName'] = $_GET['file_name']; 45 $_SESSION['fileName'] = $_GET['file_name'];
44 //echo("file infos send"); 46 //echo("file infos send");
45 var_dump($_SESSION['fileName']); 47 //var_dump($_SESSION['fileName']);
46 exit(); // stop !! 48 exit(); // stop !!
47 } 49 }
48} 50}
diff --git a/controller/installation.php b/controller/installation.php
index 3745189..6ae35e7 100644
--- a/controller/installation.php
+++ b/controller/installation.php
@@ -50,13 +50,13 @@ function installation()
50 require('view/backup.php'); 50 require('view/backup.php');
51 exit(); 51 exit();
52 } 52 }
53
54 if(!file_exists('data/index.php')) 53 if(!file_exists('data/index.php'))
55 { 54 {
56 createIndexPHP('data/index.php', $droitsFichiers); 55 createIndexPHP('data/index.php', $droitsFichiers);
57 } 56 }
58 57
59 $listePages = array('menu', 'melaine', 'musique', 'discographie', 'presse', 'jaime', 'peinture', 'archives', 'legal'); 58 $listePages = array('menu', 'melaine', 'musique', 'discographie', 'presse', 'jaime', 'peinture', 'archives', 'legal');
59 $sousDossiers = array('html', 'html-maxi-images', 'images', 'images-mini');
60 foreach ($listePages as $page) 60 foreach ($listePages as $page)
61 { 61 {
62 if(!file_exists('data/' . $page)) 62 if(!file_exists('data/' . $page))
@@ -68,41 +68,17 @@ function installation()
68 { 68 {
69 createIndexPHP('data/' . $page . '/index.php', $droitsFichiers); 69 createIndexPHP('data/' . $page . '/index.php', $droitsFichiers);
70 } 70 }
71 if(!file_exists('data/' . $page . '/html')) 71 foreach ($sousDossiers as $dossier)
72 {
73 mkdir('data/' . $page . '/html');
74 chmod('data/' . $page . '/html', $droitsDossiers);
75 }
76 if(!file_exists('data/' . $page . '/html/index.php'))
77 {
78 createIndexPHP('data/' . $page . '/html/index.php', $droitsFichiers);
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 }
89 if(!file_exists('data/' . $page . '/images'))
90 { 72 {
91 mkdir('data/' . $page . '/images'); 73 if(!file_exists('data/' . $page . '/' . $dossier))
92 chmod('data/' . $page . '/images', $droitsDossiers); 74 {
93 } 75 mkdir('data/' . $page . '/' . $dossier);
94 if(!file_exists('data/' . $page . '/images/index.php')) 76 chmod('data/' . $page . '/' . $dossier, $droitsDossiers);
95 { 77 }
96 createIndexPHP('data/' . $page . '/images/index.php', $droitsFichiers); 78 if(!file_exists('data/' . $page . '/' . $dossier . '/index.php'))
97 } 79 {
98 if(!file_exists('data/' . $page . '/images-mini')) 80 createIndexPHP('data/' . $page . '/' . $dossier . '/index.php', $droitsFichiers);
99 { 81 }
100 mkdir('data/' . $page . '/images-mini');
101 chmod('data/' . $page . '/images-mini', $droitsDossiers);
102 }
103 if(!file_exists('data/' . $page . '/images-mini/index.html'))
104 {
105 createIndexPHP('data/' . $page . '/images-mini/index.php', $droitsFichiers);
106 } 82 }
107 // if(!file_exists('data/' . $page . '/multimedia')) 83 // if(!file_exists('data/' . $page . '/multimedia'))
108 // { 84 // {
@@ -110,7 +86,8 @@ function installation()
110 // chmod('data/' . $page . '/multimedia', 0777); 86 // chmod('data/' . $page . '/multimedia', 0777);
111 // } 87 // }
112 } 88 }
113 // dossiers supplémentaires dans discographie 89
90 // dossier supplémentaire dans discographie
114 if(!file_exists('data/discographie/json')) 91 if(!file_exists('data/discographie/json'))
115 { 92 {
116 mkdir('data/discographie/json'); 93 mkdir('data/discographie/json');
@@ -120,6 +97,7 @@ function installation()
120 { 97 {
121 createIndexPHP('data/discographie/json/index.php', $droitsFichiers); 98 createIndexPHP('data/discographie/json/index.php', $droitsFichiers);
122 } 99 }
100
123 // fichiers temporaires pour upload des grosses archives 101 // fichiers temporaires pour upload des grosses archives
124 if(!file_exists('data/tmp')) 102 if(!file_exists('data/tmp'))
125 { 103 {
@@ -130,7 +108,6 @@ function installation()
130 { 108 {
131 createIndexPHP('data/tmp/index.php', $droitsFichiers); 109 createIndexPHP('data/tmp/index.php', $droitsFichiers);
132 } 110 }
133 // le modèle donnera les droits 0666 (octal) aux nouveaux fichiers à l'intérieur des dossiers
134 111
135 // créer le melainePHP.zip 112 // créer le melainePHP.zip
136 if(!file_exists("data/melainePHP.zip")) 113 if(!file_exists("data/melainePHP.zip"))