small patch to add a background changer for ALCASAR webpages

Este commit está contenido en:
n 2015-04-07 22:28:44 +02:00
padre 26e0e93286
commit 1bf173b97a
Se han modificado 1 ficheros con 73 adiciones y 0 borrados

73
alcasar_logo.patch Archivo normal
Ver fichero

@ -0,0 +1,73 @@
--- logo.old.php 2015-04-01 21:43:37.293984603 +0200
+++ logo.php 2015-04-01 22:10:51.474184548 +0200
@@ -19,16 +19,20 @@
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
- $l_title = "Personnalisation du logo d'organisme";
+ $l_title = "Personnalisation du logo d'organisme et du fond d'écran";
$l_current_logo = "Logo actuel";
+ $l_current_background = "Fond d'&eacutecran actuel";
$l_logo_select ="Sélectionnez un nouveau logo";
+ $l_background_select ="Sélectionnez un nouveau fond d'écran";
$l_logo_help1 = "votre logo doit être un fichier au format libre 'PNG'";
$l_logo_help2 = "la taille de ce fichier doit être inférieure à 100Ko";
$l_logo_help3 = "rafraîchissez les pages de votre navigateur pour voir le résultat";
} else {
- $l_title = "Customizing the agency logo";
+ $l_title = "Customizing the agency logo and background image";
$l_current_logo = "Current logo";
+ $l_current_background = "Current background image";
$l_logo_select ="Select a new logo";
+ $l_background_select ="Select a new background image";
$l_logo_help1 = "your logo must be in open 'PNG' format";
$l_logo_help2 = "the file size must be less than 100KB";
$l_logo_help3 = "refresh your browser in order to see the result";
@@ -53,6 +57,26 @@
move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
}
}
+
+if(isset($_FILES['background']))
+{
+unset($result);
+$taille_max = 1000000;
+$destination = '/var/www/html/images/fond.png';
+$extension = strstr($_FILES['background']['name'], '.');
+if ($extension != '.png')
+ {
+ $result = 'Veuillez sélectionner un fichier de type png !';
+ }
+elseif (file_exists($_FILES['background']['tmp_name']) and filesize($_FILES['background']['tmp_name']) > $taille_max)
+ {
+ $result = 'La taille du fichier doit être inférieur à 1Mo !';
+ }
+if (!isset($result))
+ {
+ move_uploaded_file($_FILES['background']['tmp_name'], $destination);
+ }
+}
?>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><? echo "$l_title";?></th></tr>
@@ -63,13 +87,19 @@
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
- <CENTER><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
+ <CENTER><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90">&nbsp;&nbsp;<? echo "$l_current_background";?> : <img src="/images/fond.png" width="90" height="90"></center><BR>
<? echo "$l_logo_select";?> :
<FORM action="logo.php" method=POST ENCTYPE="multipart/form-data">
<input type="file" name="logo">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
<input type="submit" value="Envoyer">
</FORM>
+<? echo "$l_background_select";?> :
+ <FORM action="logo.php" method=POST ENCTYPE="multipart/form-data">
+ <input type="file" name="background">
+ <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
+ <input type="submit" value="Envoyer">
+ </FORM>
<?php
if (isset($result))
{