Update of /home/spip-cvs/spip/ecrire/Include/HTML4
In directory alan:/tmp/cvs-serv24547/ecrire/Include/HTML4
Modified Files:
calendrier_html4.php
Log Message:
Corrections sur l'affichage des calendriers.
Index: calendrier_html4.php
RCS file: /home/spip-cvs/spip/ecrire/Include/HTML4/calendrier_html4.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- calendrier_html4.php 16 Jul 2004 10:47:23 -0000 1.2
+++ calendrier_html4.php 17 Jul 2004 15:58:18 -0000 1.3
@@ -207,67 +207,78 @@
$script, $args_pred, $args_suiv, $type, $ancre)
{
global $spip_lang_right, $spip_lang_left, $flag_ecrire;
+
$img_dir = ($flag_ecrire ? '' : 'ecrire/') . 'img_pack';
if (!$echelle) $echelle = DEFAUT_D_ECHELLE;
$script = ereg_replace("echelle=[0-9]*&",'', $script);
$script .= (strpos($script,'?') ? '&' : '?');
$args = "jour=$jour&mois=$mois&annee=$annee$ancre" ;
- $img_att = "width='26' height='20' style='filter: alpha(opacity=50);'";
+
+
+ $retour = "<div class='navigation-calendrier'>";
+
+ $retour .= http_calendrier_href($script . "type=$type&echelle=$echelle&$args_pred$ancre",
+ "<img src='$img_dir/fleche-$spip_lang_left.png' class='format_png' alt='<<<' width='12' height='12' />",
+ 'précédent');
+ $retour .= " ";
+
+ $retour .= "<b>$nom</b>";
+ $retour .= " ";
+ $retour .= http_calendrier_href($script . "type=$type&echelle=$echelle&$args_suiv$ancre",
+ "<img src='$img_dir/fleche-$spip_lang_right.png' class='format_png' alt='>>>' width='12' height='12' />",
+ 'suivant');
- return "\n<tr>" .
- "\n<td colspan='2' style='width: 28%'>" . # 28 = 2 x (100/7)
- "\n<table class='forum-repondre-message' width='100%'><tr>" .
- // affichage de la fleche vers la sequence precedente
- "\n<td style='text-align: left; '>" .
- http_calendrier_href($script . "type=$type&echelle=$echelle&$args_pred$ancre",
- "<img src='$img_dir/fleche-$spip_lang_left.png' alt='<<<' width='12' height='12' />",
- 'précédent') .
- '</td>' .
-# loupe vers la meme chose en plus petit
- "\n<td style='text-align: center; '>" .
- (($type=='mois') ? ' ' :
- (http_calendrier_href($script . "type=$type&echelle=" .
- ($echelle+$echelle) . "&$args",
- "<img width='20' src='$img_dir/racine-24.gif' alt='zoom-' />"))) .
- '</td>' .
- // affichage de l'icone du calendrier d'un jour ou d'une semaine
- "\n<td style='text-align: right; '>" .
- (($type != 'jour') ?
- http_calendrier_href($script . "type=jour&echelle=$echelle&$args",
+ $retour .= " ";
+
+
+
+
+ ($type == 'jour') ? $img_att = " class='navigation-bouton-desactive'" : $img_att = "" ;
+ $retour .= http_calendrier_href($script . "type=jour&echelle=$echelle&$args",
"<img src='$img_dir/cal-jour.gif' alt='jour' $img_att />",
- 'calendrier par jour') :
- http_calendrier_href($script . "type=semaine&echelle=$echelle&$args",
- "<img src='$img_dir/cal-semaine.gif' alt='semaine' $img_att />",
- 'calendrier par semaine')) .
- "</td></tr>\n</table></td>" .
- // affichage du nom de la periode (44 = 100 - 4(100/7))
- "\n<td colspan='3' style='width: 44%; text-align:center; font-family: Arial, helvetica, sans-serif; font-size: 18px'><b>$nom</b></td>" .
- "\n<td colspan='2' style='width: 28%'>" .
- "\n<table class='forum-repondre-message' width='100%'><tr>" .
- // affichage de l'icone du calendrier d'une semaine ou d'un mois
- "\n<td style='text-align: left; '>" .
- (($type != 'mois') ?
- http_calendrier_href($script . "type=mois&echelle=$echelle&$args",
- "<img src='$img_dir/cal-mois.gif' alt='jour' $img_att />",
- 'calendrier par mois ou semestre') :
- http_calendrier_href($script . "type=semaine&echelle=$echelle&$args",
+ 'calendrier par jour');
+ ($type == 'semaine') ? $img_att = " class='navigation-bouton-desactive'" : $img_att = "" ;
+ $retour .= http_calendrier_href($script . "type=semaine&echelle=$echelle&$args",
"<img src='$img_dir/cal-semaine.gif' alt='semaine' $img_att />",
- 'calendrier par semaine')) .
- # loupe vers la meme chose en plus grand
- "</td>\n<td style='text-align: center; '>" .
- (($type=='mois') ? ' ' :
- (http_calendrier_href(($script . "type=$type&echelle=" .
- (($echelle > 2) ? floor($echelle / 2) : 1) .
- "&$args"),
- "<img src='$img_dir/racine-24.gif' alt='zoom-' />") .
- "</td>")) .
- // affichage de la fleche vers la periode suivante
- "\n<td style='text-align: right; '>" .
- http_calendrier_href($script . "type=$type&echelle=$echelle&$args_suiv$ancre",
- "<img src='$img_dir/fleche-$spip_lang_right.png' alt='>>>' width='12' height='12' />",
- 'suivant') .
- '</td></tr></table></td></tr>';
+ 'calendrier par semaine');
+ ($type == 'mois') ? $img_att = " class='navigation-bouton-desactive'" : $img_att = "" ;
+ $retour .= http_calendrier_href($script . "type=mois&echelle=$echelle&$args",
+ "<img src='$img_dir/cal-mois.gif' alt='mois' $img_att />",
+ 'calendrier par mois');
+
+ $retour .= " ";
+
+
+ $today=getdate(time());
+ $jour_today = $today["mday"];
+ $mois_today = $today["mon"];
+ $annee_today = $today["year"];
+
+ $arguments = "jour=$jour_today&mois=$mois_today&annee=$annee_today$ancre" ;
+ if ($type == 'mois') $condition = ($annee == $annee_today && $mois == $mois_today);
+ else $condition = ($annee == $annee_today && $mois == $mois_today && $jour == $jour_today);
+
+ $condition ? $img_att = " class='navigation-bouton-desactive'" : $img_att = "" ;
+ $retour .= http_calendrier_href($script . "type=$type&echelle=$echelle&$arguments",
+ "<img src='$img_dir/cal-today.gif' alt='aujourd\'hui' $img_att />",
+ 'aujourd\'hui');
+
+ if ($type != "mois") {
+ $retour .= " ";
+ $retour .= http_calendrier_href($script . "type=$type&echelle=" .
+ ($echelle+$echelle) . "&$args",
+ "<img src='$img_dir/loupe.gif' alt='zoom-' />");
+ $retour .= http_calendrier_href(($script . "type=$type&echelle=" .
+ (($echelle > 2) ? floor($echelle / 2) : 1) .
+ "&$args"),
+ "<img src='$img_dir/loupe.gif' alt='zoom-' />");
+ }
+
+
+ $retour .= "</div>";
+ return $retour;
+
}
# affichage du bandeau d'un calendrier d'une journee
@@ -278,16 +289,16 @@
$jour_today = $today["mday"];
$mois_today = $today["mon"];
$annee_today = $today["year"];
- return "<table width='100%'>" .
- http_calendrier_navigation($jour, $mois, $annee, $echelle,
+// return "<table width='100%'>" .
+ return http_calendrier_navigation($jour, $mois, $annee, $echelle,
(nom_jour("$annee-$mois-$jour") . " " .
affdate_jourcourt("$annee-$mois-$jour")),
$script,
"jour=".($jour-1)."&mois=$mois&annee=$annee",
"jour=".($jour+1)."&mois=$mois&annee=$annee",
'jour',
- $nav) .
- "</table>";
+ $nav);
+// "</table>";
}
# affichage du bandeau d'un calendrier d'une semaine
@@ -374,7 +385,7 @@
$r = '';
$bo = "style='width: " .
round(100/$nb) .
- "%; padding: 3px; border-bottom: 1px solid black; border-right: 1px solid black; border-left: 1px solid $claire; border-top: 1px solid $claire; text-align: center; background-color: $foncee; font-family: Verdana, Arial, Sans, sans-serif; font-size: 11px;'";
+ "%; padding: 3px; color: black; text-align: center; background-color: $claire; font-family: Verdana, Arial, Sans, sans-serif; font-size: 10px;'";
foreach($intitul as $j) $r .= "\n\t<td $bo><b>$j</b></td>";
return "\n<tr>$r\n</tr>";
}
@@ -386,11 +397,14 @@
function http_calendrier_suitede7($mois_today,$annee_today, $premier_jour, $dernier_jour,$evenements,$fclic)
{
- $class_dispose = '
+/* $class_dispose = '
border-bottom: 1px solid white;
border-right: 1px solid white;
border-left: 1px solid #aaaaaa;
border-top: 1px solid #aaaaaa; ';
+*/
+
+ $class_dispose = 'border-bottom: 1px solid #aaaaaa;';
// affichage du debut de semaine hors periode
$jour_semaine = date("w",mktime(1,1,1,$mois_today,$premier_jour,$annee_today));
@@ -420,7 +434,7 @@
}
$jour_mois =
- ("<span style='font-family: arial,helvetica,sans-serif; font-size: 12px; color: $couleur_lien'>" .
+ ("<span style='font-family: arial,helvetica,sans-serif; font-size: 16px; color: black'>" .
(($dernier_jour <= 31) ? $jour : "$jour/$mois_en_cours") .
"</span>");
@@ -528,7 +542,7 @@
(($v['jour'] ==1) ? 'er' : '') .
($nav ? ('/' . (0+$v['mois'])) : '')),
'',
- 'color:white;');
+ 'color:black;');
}
list($dimheure, $dimjour, $fontsize, $padding) =
@@ -725,12 +739,14 @@
for ($i = $debut; $i <= $fin; $i++) {
for ($j=0; $j < $slice; $j++)
{
+ if ($j == 0) $gras = " font-weight: bold;";
+ else $gras = "";
$total .= "\n<div style='position: absolute; width: 100%; top: ".
((($i-$debut+1)*$dimheure) + floor(($j*$dimheure)/$slice)) .
- "px; border-top: 1px solid #aaaaaa;'>
- <div style='margin-$spip_lang_left: 2px'><b>$i:" .
+ "px; border-top: 1px solid #aaaaaa;$gras'>
+ <div style='margin-$spip_lang_left: 2px'>$i:" .
sprintf("%02d",floor(($j*60)/$slice)) .
- "</b></div>\n</div>";
+ "</div>\n</div>";
}
}
return "\n<div style='position: absolute; $spip_lang_left: 2px; top: 2px;'><b>0:00</b></div>" .
@@ -890,6 +906,7 @@
(($spip_ecran != "large") ? '' :
("\n<td width='20'> </td>" .
"\n<td width='$largeur_gauche' class='verdana1' valign='top'>" .
+ "<div style='height: 29px;'> </div>".
http_calendrier_jour($jour+1,$mois,$annee, "col") .
'</td>')) .
'</tr></table>';
@@ -1030,7 +1047,7 @@
$calendrier_message_fermeture = $le_message;
return
$entete .
- "\n<div style='position: relative; color: #666666; width: 100%; " .
+ "\n<div style='position: relative; color: #666666; " .
"height: ${dimjour}px; " .
"font-family: Arial, Sans, sans-serif; font-size: ${fontsize}px;".
' border-left: 1px solid #aaaaaa; border-right: 1px solid #aaaaaa; border-bottom: 1px solid #aaaaaa; border-top: 1px solid #aaaaaa;' .
@@ -1160,8 +1177,8 @@
return '<a href="' .
str_replace('&', '&', $href) .
'"' . # class="forum-repondre-message"' .
- (!$style ? '' : (" style='" . $style . "'")) .
- (!$title ? '' : (" title='" . $title . "'")) .
+ (!$style ? '' : (" style=\"" . $style . "\"")) .
+ (!$title ? '' : (" title=\"" . $title . "\"")) .
'>' .
$clic .
'</a>';