1 | <?php |
---|
2 | |
---|
3 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
4 | include_spip('inc/presentation'); |
---|
5 | |
---|
6 | function exec_eva_habillage_graphisme(){ |
---|
7 | |
---|
8 | $evaTable = "spip_eva_habillage"; |
---|
9 | if (defined("_DIR_PLUGIN_EVASQUELETTES")) { |
---|
10 | $path = _DIR_PLUGIN_EVASQUELETTES."images/vignettes_styles/"; |
---|
11 | $path_evastyle = _DIR_PLUGIN_EVASQUELETTES."eva_styles/"; |
---|
12 | } |
---|
13 | else { |
---|
14 | $path = "../squelettes/images/vignettes_styles/"; |
---|
15 | $path_evastyle = "../squelettes/eva_styles/"; |
---|
16 | } |
---|
17 | $icone = _DIR_PLUGIN_EVA_HABILLAGE."img_pack/eva.gif"; |
---|
18 | |
---|
19 | ?><SCRIPT LANGUAGE="JavaScript"> |
---|
20 | function showColor(val) { |
---|
21 | document.colorform.hexval.value = val; |
---|
22 | } |
---|
23 | </script><?php |
---|
24 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
---|
25 | echo $commencer_page(_T('evahabillage:EVA_nom') , '', '', ''); |
---|
26 | echo gros_titre(_T('evahabillage:EVA_nom'),'',false); |
---|
27 | |
---|
28 | global $connect_statut; |
---|
29 | if ($GLOBALS['connect_statut'] != "0minirezo" OR !$GLOBALS["connect_toutes_rubriques"]) { |
---|
30 | echo _T('avis_non_acces_page'); |
---|
31 | echo fin_gauche(), fin_page(); |
---|
32 | exit; |
---|
33 | } |
---|
34 | |
---|
35 | echo debut_gauche("",true); |
---|
36 | echo debut_droite("",true); |
---|
37 | include_spip('inc/eva_habillage_boutons'); |
---|
38 | echo eva_habillage_boutons('graphisme'); |
---|
39 | |
---|
40 | include_spip("inc/eva_habillage_definition_themes"); |
---|
41 | $def_themes = EVA_def_themes_global(); |
---|
42 | |
---|
43 | if ($_POST['modif_habillage']=='1') { |
---|
44 | foreach ($def_themes as $habillage_modif_cles => $habillage_modif_inutile) { |
---|
45 | $mes_modifs_tableau[$habillage_modif_cles] =$_POST[$habillage_modif_cles]; |
---|
46 | } |
---|
47 | sql_updateq('spip_eva_habillage_themes',$mes_modifs_tableau,"nom='Defaut'"); |
---|
48 | } |
---|
49 | |
---|
50 | if ($_POST['modif_habillage']=='2') { |
---|
51 | foreach (EVA_def_textes() as $habillage_modif_cles => $habillage_modif_inutile) { |
---|
52 | $mes_modifs_tableau[$habillage_modif_cles] =$_POST[$habillage_modif_cles]; |
---|
53 | } |
---|
54 | sql_updateq('spip_eva_habillage_themes',$mes_modifs_tableau,"nom='Defaut'"); |
---|
55 | } |
---|
56 | |
---|
57 | $test_fri=sql_select('id_habillage','spip_eva_habillage',"sauvegarde='Defaut'"); |
---|
58 | $tab_fri=sql_fetch($test_fri); |
---|
59 | if (!isset($tab_fri['id_habillage'])) {sql_insertq('spip_eva_habillage',array('habillage' => '0','sauvegarde' =>'Defaut'));} |
---|
60 | |
---|
61 | $resultat1 = sql_select('habillage','spip_eva_habillage',"sauvegarde = 'Defaut'"); |
---|
62 | $resultat1_tableau = sql_fetch($resultat1); |
---|
63 | $mon_habillage = $resultat1_tableau['habillage']; |
---|
64 | |
---|
65 | |
---|
66 | //Ajustement de la police |
---|
67 | |
---|
68 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/text.png", true, '', _T('evahabillage:EVA_def_police')); |
---|
69 | $resultat_themes_defini = sql_select('*','spip_eva_habillage_themes',"nom='Defaut'"); |
---|
70 | $tableau_themes_defini = sql_fetch($resultat_themes_defini); |
---|
71 | echo '<form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
72 | echo '<div style="text-align:center;">'; |
---|
73 | foreach(EVA_def_textes() as $habillage_cles => $habillage_inutile) { |
---|
74 | echo _T('evahabillage:'.$habillage_cles); |
---|
75 | echo '<input type="text" name="'.$habillage_cles.'" value="'.$tableau_themes_defini[$habillage_cles].'" size="10">'; |
---|
76 | } |
---|
77 | echo '<input type="submit" value="'._T('evahabillage:EVA_valider').'"></div><input type="hidden" name="modif_habillage" value="2"></form>'; |
---|
78 | |
---|
79 | echo fin_cadre_trait_couleur(true); |
---|
80 | |
---|
81 | |
---|
82 | //Module 2 - Ajustements prédéfinis des paramètres d'habillage |
---|
83 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/pinceau.png", true, '', _T('evahabillage:EVA_etape2')); |
---|
84 | echo '<form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
85 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_etape2_detail').'</div>'; |
---|
86 | $couleur_table = 0; |
---|
87 | $themes_principaux = EVA_def_themes(); |
---|
88 | foreach ($themes_principaux as $mon_theme) { |
---|
89 | echo bouton_block_depliable(_T('evahabillage:'.$mon_theme),false,''); |
---|
90 | echo debut_block_depliable(false); |
---|
91 | echo '<br /><table align="center" class="spip">'; |
---|
92 | foreach($def_themes as $habillage_cles => $habillage_inutile) { |
---|
93 | if (strpos($habillage_cles,$mon_theme)!==FALSE) { |
---|
94 | echo '<tr align="center" '; |
---|
95 | if (($couleur_table%2)==0) {echo 'class="row_even"';} else {echo 'class="row_odd"';} |
---|
96 | $couleur_table++; |
---|
97 | echo '><td align="center">'; |
---|
98 | if ((strpos($mon_habillage,'droite')!=FALSE) AND ($habillage_cles=='taille_largeur_menu')) {echo _T('evahabillage:taille_largeur_menudroite');} |
---|
99 | elseif ((strpos($mon_habillage,'droite')!=FALSE) AND ($habillage_cles=='taille_largeur_menudroite')) {echo _T('evahabillage:taille_largeur_menu');} |
---|
100 | else {echo _T('evahabillage:'.$habillage_cles);} |
---|
101 | echo '</td><td align="center">'.'<input '; |
---|
102 | if ((strpos($habillage_cles,'bordure_style')===FALSE) |
---|
103 | AND (strpos($habillage_cles,'bordure_largeur')===FALSE) |
---|
104 | AND (strpos($habillage_cles,'taille_')===FALSE) |
---|
105 | AND (strpos($habillage_cles,'admin_deplacement')===FALSE) |
---|
106 | ){echo 'class="palette" ';} |
---|
107 | echo 'type="text" name="'.$habillage_cles.'" value="'.$tableau_themes_defini[$habillage_cles].'" size="10"></td></tr>'; |
---|
108 | } |
---|
109 | } |
---|
110 | echo '</table><div style="text-align:center;"><input type="submit" value="'._T('evahabillage:EVA_valider').'"></div>'; |
---|
111 | echo fin_block(); |
---|
112 | } |
---|
113 | echo'<input type="hidden" name="modif_habillage" value="1"></form>'; |
---|
114 | |
---|
115 | echo fin_cadre_trait_couleur(true); |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | //Module 3 - Ajout d'imges de fond dans les secteurs |
---|
120 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/img_bloc.png", true, '', _T('evahabillage:EVA_etape3')); |
---|
121 | if(!empty($_FILES['image_eva_habillage_envoi']['tmp_name']) AND is_uploaded_file($_FILES['image_eva_habillage_envoi']['tmp_name']) AND filesize($_FILES['image_eva_habillage_envoi']['tmp_name'])<2000000){ |
---|
122 | list($largeur, $hauteur, $type, $attr)=getimagesize($_FILES['image_eva_habillage_envoi']['tmp_name']); |
---|
123 | if (($type===1) OR ($type===2) OR ($type===3)){ |
---|
124 | if(!move_uploaded_file($_FILES['image_eva_habillage_envoi']['tmp_name'], _DIR_IMG.'eva_habillage/'.$_FILES['image_eva_habillage_envoi']['name'])) |
---|
125 | {echo 'Erreur lors de la copie du fichier';} |
---|
126 | } |
---|
127 | } |
---|
128 | |
---|
129 | if (isset($_POST['supprime_image'])) { |
---|
130 | sql_delete('spip_eva_habillage_images',"id=".$_POST['supprime_image']); |
---|
131 | } |
---|
132 | if (isset($_POST['secteur_image'])) { |
---|
133 | $recup_image_exists = sql_select('id','spip_eva_habillage_images',"nom_div = '".$_POST['secteur_image']."' AND nom_habillage = 'Defaut'"); |
---|
134 | $tab_recup_image_exists = sql_fetch($recup_image_exists); |
---|
135 | $repeat = $_POST['repeat_x']+$_POST['repeat_y']; |
---|
136 | if ($repeat==0) {$rep='no-repeat';} |
---|
137 | elseif ($repeat==1) {$rep='repeat-x';} |
---|
138 | elseif ($repeat==2) {$rep='repeat-y';} |
---|
139 | elseif ($repeat==3) {$rep='repeat';} |
---|
140 | if ($_POST['pos_x']==4) {$Xpos=$_POST['position_x'];} else {$Xpos=$_POST['pos_x'];} |
---|
141 | if ($_POST['pos_y']==4) {$Ypos=$_POST['position_y'];} else {$Ypos=$_POST['pos_y'];} |
---|
142 | if (isset($tab_recup_image_exists['id'])) { |
---|
143 | sql_updateq('spip_eva_habillage_images',array('nom_image' => $_POST['nom_image'], 'pos_x' => $Xpos, 'pos_y' => $Ypos , 'repetition' => $rep , 'attach' => $_POST['attach']),"id =".$tab_recup_image_exists['id']); |
---|
144 | } |
---|
145 | else { |
---|
146 | sql_insertq('spip_eva_habillage_images',array('type' =>'image','nom_habillage' => 'Defaut','nom_div' => $_POST['secteur_image'],'nom_image' =>$_POST['nom_image'],'pos_x' => $Xpos,'pos_y' => $Ypos,'repetition' => $rep,'attach' =>$_POST['attach'])); |
---|
147 | } |
---|
148 | } |
---|
149 | |
---|
150 | echo bouton_block_depliable(_T('evahabillage:EVA_etape3_image_fond'),false,''); |
---|
151 | echo debut_block_depliable(false); |
---|
152 | echo '<br /><form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
153 | echo _T('evahabillage:EVA_etape3_pour_secteur').'<br />'; |
---|
154 | echo '<div style="text-align:center;"><select name="secteur_image">'; |
---|
155 | $def_div = EVA_div_images(); |
---|
156 | foreach ($def_div as $cle => $val) { |
---|
157 | if (strpos($cle,'image_')!==FALSE) {echo '<option value="'.$cle.'">'._T('evahabillage:'.$cle).'</option>';} |
---|
158 | } |
---|
159 | echo '</select></div><br /> <br />'; |
---|
160 | echo _T('evahabillage:EVA_etape3_pos_x'); |
---|
161 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_gauche'); |
---|
162 | echo '<input type="radio" name="pos_x" value="left" checked /> '; |
---|
163 | echo _T('evahabillage:EVA_centre'); |
---|
164 | echo '<input type="radio" name="pos_x" value="center" /> '; |
---|
165 | echo _T('evahabillage:EVA_droite'); |
---|
166 | echo '<input type="radio" name="pos_x" value="right" /></div>'; |
---|
167 | echo '<input type="radio" name="pos_x" value=4 />'._T('evahabillage:EVA_etape3_pos_choix'); |
---|
168 | echo '<br /><div style="text-align:center;"><input type="text" name="position_x" /></div>'; |
---|
169 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_etape3_repeat_x')._T('evahabillage:EVA_non'); |
---|
170 | echo '<input type="radio" name="repeat_x" value=0 checked />'; |
---|
171 | echo ' '._T('evahabillage:EVA_oui'); |
---|
172 | echo '<input type="radio" name="repeat_x" value=1 /></div><br /> <br />'; |
---|
173 | |
---|
174 | echo _T('evahabillage:EVA_etape3_pos_y'); |
---|
175 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_haut'); |
---|
176 | echo '<input type="radio" name="pos_y" value="top" checked /> '; |
---|
177 | echo _T('evahabillage:EVA_centre'); |
---|
178 | echo '<input type="radio" name="pos_y" value="center" /> '; |
---|
179 | echo _T('evahabillage:EVA_bas'); |
---|
180 | echo '<input type="radio" name="pos_y" value="bottom" /></div>'; |
---|
181 | echo '<input type="radio" name="pos_y" value=4 />'._T('evahabillage:EVA_etape3_pos_choix'); |
---|
182 | echo '<br /><div style="text-align:center;"><input type="text" name="position_y" /></div>'; |
---|
183 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_etape3_repeat_y')._T('evahabillage:EVA_non'); |
---|
184 | echo '<input type="radio" name="repeat_y" value=0 checked />'; |
---|
185 | echo ' '._T('evahabillage:EVA_oui'); |
---|
186 | echo '<input type="radio" name="repeat_y" value=2 /></div><br /> <br />'; |
---|
187 | |
---|
188 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_etape3_attach'); |
---|
189 | echo _T('evahabillage:EVA_normal'); |
---|
190 | echo '<input type="radio" name="attach" value="scroll" checked/> '; |
---|
191 | echo _T('evahabillage:EVA_fixe'); |
---|
192 | echo '<input type="radio" name="attach" value="fixed" /></div><br /> <br />'; |
---|
193 | |
---|
194 | echo '<div style="text-align:center;">'._T('evahabillage:EVA_etape3_choix_image').'<strong>'._DIR_PLUGIN_EVA_HABILLAGE."mon_image</strong> ou, notamment dans le cas d'un site mutualisé, |
---|
195 | dans le répertoire <strong>"._DIR_IMG."eva_habillage</strong>, ou utilisez le formulaire de chargement ci-dessous pour éviter le chargement par FTP<br />"; |
---|
196 | echo '<select name="nom_image">'; |
---|
197 | $dir = opendir(_DIR_PLUGIN_EVA_HABILLAGE."mon_image"); |
---|
198 | while ($nom_fichier = readdir($dir)) { |
---|
199 | if (($nom_fichier!='.') AND ($nom_fichier!='..') AND ((strpos($nom_fichier,'.gif')) OR (strpos($nom_fichier,'.jpg')) OR (strpos($nom_fichier,'.png')) OR (strpos($nom_fichier,'.GIF')) OR (strpos($nom_fichier,'.JPG')) OR (strpos($nom_fichier,'.PNG')))) { |
---|
200 | echo '<option value="'.$nom_fichier.'">'.$nom_fichier.'</option>'; |
---|
201 | } |
---|
202 | } |
---|
203 | closedir($dir); |
---|
204 | $dir = opendir(_DIR_IMG."eva_habillage"); |
---|
205 | while ($nom_fichier = readdir($dir)) { |
---|
206 | if (($nom_fichier!='.') AND ($nom_fichier!='..') AND ((strpos($nom_fichier,'.gif')) OR (strpos($nom_fichier,'.jpg')) OR (strpos($nom_fichier,'.png')) OR (strpos($nom_fichier,'.GIF')) OR (strpos($nom_fichier,'.JPG')) OR (strpos($nom_fichier,'.PNG')))) { |
---|
207 | echo '<option value="'.$nom_fichier.'">'.$nom_fichier.'</option>'; |
---|
208 | } |
---|
209 | } |
---|
210 | closedir($dir); |
---|
211 | echo '</select><br /> <br /><input type="submit" value="'._T('evahabillage:EVA_valider').'"></div></form>'; |
---|
212 | echo fin_block(); |
---|
213 | |
---|
214 | echo bouton_block_depliable("Chargement d'images",false,''); |
---|
215 | echo debut_block_depliable(false); |
---|
216 | echo "<center>L'image sera téléchargée dans le répertoire <strong>"._DIR_IMG."eva_habillage</strong><br />"; |
---|
217 | echo "<span style='text-decoration:underline;'><strong>Attention :</strong></span> si une image portant le même nom est déjà présente dans ce répertoire, elle sera alors écrasée."; |
---|
218 | echo '<br /> <br /><form action="'.generer_url_ecrire("eva_habillage_graphisme").'" method="post" enctype="multipart/form-data">'; |
---|
219 | echo '<input type="file" name="image_eva_habillage_envoi" /><br /> <br /><input type="submit" value="Envoyer" /></form></center>'; |
---|
220 | echo fin_block(); |
---|
221 | |
---|
222 | echo bouton_block_depliable(_T('evahabillage:EVA_etape3_liste_images_definies'),false,''); |
---|
223 | echo debut_block_depliable(false); |
---|
224 | $recup_exist_image = sql_select('id , nom_div , nom_image','spip_eva_habillage_images',"type = 'image' AND nom_habillage = 'Defaut'"); |
---|
225 | $test_exist_image = sql_select('id','spip_eva_habillage_images',"type = 'image' AND nom_habillage = 'Defaut' LIMIT 1"); |
---|
226 | $tab_test_exist_image = sql_fetch($test_exist_image); |
---|
227 | if ($tab_test_exist_image!='') { |
---|
228 | echo '<br /><table align="center" class="spip">'; |
---|
229 | echo '<tr align="center" '; |
---|
230 | if (($couleur_table%2)==0) {echo 'class="row_even"';} else {echo 'class="row_odd"';} |
---|
231 | $couleur_table++; |
---|
232 | echo '>'; |
---|
233 | echo '<td align="center"><div style="text-decoration:underline;">Secteur</div></td><td align="center"><div style="text-decoration:underline;">Image</div></td><td align="center"><div style="text-decoration:underline;">Supprimer ?</div></td></tr>'; |
---|
234 | while ($tab_exist_image = sql_fetch($recup_exist_image)) { |
---|
235 | echo '<tr align="center" '; |
---|
236 | if (($couleur_table%2)==0) {echo 'class="row_even"';} else {echo 'class="row_odd"';} |
---|
237 | $couleur_table++; |
---|
238 | echo '><form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'"><td align="center">'._T('evahabillage:'.$tab_exist_image['nom_div']).' </td><td align="center"><strong>'.$tab_exist_image['nom_image'].'</strong></td><td align="center">'; |
---|
239 | echo '<input type="hidden" name="supprime_image" value="'.$tab_exist_image['id'].'" />'; |
---|
240 | echo '<input type="submit" value="'._T('evahabillage:EVA_supprimer').'" /></td></form></tr>'; |
---|
241 | } |
---|
242 | echo '</table>'; |
---|
243 | } |
---|
244 | else { |
---|
245 | echo ' <br />'._T('evahabillage:EVA_aucune_image_fond'); |
---|
246 | } |
---|
247 | echo fin_block().'<br />'; |
---|
248 | echo fin_cadre_trait_couleur(true); |
---|
249 | |
---|
250 | //Aide graphiques (codes couleur et ColorSchemes) |
---|
251 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/palette.png", true, '', _T('evahabillage:EVA_aide_graphisme')); |
---|
252 | include_spip("inc/eva_habillage_choix_couleur"); |
---|
253 | eva_habillage_choix_couleur(); |
---|
254 | echo '<hr /><p><a href="'._DIR_PLUGIN_EVA_HABILLAGE.'colorschemes2" target="_blank" title="Cliquez ici pour utiliser ColorSchemes2 !">'._T('evahabillage:colorschemes2').'</a></p><br />'; |
---|
255 | echo fin_cadre_trait_couleur(true); |
---|
256 | |
---|
257 | //Taille des logos |
---|
258 | if ($_POST['test_logo']==2) { |
---|
259 | if (is_numeric($_POST['largeur_mini_logo'])) {$logo1l=$_POST['largeur_mini_logo'];} else {$logo1l='';} |
---|
260 | if (is_numeric($_POST['hauteur_mini_logo'])) {$logo1h=$_POST['hauteur_mini_logo'];} else {$logo1h='';} |
---|
261 | if (is_numeric($_POST['largeur_petit_logo'])) {$logo2l=$_POST['largeur_petit_logo'];} else {$logo2l='';}; |
---|
262 | if (is_numeric($_POST['hauteur_petit_logo'])) {$logo2h=$_POST['hauteur_petit_logo'];} else {$logo2h='';} |
---|
263 | if (is_numeric($_POST['largeur_logo_moyen'])) {$logo3l=$_POST['largeur_logo_moyen'];} else {$logo3l='';} |
---|
264 | if (is_numeric($_POST['hauteur_logo_moyen'])) {$logo3h=$_POST['hauteur_logo_moyen'];} else {$logo3h='';} |
---|
265 | sql_delete('spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut'"); |
---|
266 | sql_insertq('spip_eva_habillage_images',array('type'=>'logos','nom_habillage'=>'Defaut','nom_div'=>'largeur_mini_logo','nom_image'=>$logo1l)); |
---|
267 | sql_insertq('spip_eva_habillage_images',array('type'=>'logos','nom_habillage'=>'Defaut','nom_div'=>'hauteur_mini_logo','nom_image'=>$logo1h)); |
---|
268 | sql_insertq('spip_eva_habillage_images',array('type'=>'logos','nom_habillage'=>'Defaut','nom_div'=>'largeur_petit_logo','nom_image'=>$logo2l)); |
---|
269 | sql_insertq('spip_eva_habillage_images',array('type'=>'logos','nom_habillage'=>'Defaut','nom_div'=>'hauteur_petit_logo','nom_image'=>$logo2h)); |
---|
270 | sql_insertq('spip_eva_habillage_images',array('type'=>'logos','nom_habillage'=>'Defaut','nom_div'=>'largeur_logo_moyen','nom_image'=>$logo3l)); |
---|
271 | sql_insertq('spip_eva_habillage_images',array('type'=>'logos','nom_habillage'=>'Defaut','nom_div'=>'hauteur_logo_moyen','nom_image'=>$logo3h)); |
---|
272 | } |
---|
273 | $test_logo1l=sql_select('nom_image','spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut' AND nom_div='largeur_mini_logo'"); |
---|
274 | $tab_logo1l=sql_fetch($test_logo1l); |
---|
275 | $logo1l=$tab_logo1l['nom_image']; |
---|
276 | $test_logo1h=sql_select('nom_image','spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut' AND nom_div='hauteur_mini_logo'"); |
---|
277 | $tab_logo1h=sql_fetch($test_logo1h); |
---|
278 | $logo1h=$tab_logo1h['nom_image']; |
---|
279 | $test_logo2l=sql_select('nom_image','spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut' AND nom_div='largeur_petit_logo'"); |
---|
280 | $tab_logo2l=sql_fetch($test_logo2l); |
---|
281 | $logo2l=$tab_logo2l['nom_image']; |
---|
282 | $test_logo2h=sql_select('nom_image','spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut' AND nom_div='hauteur_petit_logo'"); |
---|
283 | $tab_logo2h=sql_fetch($test_logo2h); |
---|
284 | $logo2h=$tab_logo2h['nom_image']; |
---|
285 | $test_logo3l=sql_select('nom_image','spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut' AND nom_div='largeur_logo_moyen'"); |
---|
286 | $tab_logo3l=sql_fetch($test_logo3l); |
---|
287 | $logo3l=$tab_logo3l['nom_image']; |
---|
288 | $test_logo3h=sql_select('nom_image','spip_eva_habillage_images',"type='logos' AND nom_habillage='Defaut' AND nom_div='hauteur_logo_moyen'"); |
---|
289 | $tab_logo3h=sql_fetch($test_logo3h); |
---|
290 | $logo3h=$tab_logo3h['nom_image']; |
---|
291 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/eva.gif", true, '', _T('evahabillage:logos_taille_def')); |
---|
292 | echo _T('evahabillage:logos_taille_detail'); |
---|
293 | echo '<center><form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
294 | echo '<br /><table align="center" class="spip">'; |
---|
295 | echo '<tr align="center" class="row_even">'; |
---|
296 | echo '<td align="center">Type de logo</td><td align="center">Largeur maximale</td><td align="center">Hauteur maximale</td></tr>'; |
---|
297 | echo '<tr align="center" class="row_odd">'; |
---|
298 | echo '<td align="center">Mini logos</td><td align="center"><center><input type="text" name="largeur_mini_logo" value="'.$logo1l.'" size="4"></center></td><td align="center"><center><input type="text" name="hauteur_mini_logo" value="'.$logo1h.'" size="4"></center></td></tr>'; |
---|
299 | echo '<tr align="center" class="row_even">'; |
---|
300 | echo '<td align="center">Petits logos</td><td align="center"><center><input type="text" name="largeur_petit_logo" value="'.$logo2l.'" size="4"></center></td><td align="center"><center><input type="text" name="hauteur_petit_logo" value="'.$logo2h.'" size="4"></center></td></tr>'; |
---|
301 | echo '<tr align="center" class="row_odd">'; |
---|
302 | echo '<td align="center">Logos moyens</td><td align="center"><center><input type="text" name="largeur_logo_moyen" value="'.$logo3l.'" size="4"></center></td><td align="center"><center><input type="text" name="hauteur_logo_moyen" value="'.$logo3h.'" size="4"></center></td></tr>'; |
---|
303 | echo '</table><br /><input type="hidden" name="test_logo" value="2"><input type="submit" value="'._T('evahabillage:EVA_valider').'" /></form>'; |
---|
304 | echo fin_cadre_trait_couleur(true); |
---|
305 | |
---|
306 | //Insertion de banières Flash (format swf) |
---|
307 | |
---|
308 | if(!empty($_FILES['flash_eva_habillage_envoi']['tmp_name']) AND is_uploaded_file($_FILES['flash_eva_habillage_envoi']['tmp_name']) AND (strpos($_FILES['flash_eva_habillage_envoi']['name'],'.swf'))){ |
---|
309 | if(!move_uploaded_file($_FILES['flash_eva_habillage_envoi']['tmp_name'], _DIR_IMG.'eva_habillage/flash/'.$_FILES['flash_eva_habillage_envoi']['name'])) |
---|
310 | {echo 'Erreur lors de la copie du fichier';} |
---|
311 | } |
---|
312 | |
---|
313 | if (isset($_POST['supprime_flash'])) { |
---|
314 | sql_delete('spip_eva_habillage_images',"id=".$_POST['supprime_flash']); |
---|
315 | } |
---|
316 | |
---|
317 | if (isset($_POST['secteur_flash'])) { |
---|
318 | $recup_flash_exists = sql_select('id','spip_eva_habillage_images',"nom_div = '".$_POST['secteur_flash']."' AND nom_habillage = 'Defaut'"); |
---|
319 | $tab_recup_flash_exists = sql_fetch($recup_flash_exists); |
---|
320 | if (($_POST['secteur_flash']=='flash_secteur_pied') OR ($_POST['secteur_flash']=='flash_secteur_titre')) { |
---|
321 | if (isset($tab_recup_flash_exists['id'])) { |
---|
322 | sql_updateq('spip_eva_habillage_images',array('nom_image' => $_POST['nom_flash'], 'pos_x' => $_POST['flash_horizontal'], 'pos_y' => $_POST['flash_vertical'],'repetition' => $_POST['flash_version']), "id =".$tab_recup_flash_exists['id']); |
---|
323 | } |
---|
324 | else { |
---|
325 | sql_insertq('spip_eva_habillage_images',array('type' =>'flash','nom_habillage' => 'Defaut','nom_div' => $_POST['secteur_flash'],'nom_image' =>$_POST['nom_flash'],'pos_x' => $_POST['flash_horizontal'], 'pos_y' => $_POST['flash_vertical'],'repetition' => $_POST['flash_version'])); |
---|
326 | } |
---|
327 | } |
---|
328 | else { |
---|
329 | sql_insertq('spip_eva_habillage_images',array('type' =>'flash','nom_habillage' => 'Defaut','nom_div' => $_POST['secteur_flash'],'nom_image' =>$_POST['nom_flash'],'pos_x' => $_POST['flash_horizontal'], 'pos_y' => $_POST['flash_vertical'],'repetition' => $_POST['flash_version'])); |
---|
330 | } |
---|
331 | } |
---|
332 | |
---|
333 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/EVA_flash.png", true, '', _T('evahabillage:flash_titre')); |
---|
334 | |
---|
335 | echo bouton_block_depliable(_T('evahabillage:flash_inserer'),false,''); |
---|
336 | echo debut_block_depliable(false); |
---|
337 | echo debut_boite_info(true); |
---|
338 | echo '<br /><form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
339 | echo _T('evahabillage:EVA_etape3_pour_secteur').'<br />'; |
---|
340 | echo '<div style="text-align:center;"><select name="secteur_flash">'; |
---|
341 | $def_div = EVA_secteurs_Flash(); |
---|
342 | foreach ($def_div as $cle) { |
---|
343 | echo '<option value="'.$cle.'">'._T('evahabillage:'.$cle).'</option>'; |
---|
344 | } |
---|
345 | echo '</select></div><br /> <br />'; |
---|
346 | echo '<div style="text-align:center; text-decoration:underline;">'._T('evahabillage:flash_taille_horizontale').'</div>'; |
---|
347 | echo '<br /><div style="text-align:center;"><input type="text" name="flash_horizontal" /></div>'; |
---|
348 | echo '<br /> <br /><div style="text-align:center; text-decoration:underline;">'._T('evahabillage:flash_taille_verticale').'</div>'; |
---|
349 | echo '<br /><div style="text-align:center;"><input type="text" name="flash_vertical" /></div>'; |
---|
350 | |
---|
351 | echo '<div style="text-align:center;">'._T('evahabillage:flash_choisit_animation1').'<strong>'._DIR_IMG."eva_habillage/flash</strong>"._T('evahabillage:flash_choisit_animation2'); |
---|
352 | echo '<br /><select name="nom_flash">'; |
---|
353 | $dir_flash = opendir(_DIR_IMG."eva_habillage/flash"); |
---|
354 | while ($nom_fichier = readdir($dir_flash)) { |
---|
355 | if (($nom_fichier!='.') AND ($nom_fichier!='..') AND (strpos($nom_fichier,'.swf'))) { |
---|
356 | echo '<option value="'.$nom_fichier.'">'.$nom_fichier.'</option>'; |
---|
357 | } |
---|
358 | } |
---|
359 | closedir($dir_flash); |
---|
360 | echo '</select><br /> <br />'; |
---|
361 | echo '<hr />'; |
---|
362 | echo _T('evahabillage:flash_facultatif1').'<br />'; |
---|
363 | echo '<center><input type="text" name="flash_version" /></center><br />'; |
---|
364 | echo '<hr /> <br />'; |
---|
365 | echo '<input type="submit" value="'._T('evahabillage:EVA_valider').'"></div></form>'; |
---|
366 | echo fin_boite_info(true); |
---|
367 | echo fin_block(); |
---|
368 | |
---|
369 | echo bouton_block_depliable(_T('evahabillage:flash_charger'),false,''); |
---|
370 | echo debut_block_depliable(false); |
---|
371 | echo "<center>L'animation au format SWF sera téléchargée dans le répertoire <strong>"._DIR_IMG."eva_habillage/flash</strong><br />"; |
---|
372 | echo "<span style='text-decoration:underline;'><strong>Attention :</strong></span> si une animation portant le même nom est déjà présente dans ce répertoire, elle sera alors écrasée."; |
---|
373 | echo '<br /> <br /><form action="'.generer_url_ecrire("eva_habillage_graphisme").'" method="post" enctype="multipart/form-data">'; |
---|
374 | echo '<input type="file" name="flash_eva_habillage_envoi" /><br /> <br /><input type="submit" value="Envoyer" /></form></center>'; |
---|
375 | echo fin_block(); |
---|
376 | |
---|
377 | echo bouton_block_depliable(_T('evahabillage:flash_lister'),false,''); |
---|
378 | echo debut_block_depliable(false); |
---|
379 | |
---|
380 | $recup_exist_flash = sql_select('id , nom_div , nom_image , pos_x , pos_y , repetition','spip_eva_habillage_images',"type = 'flash' AND nom_habillage = 'Defaut'"); |
---|
381 | $test_exist_flash = sql_select('id','spip_eva_habillage_images',"type = 'flash' AND nom_habillage = 'Defaut' LIMIT 1"); |
---|
382 | $tab_test_exist_flash = sql_fetch($test_exist_flash); |
---|
383 | if ($tab_test_exist_flash!='') { |
---|
384 | echo '<br /><table align="center" class="spip">'; |
---|
385 | echo '<tr align="center" '; |
---|
386 | if (($couleur_table%2)==0) {echo 'class="row_even"';} else {echo 'class="row_odd"';} |
---|
387 | $couleur_table++; |
---|
388 | echo '>'; |
---|
389 | echo '<td align="center"><div style="text-decoration:underline;">Secteur</div></td><td align="center"><div style="text-decoration:underline;">Fichier</div></td><td align="center"><div style="text-decoration:underline;">Largeur</div></td><td align="center"><div style="text-decoration:underline;">Hauteur</div></td><td align="center"><div style="text-decoration:underline;">Version</div></td><td align="center"><div style="text-decoration:underline;">Supprimer ?</div></td></tr>'; |
---|
390 | while ($tab_exist_flash = sql_fetch($recup_exist_flash)) { |
---|
391 | echo '<tr align="center" '; |
---|
392 | if (($couleur_table%2)==0) {echo 'class="row_even"';} else {echo 'class="row_odd"';} |
---|
393 | $couleur_table++; |
---|
394 | echo '><form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'"><td align="center">'._T('evahabillage:'.$tab_exist_flash['nom_div']).' </td><td align="center"><strong>'.$tab_exist_flash['nom_image'].'</strong></td>'; |
---|
395 | echo '<td align="center">'.$tab_exist_flash['pos_x'].'</td>'; |
---|
396 | echo '<td align="center">'.$tab_exist_flash['pos_y'].'</td>'; |
---|
397 | echo '<td align="center">'.$tab_exist_flash['repetition'].'</td>'; |
---|
398 | echo '<td align="center"><input type="hidden" name="supprime_image" value="'.$tab_exist_flash['id'].'" />'; |
---|
399 | echo '<input type="submit" value="'._T('evahabillage:EVA_supprimer').'" /></td></form></tr>'; |
---|
400 | } |
---|
401 | echo '</table>'; |
---|
402 | } |
---|
403 | else { |
---|
404 | echo ' <br />'._T('evahabillage:EVA_aucune_image_fond'); |
---|
405 | } |
---|
406 | |
---|
407 | echo fin_block().'<br />'; |
---|
408 | echo fin_cadre_trait_couleur(true); |
---|
409 | |
---|
410 | |
---|
411 | //Choix du favicon |
---|
412 | if(!empty($_FILES['favicon_eva_habillage_envoi']['tmp_name']) AND is_uploaded_file($_FILES['favicon_eva_habillage_envoi']['tmp_name']) AND ((strpos($_FILES['favicon_eva_habillage_envoi']['name'],'.ico')) OR (strpos($_FILES['favicon_eva_habillage_envoi']['name'],'.png')) OR (strpos($_FILES['favicon_eva_habillage_envoi']['name'],'.gif')) OR (strpos($_FILES['favicon_eva_habillage_envoi']['name'],'.ICO')) OR (strpos($_FILES['favicon_eva_habillage_envoi']['name'],'.PNG')) OR (strpos($_FILES['favicon_eva_habillage_envoi']['name'],'.GIF')))){ |
---|
413 | if(!move_uploaded_file($_FILES['favicon_eva_habillage_envoi']['tmp_name'], _DIR_IMG.'eva_habillage/favicon/'.$_FILES['favicon_eva_habillage_envoi']['name'])) |
---|
414 | {echo 'Erreur lors de la copie du fichier';} |
---|
415 | } |
---|
416 | |
---|
417 | if (isset($_POST['nom_favicon'])) { |
---|
418 | $test_favicon=sql_select('id','spip_eva_habillage_images',"type = 'favicon'"); |
---|
419 | $result_favicon=sql_fetch($test_favicon); |
---|
420 | if (isset($result_favicon['id'])) { |
---|
421 | sql_updateq('spip_eva_habillage_images',array('nom_image' => $_POST['nom_favicon'],'nom_habillage' => 'Defaut'),'id = '.$result_favicon['id']); |
---|
422 | } |
---|
423 | else { |
---|
424 | sql_insertq('spip_eva_habillage_images',array('type' => 'favicon','nom_image' => $_POST['nom_favicon'],'nom_habillage' => 'Defaut')); |
---|
425 | } |
---|
426 | } |
---|
427 | |
---|
428 | if (isset($_POST['supprim_favicon'])) { |
---|
429 | sql_delete('spip_eva_habillage_images',"id=".$_POST['supprim_favicon']); |
---|
430 | } |
---|
431 | |
---|
432 | echo debut_cadre_trait_couleur(_DIR_PLUGIN_EVA_HABILLAGE."img_pack/eva.gif", true, '', _T('evahabillage:favicon_titre')); |
---|
433 | echo bouton_block_depliable(_T('evahabillage:favicon_choisir'),false,''); |
---|
434 | echo debut_block_depliable(false); |
---|
435 | $test_favicon=sql_select('id , nom_image','spip_eva_habillage_images',"type = 'favicon' AND nom_habillage = 'Defaut'"); |
---|
436 | $test_fav=sql_fetch($test_favicon); |
---|
437 | if (!isset($test_fav['id'])) { |
---|
438 | echo _T('evahabillage:favicon_a_choisir').'<img src="'._DIR_PLUGIN_EVASQUELETTES.'images/eva3_favicon.png"><br /> <br />'; |
---|
439 | echo _T('evahabillage:favicon_a_choisir2').'<br /> <br />'; |
---|
440 | } |
---|
441 | else { |
---|
442 | echo '<center>'._T('evahabillage:favicon_a_choisir3').'<img src="'._DIR_IMG.'eva_habillage/favicon/'.$test_fav['nom_image'].'"> nommé <strong>'._DIR_IMG.'eva_habillage/favicon/'.$test_fav['nom_image'].'</strong><br /> <br />'; |
---|
443 | echo _T('evahabillage:favicon_a_supprimer'); |
---|
444 | echo '<form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
445 | echo '<input type="hidden" name="supprim_favicon" value="'.$test_fav['id'].'">'; |
---|
446 | echo '<input type="submit" value="'._T('evahabillage:EVA_supprimer').'" /></form><br /></center>'; |
---|
447 | } |
---|
448 | |
---|
449 | echo debut_cadre_enfonce('', true, '', _T('evahabillage:favicon_choix1')); |
---|
450 | echo _T('evahabillage:favicon_choisir3').'<strong>'._DIR_IMG.'eva_habillage/favicon </strong> '._T('evahabillage:flash_choisit_animation2'); |
---|
451 | echo '<br /><form method="POST" action="'.generer_url_ecrire("eva_habillage_graphisme").'">'; |
---|
452 | echo '<br /><center><select name="nom_favicon">'; |
---|
453 | $dir_favicon = opendir(_DIR_IMG."eva_habillage/favicon"); |
---|
454 | while ($nom_fichier = readdir($dir_favicon)) { |
---|
455 | if (($nom_fichier!='.') AND ($nom_fichier!='..') AND ((strpos($nom_fichier,'.ico')) OR (strpos($nom_fichier,'.png')) OR (strpos($nom_fichier,'.gif')) OR (strpos($nom_fichier,'.ICO')) OR (strpos($nom_fichier,'.PNG')) OR (strpos($nom_fichier,'.GIF')))) { |
---|
456 | echo '<option value="'.$nom_fichier.'">'.$nom_fichier.'</option>'; |
---|
457 | } |
---|
458 | } |
---|
459 | closedir($dir_favicon); |
---|
460 | echo '</select>'; |
---|
461 | echo '<input type="submit" value="'._T('evahabillage:EVA_valider').'"></center></form>'; |
---|
462 | echo fin_cadre_enfonce(true); |
---|
463 | echo fin_block(); |
---|
464 | |
---|
465 | echo bouton_block_depliable(_T('evahabillage:favicon_charger'),false,''); |
---|
466 | echo debut_block_depliable(false); |
---|
467 | echo "<center>Le favicon (au format ICO, PNG ou GIF) sera téléchargée dans le répertoire <strong>"._DIR_IMG."eva_habillage/favicon</strong><br />"; |
---|
468 | echo "<span style='text-decoration:underline;'><strong>Attention :</strong></span> si un favicon portant le même nom est déjà présent dans ce répertoire, il sera alors écrasé."; |
---|
469 | echo '<br /> <br /><form action="'.generer_url_ecrire("eva_habillage_graphisme").'" method="post" enctype="multipart/form-data">'; |
---|
470 | echo '<input type="file" name="favicon_eva_habillage_envoi" /><br /> <br /><input type="submit" value="Envoyer" /></form></center>'; |
---|
471 | echo fin_block().'<br />'; |
---|
472 | |
---|
473 | echo fin_cadre_trait_couleur(true); |
---|
474 | |
---|
475 | echo fin_gauche(), fin_page(); |
---|
476 | } |
---|
477 | ?> |
---|