@ -34,28 +34,6 @@ define('DEFAUT_PARTIE', DEFAUT_PARTIE_R);
// Utilitaires sans html ni sql
//
// utilitaire de separation script / ancre
// et de retrait des arguments a remplacer
// (a mon avis cette fonction ne sert a rien, puisque parametre_url()
// sait remplacer les arguments au bon endroit -- Fil)
// Pas si simple: certains param ne sont pas remplaces
// et doivent reprendre leur valeur par defaut -- esj.
// http://doc.spip.org/@calendrier_retire_args_ancre
function calendrier_retire_args_ancre($script)
{
$script = parametre_url($script, 'bonjour', '', '&');
if (preg_match(',^(.*)#([^=& ]*)$,',$script, $m)) {
$script = $m[1];
$ancre = $m[2];
} else { $ancre = ''; }
if ($script[strlen($script)-1] == '?') $script = substr($script,0,-1);
foreach(array('echelle','jour','mois','annee', 'type', 'partie_cal') as $arg) {
$script = preg_replace("/([?& ])$arg=[^& ]*& /",'\1', $script);
$script = preg_replace("/([?& ])$arg=[^& ]*$/",'\1', $script);
}
if (in_array(substr($script,-1),array('& ','?'))) $script = substr($script,0,-1);
return array(quote_amp($script), $ancre);
}
// tous les liens de navigations sont issus de cette fonction
// on peut definir generer_url_date et un htacces pour simplifier les URL
@ -155,433 +133,9 @@ function calendrier_height ($heure, $heurefin, $debut, $fin, $dimheure, $dimjour
// init: calcul generique des evenements a partir des tables SQL
//
// http://doc.spip.org/@http_calendrier_init
function http_calendrier_init($time='', $type='mois', $echelle='', $partie_cal='', $script='', $evt=null)
{
if (is_array($time)) {
list($j,$m,$a) = $time;
if ($j+$m+$a) $time = @mktime(0,0,0, $m, $j, $a);
}
if (!is_numeric($time)) $time = time();
$jour = date("d",$time);
$mois = date("m",$time);
$annee = date("Y",$time);
if (!$echelle = intval($echelle)) $echelle = DEFAUT_D_ECHELLE;
if (!is_string($type) OR !preg_match('/^\w+$/', $type)) $type ='mois';
if (!is_string($partie_cal) OR !preg_match('/^\w+$/', $partie_cal))
$partie_cal = DEFAUT_PARTIE;
list($script, $ancre) =
calendrier_retire_args_ancre($script);
if (is_null($evt)) {
$g = 'quete_calendrier_' . $type;
$evt = quete_calendrier_interval($g($annee,$mois, $jour));
quete_calendrier_interval_articles("'$annee-$mois-00'", "'$annee-$mois-1'", $evt[0]);
// si on veut les forums, decommenter
# quete_calendrier_interval_forums($g($annee,$mois,$jour), $evt[0]);
}
$f = 'http_calendrier_' . $type;
if (!function_exists($f)) $f = 'http_calendrier_mois';
return $f($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt);
}
# affichage d'un calendrier de plusieurs semaines
# si la periode est inferieure a 31 jours, on considere que c'est un mois
// http://doc.spip.org/@http_calendrier_mois
function http_calendrier_mois($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt)
{
global $spip_ecran;
if (!isset($spip_ecran)) $spip_ecran = 'large';
$premier_jour = '01';
$dernier_jour = '31';
if (is_array($evt)) {
list($sansduree, $evenements, $premier_jour, $dernier_jour) = $evt;
if (!$premier_jour) $premier_jour = '01';
if (!$dernier_jour)
{
$dernier_jour = 31;
while (!(checkdate($mois,$dernier_jour,$annee))) $dernier_jour--;
}
if ($sansduree)
foreach($sansduree as $d => $r)
$evenements[$d] = !$evenements[$d] ? $r : array_merge($evenements[$d], $r);
$evt =
http_calendrier_mois_noms($annee, $mois, $jour, $script, $ancre) .
http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$evenements, $script, "& echelle=$echelle& partie_cal=$partie_cal",$ancre) ;
} else $evt = "< tr > < td > $evt< / td > < / tr > ";
return
"< table class = 'calendrier-table-$spip_ecran' > " .
http_calendrier_mois_navigation($annee, $mois, $premier_jour, $dernier_jour, $echelle, $partie_cal, $script, $ancre) .
$evt .
'< / table > ' .
http_calendrier_sans_date($annee, $mois, $evenements) .
(!test_espace_prive() ? "" : http_calendrier_aide_mess());
}
// si la periore a plus de 31 jours, c'est du genre trimestre, semestre etc
// pas de navigation suivant/precedent alors
// http://doc.spip.org/@http_calendrier_mois_navigation
function http_calendrier_mois_navigation($annee, $mois, $premier_jour, $dernier_jour, $echelle, $partie_cal, $script, $ancre){
if ($dernier_jour > 31) {
$prec = $suiv = '';
$periode = affdate_mois_annee(date("Y-m-d", mktime(1,1,1,$mois,$premier_jour,$annee))) . ' - '. affdate_mois_annee(date("Y-m-d", mktime(1,1,1,$mois,$dernier_jour,$annee)));
} else {
$mois_suiv=$mois+1;
$annee_suiv=$annee;
$mois_prec=$mois-1;
$annee_prec=$annee;
if ($mois==1){
$mois_prec=12;
$annee_prec=$annee-1;
}
else if ($mois==12){$mois_suiv=1; $annee_suiv=$annee+1;}
$prec = array($annee_prec, $mois_prec, 1, "mois");
$suiv = array($annee_suiv, $mois_suiv, 1, "mois");
$periode = affdate_mois_annee("$annee-$mois-1");
}
return
"\n< tr > < td colspan = '7' > " .
http_calendrier_navigation($annee,
$mois,
1,
$echelle,
$partie_cal,
$periode,
$script,
$prec,
$suiv,
'mois',
$ancre) .
"< / td > < / tr > ";
}
// http://doc.spip.org/@http_calendrier_mois_noms
function http_calendrier_mois_noms($annee, $mois, $jour, $script, $ancre){
$bandeau ="";
for ($j=1; $j< 8 ; $ j + + ) {
$bandeau .=
"\n\t< th class = 'calendrier-th' > " .
_T('date_jour_' . (($j%7)+1)) .
"< / th > ";
}
return "\n< tr class = 'bandeau_agenda' > $bandeau\n< / tr > ";
}
# dispose les lignes d'un calendrier de 7 colonnes (les jours)
# chaque case est garnie avec les evenements du jour figurant dans $evenements
// http://doc.spip.org/@http_calendrier_mois_sept
function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$evenements, $script, $finurl, $ancre='')
{
global $spip_lang_left, $spip_lang_right;
// affichage du debut de semaine hors periode
$init = '';
$debut = date("w",mktime(1,1,1,$mois,$premier_jour,$annee));
for ($i=$debut ? $debut : 7;$i>1;$i--)
{$init .= "\n\t< td class = 'bordure_claire_basse' > < / td > ";}
$total = '';
$ligne = '';
$today=date("Ymd");
for ($j=$premier_jour; $j< =$dernier_jour; $j++){
$nom = mktime(1,1,1,$mois,$j,$annee);
$jour = date("d",$nom);
$jour_semaine = date("w",$nom);
$mois_en_cours = date("m",$nom);
$annee_en_cours = date("Y",$nom);
$amj = date("Y",$nom) . $mois_en_cours . $jour;
$couleur_texte = "black";
$fond = "";
if ($jour_semaine == 0) $fond = ' jour_dimanche';
else if ($jour_semaine==1)
{
if ($ligne||$init)
$total .= "\n< tr > $init$ligne\n< / tr > ";
$ligne = $init = '';
}
if ($amj == $today) {
$couleur_texte = "red";
$fond = " jour_encours";
}
$res = '';
if ($evts = $evenements[$amj]) {
foreach ($evts as $evenement)
{
$res .= isset($evenement['DTSTART']) ?
http_calendrier_avec_heure($evenement, $amj) :
http_calendrier_sans_heure($evenement);
}
}
$ligne .= "\n\t\t< td style = 'height: 100px;' class = 'calendrier-td $ fond bordure_claire_basse bordure_claire_ $ spip_lang_right " .
($ligne ? "" : " bordure_claire_$spip_lang_left") .
"'>" .
(test_espace_prive() ?
(calendrier_href($script,$annee_en_cours, $mois_en_cours, $jour, "jour", $finurl, $ancre, '', $jour, 'calendrier-helvetica16', '', $jour, "color: $couleur_texte") .
http_calendrier_ics_message($annee_en_cours, $mois_en_cours, $jour, false)):
http_calendrier_mois_clics($annee_en_cours, $mois_en_cours, $jour, $script, $finurl, $ancre)) .
$res .
"\n\t< / td > ";
}
return $total . ($ligne ? "\n< tr > $ligne\n< / tr > " : '');
}
// typo pour l'espace public
// http://doc.spip.org/@http_calendrier_mois_clics
function http_calendrier_mois_clics($annee, $mois, $jour, $script, $finurl, $ancre)
{
$d = mktime(0,0,0,$mois, $jour, $annee);
$semaine = date("W", $d);
return
"< table width = '100%' > \n< tr > < td style = 'text-align: left' > ".
calendrier_href($script,$annee, $mois, $jour, "jour", $finurl, $ancre, '',
(_T('date_jour_'. (1+date('w',$d))) .
" $jour " .
_T('date_mois_'.(0+$mois))),
'calendrier-helvetica16','',
"$jour/$mois") .
"< / td > < td style = 'text-align: right' > " .
calendrier_href($script,$annee, $mois, $jour, "semaine", $finurl, $ancre,'',
(_T('date_semaines') . ": $semaine"),
'calendrier-helvetica16','', $semaine) .
"< / td > < / tr > \n< / table > ";
}
# dispose les evenements d'une semaine
// http://doc.spip.org/@http_calendrier_semaine
function http_calendrier_semaine($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt)
{
global $spip_ecran;
if (!isset($spip_ecran)) $spip_ecran = 'large';
$init = date("w",mktime(1,1,1,$mois,$jour,$annee));
$init = $jour+1-($init ? $init : 7);
$sd = '';
if (is_array($evt))
{
if($partie_cal!= DEFAUT_PARTIE_R){
$sd = http_calendrier_sans_date($annee, $mois,$evt[0]);
$finurl = "& echelle=$echelle& partie_cal=$partie_cal";
$evt =
http_calendrier_semaine_noms($annee, $mois, $init, $script, $finurl, $ancre) .
http_calendrier_semaine_sept($annee, $mois, $init, $echelle, $partie_cal, $evt);
}
else {
list($sansduree, $evenements, $premier_jour, $dernier_jour) = $evt;
if ($sansduree)
foreach($sansduree as $d => $r)
$evenements[$d] = !$evenements[$d] ? $r : array_merge($evenements[$d], $r);
$finurl = "& echelle=$echelle& partie_cal=$partie_cal";
$evt =
http_calendrier_semaine_noms($annee, $mois, $init, $script, $finurl, $ancre) .
http_calendrier_mois_sept($annee, $mois, $init, $init+ 6, $evenements, $script, $finurl, $ancre);
}
} else $evt = "< tr > < td > $evt< / td > < / tr > ";
return
"\n< table class = 'calendrier-table-$spip_ecran' > " .
http_calendrier_semaine_navigation($annee, $mois, $init, $echelle, $partie_cal, $script, $ancre) .
$evt .
"< / table > " .
$sd .
(!test_espace_prive() ? "" : http_calendrier_aide_mess());
}
// http://doc.spip.org/@http_calendrier_semaine_navigation
function http_calendrier_semaine_navigation($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre){
$fin = mktime (1,1,1,$mois, $jour+6, $annee);
$fjour = date("d",$fin);
$fmois = date("m",$fin);
$fannee = date("Y",$fin);
$fin = date("Y-m-d", $fin);
$debut = mktime (1,1,1,$mois, $jour, $annee);
$djour = date("d",$debut)+0;
$dmois = date("m",$debut);
$dannee = date("Y",$debut);
$debut = date("Y-m-d", $debut);
$periode = (($dannee != $fannee) ?
(affdate($debut)." - ".affdate($fin)) :
(($dmois == $fmois) ?
($djour ." - ".affdate_jourcourt($fin)) :
(affdate_jourcourt($debut)." - ".affdate_jourcourt($fin))));
return
"\n< tr > < td colspan = '7' > " .
http_calendrier_navigation($annee,
$mois,
$jour,
$echelle,
$partie_cal,
$periode,
$script,
array($dannee, $dmois, ($djour-7), "semaine"),
array($fannee, $fmois, ($fjour+1), "semaine"),
'semaine',
$ancre) .
"< / td > < / tr > \n";
}
// http://doc.spip.org/@http_calendrier_semaine_noms
function http_calendrier_semaine_noms($annee, $mois, $jour, $script, $finurl, $ancre){
$bandeau = '';
for ($j=$jour; $j< $jour+7;$j++){
$nom = mktime(0,0,0,$mois,$j,$annee);
$num = intval(date("d", $nom)) ;
$numois = date("m",$nom);
$nomjour = _T('date_jour_'. (1+date('w',$nom)));
$clic = ($nomjour . " " . $num . (($num == 1) ? 'er' : '') .
($ancre ? ('/' . $numois) : ''));
$bandeau .=
"\n\t< th class = 'calendrier-th' > " .
calendrier_href($script, date("Y",$nom), $numois, $num, 'jour', $finurl, $ancre, '', $clic, '', '', $clic) .
"< / th > ";
}
return "\n< tr class = 'bandeau_agenda' > $bandeau\n< / tr > ";
}
// http://doc.spip.org/@http_calendrier_semaine_sept
function http_calendrier_semaine_sept($annee, $mois, $jour, $echelle, $partie_cal, $evt)
{
global $spip_ecran, $spip_lang_left;
$largeur = ($spip_ecran == "large") ? 90 : 60;
$today=date("Ymd");
$total = '';
$style = " border-top: 0px; border-right: 0px;";
$class = " bordure_claire_$spip_lang_left bordure_claire_basse";
for ($j=$jour; $j< $jour+7;$j++){
$v = mktime(0,0,0,$mois, $j, $annee);
$total .= "\n< td class = 'calendrier-td' > " .
http_calendrier_ics($annee,$mois,$j, $echelle, $partie_cal, $largeur, $evt, $style, $class . ( (date("w",$v)==0 & & test_espace_prive()) ?
" jour_dimanche" :
((date("Ymd", $v) == $today) ?
" jour_encours" :
" jour_gris") ) ) .
"\n< / td > ";
}
return "\n< tr class = 'calendrier-verdana10' > $total< / tr > ";
}
// http://doc.spip.org/@http_calendrier_jour
function http_calendrier_jour($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt){
global $spip_ecran;
if (!isset($spip_ecran)) $spip_ecran = 'large';
return
"\n< table class = 'calendrier-table-$spip_ecran' > " .
"\n< tr > < td class = 'calendrier-td-gauche' > < / td > " .
"< td colspan = '5' class = 'calendrier-td-centre' > " .
http_calendrier_navigation($annee, $mois, $jour, $echelle, $partie_cal,
(nom_jour("$annee-$mois-$jour") . " " .
affdate_jourcourt("$annee-$mois-$jour")),
$script,
array($annee, $mois, ($jour-1), "jour"),
array($annee, $mois, ($jour+1), "jour"),
'jour',
$ancre) .
"< / td > " .
"< td class = 'calendrier-td-droit calendrier-arial10' > < / td > " .
"< / tr > " .
(!is_array($evt) ? ("< tr > < td > $evt< / td > < / tr > ") :
(http_calendrier_jour_noms($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre) .
http_calendrier_jour_sept($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt))) .
"< / table > ";
}
// http://doc.spip.org/@http_calendrier_jour_noms
function http_calendrier_jour_noms($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre){
global $spip_ecran;
$finurl = "& echelle=$echelle& partie_cal=$partie_cal";
$gauche = (!test_espace_prive() || ($spip_ecran != "large"));
return
"\n< tr > < td class = 'calendrier-td-gauche' > " .
($gauche ? '' :
http_calendrier_ics_titre($annee,$mois,$jour-1,$script, $finurl, $ancre)) .
"< / td > < td colspan = '5' class = 'calendrier-td-centre' > " .
(!test_espace_prive() ? '' :
("\n\t< div class = 'calendrier-titre' > " .
http_calendrier_ics_message($annee, $mois, $jour, true) .
'< / div > ')) .
"< / td > < td class = 'calendrier-td-droit calendrier-arial10' > " .
(!test_espace_prive() ? '' : http_calendrier_ics_titre($annee,$mois,$jour+1,$script, $finurl, $ancre)) .
"< / td > < / tr > ";
}
// http://doc.spip.org/@http_calendrier_jour_sept
function http_calendrier_jour_sept($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt){
global $spip_ecran;
$gauche = (!test_espace_prive() || ($spip_ecran != "large"));
if ($partie_cal!= DEFAUT_PARTIE_R)
return
"< tr class = 'calendrier-verdana10' > " .
# afficher en reduction le tableau du jour precedent
"\n< td class = 'calendrier-td-gauche' > " .
($gauche ? '' :
http_calendrier_ics($annee, $mois, $jour-1, $echelle, $partie_cal, 0, $evt)) .
"< / td > < td colspan = '5' class = 'calendrier-td-centre' > " .
http_calendrier_ics($annee, $mois, $jour, $echelle, $partie_cal, 300, $evt) .
'< / td > ' .
# afficher en reduction le tableau du jour suivant
"\n< td class = 'calendrier-td-droit' > " .
(!test_espace_prive() ? '' :
http_calendrier_ics($annee, $mois, $jour+1, $echelle, $partie_cal, 0, $evt)) .
'< / td > ' .
"\n< / tr > ";
else {
list($sansduree, $evenements, $premier_jour, $dernier_jour) = $evt;
if ($sansduree)
foreach($sansduree as $d => $r)
$evenements[$d] = !$evenements[$d] ? $r : array_merge($evenements[$d], $r);
return
"< tr class = 'calendrier-verdana10' > " .
# afficher en reduction le tableau du jour precedent
"\n< td class = 'calendrier-td-gauche' > " .
($gauche ? '' :
"< table width = '100%' > ".
http_calendrier_mois_sept($annee, $mois, $jour-1, $jour-1,$evenements, $script, '', $ancre)
."< / table > "
) .
"< / td > < td colspan = '5' class = 'calendrier-td-centre' > " .
"< table width = '100%' > ".
http_calendrier_mois_sept($annee, $mois, $jour, $jour,$evenements, $script, '', $ancre) .
"< / table > " .
'< / td > ' .
# afficher en reduction le tableau du jour suivant
"\n< td class = 'calendrier-td-droit' > " .
(!test_espace_prive() ? '' :
"< table width = '100%' > ".
http_calendrier_mois_sept($annee, $mois, $jour+1, $jour+1,$evenements, $script, '', $ancre)
."< / table > "
) .
'< / td > ' .
"\n< / tr > ";
}
}
// Conversion d'un tableau de champ ics en des balises div positionnees
// Le champ categories indique la Classe de CSS a prendre
// $echelle est le nombre de secondes representees par 1 pixel
@ -816,19 +370,6 @@ function http_calendrier_ics_titre($annee, $mois, $jour,$script, $finurl='', $an
}
// http://doc.spip.org/@http_calendrier_sans_date
function http_calendrier_sans_date($annee, $mois, $evenements)
{
$r = $evenements[0+($annee . $mois . "00")];
if (!$r) return "";
$res = "\n< div class = 'calendrier-arial10 calendrier-titre' > ".
_T('info_mois_courant').
"< / div > ";
foreach ($r as $evenement) $res .= http_calendrier_sans_heure($evenement);
return $res;
}
// http://doc.spip.org/@http_calendrier_sans_heure
function http_calendrier_sans_heure($ev)
{
@ -893,154 +434,6 @@ function http_calendrier_avec_heure($evenement, $amj)
return "\n< div class = 'calendrier-arial10 calendrier-evenement " . $evenement[' CATEGORIES ' ] . " $ opacity ' > $sum\n< / div > \n";
}
# Bandeau superieur d'un calendrier selon son $type (jour/mois/annee):
# 2 icones vers les 2 autres types, a la meme date $jour $mois $annee
# 2 icones de loupes pour zoom sur la meme date et le meme type
# 2 fleches appelant le $script sur les periodes $pred/$suiv avec une $ancre
# et le $nom du calendrier
// http://doc.spip.org/@http_calendrier_navigation
function http_calendrier_navigation($annee, $mois, $jour, $echelle, $partie_cal, $nom, $script, $args_pred, $args_suiv, $type, $ancre)
{
global $spip_lang_right, $spip_lang_left;
if (!$echelle) $echelle = DEFAUT_D_ECHELLE;
if ($args_pred) {
list($a, $m, $j, $t) = $args_pred;
$args_pred = calendrier_href($script, $a, $m, $j, $t, "& echelle=$echelle& partie_cal=$partie_cal", $ancre,
"fleche-$spip_lang_left.png",
_T('precedent'),
'calendrier-png',
'< < < ');
}
if ($args_suiv) {
list($a, $m, $j, $t) = $args_suiv;
$args_suiv = calendrier_href($script, $a, $m, $j, $t, "& echelle=$echelle& partie_cal=$partie_cal", $ancre,
"fleche-$spip_lang_right.png",
_T('suivant'),
'calendrier-png',
'> > > ');
}
$today=getdate(time());
$jour_today = $today["mday"];
$mois_today = $today["mon"];
$annee_today = $today["year"];
$id = 'nav-agenda' .preg_replace('/[^\w\d]/', '', $ancre);
// anterieure a celle de navigation-calendrier
return
"\n< div class = 'navigation-calendrier calendrier-moztop8' > "
. "< div style = 'float: $spip_lang_right; padding-left: 5px; padding-right: 5px;' > "
. (($type == "mois") ? '' :
(calendrier_href($script, $annee, $mois, $jour, $type, "& echelle=$echelle& partie_cal=" . DEFAUT_PARTIE_R, $ancre,
"sans-heure.gif",
_T('sans_heure'),
"calendrier-png" .
(($partie_cal == DEFAUT_PARTIE_R) ? " calendrier-opacity'" : ""))
. calendrier_href($script, $annee, $mois, $jour, $type, "& echelle=$echelle& partie_cal=" . DEFAUT_PARTIE_T, $ancre,
"heures-tout.png",
_T('cal_jour_entier'),
"calendrier-png" .
(($partie_cal == DEFAUT_PARTIE_T) ? " calendrier-opacity'" : ""))
. calendrier_href($script, $annee, $mois, $jour, $type, "& echelle=$echelle& partie_cal=" . DEFAUT_PARTIE_M, $ancre,
"heures-am.png",
_T('cal_matin'),
"calendrier-png" .
(($partie_cal == DEFAUT_PARTIE_M) ? " calendrier-opacity'" : ""))
. calendrier_href($script, $annee, $mois, $jour, $type, "& echelle=$echelle& partie_cal=" . DEFAUT_PARTIE_S, $ancre,
"heures-pm.png",
_T('cal_apresmidi'),
"calendrier-png" .
(($partie_cal == DEFAUT_PARTIE_S) ? " calendrier-opacity'" : ""))
. " "
. calendrier_href($script, $annee, $mois, $jour, $type, "& partie_cal=$partie_cal& echelle=" . floor($echelle * 1.5),
$ancre,
"loupe-moins.gif",
_T('info_zoom'). '-')
. calendrier_href($script, $annee, $mois, $jour, $type, "& partie_cal=$partie_cal& echelle=" . floor($echelle / 1.5),
$ancre,
"loupe-plus.gif",
_T('info_zoom'). '+')
))
. calendrier_href($script,$annee, $mois, $jour, "jour", "& echelle=$echelle& partie_cal=$partie_cal", $ancre,"cal-jour.gif",
_T('cal_par_jour'),
(($type == 'jour') ? " calendrier-opacity" : ''))
. calendrier_href($script,$annee, $mois, $jour, "semaine", "& echelle=$echelle& partie_cal=$partie_cal", $ancre, "cal-semaine.gif",
_T('cal_par_semaine'),
(($type == 'semaine') ? " calendrier-opacity" : "" ))
. calendrier_href($script,$annee, $mois, $jour, "mois", "& echelle=$echelle& partie_cal=$partie_cal", $ancre,"cal-mois.gif",
_T('cal_par_mois'),
(($type == 'mois') ? "calendrier-opacity" : "" ))
. "< / div > "
. " "
. calendrier_href($script,$annee_today, $mois_today, $jour_today, $type, "& echelle=$echelle& partie_cal=$partie_cal", $ancre,
"cal-today.gif",
_T("ecrire:info_aujourdhui"),
(($annee == $annee_today & & $mois == $mois_today & & (($type == 'mois') || ($jour == $jour_today)))
? "calendrier-opacity" : ""),
'','','',
(" onmouseover=\"$('#$id').css('visibility','visible').show();\"" ))
. " "
. $args_pred
. $args_suiv
. " "
. $nom
. (!test_espace_prive() ? '' : aide("messcalen"))
. "< / div > "
. http_calendrier_invisible($annee, $mois, $jour, $script, "& echelle=$echelle& partie_cal=$partie_cal", $ancre, $id);
}
// fabrique un petit agenda accessible par survol
// http://doc.spip.org/@http_calendrier_invisible
function http_calendrier_invisible($annee, $mois, $jour, $script, $finurl, $ancre, $id)
{
global $spip_lang_right, $spip_lang_left;
$gadget = "< div style = 'position: relative;z-index: 1000;'
onmouseover=\"$('#$id').show();\" onmouseout=\"$('#$id').hide();\">"
. "< table id = '$id' class = 'calendrier-cadreagenda' > \n< tr > < td colspan = '3' style = 'text-align:$spip_lang_left;' > ";
$annee_avant = $annee - 1;
$annee_apres = $annee + 1;
for ($i=$mois; $i < 13 ; $ i + + ) {
$nom = nom_mois("$annee_avant-$i-1");
$gadget .= calendrier_href($script,$annee_avant, $i, 1, "mois", $finurl, $ancre,'', ($nom . ' ' . $annee_avant), 'calendrier-annee','', $nom) ;
}
for ($i=1; $i < $mois - 1; $i++) {
$nom = nom_mois("$annee-$i-1");
$gadget .= calendrier_href($script,$annee, $i, 1, "mois", $finurl, $ancre,'',($nom . ' ' . $annee),'calendrier-annee','', $nom);
}
$gadget .= "< / td > < / tr > "
. "\n< tr > < td class = 'calendrier-tripleagenda' > "
. http_calendrier_agenda($annee, $mois-1, $jour, $mois, $annee, $GLOBALS['afficher_bandeau_calendrier_semaine'], $script,$ancre)
. "< / td > \n< td class = 'calendrier-tripleagenda' > "
. http_calendrier_agenda($annee, $mois, $jour, $mois, $annee, $GLOBALS['afficher_bandeau_calendrier_semaine'], $script,$ancre)
. "< / td > \n< td class = 'calendrier-tripleagenda' > "
. http_calendrier_agenda($annee, $mois+1, $jour, $mois, $annee, $GLOBALS['afficher_bandeau_calendrier_semaine'], $script,$ancre)
. "< / td > "
. "< / tr > "
. "\n< tr > < td colspan = '3' style = 'text-align:$spip_lang_right;' > ";
for ($i=$mois+2; $i < = 12; $i++) {
$nom = nom_mois("$annee-$i-1");
$gadget .= calendrier_href($script,$annee, $i, 1, "mois", $finurl, $ancre,'',$nom . ' ' . $annee, 'calendrier-annee','', $nom);
}
for ($i=1; $i < $mois+1; $i++) {
$nom = nom_mois("$annee_apres-$i-1");
$gadget .= calendrier_href($script, $annee_apres, $i, 1, "mois", $finurl, $ancre,'',$nom . ' ' . $annee_apres, 'calendrier-annee','',$nom);
}
return $gadget . "< / td > < / tr > < / table > < / div > ";
}
// agenda mensuel
// http://doc.spip.org/@http_calendrier_agenda
@ -1266,18 +659,4 @@ function http_calendrier_ics_message($annee, $mois, $jour, $large)
'calendrier-arial10 annonce')));
}
// http://doc.spip.org/@http_calendrier_aide_mess
function http_calendrier_aide_mess()
{
global $spip_lang_left;
if (!autoriser('ecrire')) return '';
return
"\n< br / > < br / > < br / > \n< table width = '700' class = 'arial1 spip_xx-small' > \n< tr > < th style = 'text-align: $spip_lang_left; font-weight: bold;' > " . _T('info_aide').
"< / th > < / tr > < tr > < td class = 'pense-bete' > " ._T('info_symbole_bleu')."\n" .
"< / td > < / tr > < tr > < td class = 'message' > " . _T('info_symbole_vert')."\n" .
"< / td > < / tr > < tr > < td class = 'annonce' > " . _T('info_symbole_jaune')."\n" .
"< / td > < / tr > \n< / table > \n";
}
?>
?>