Skip to content
Extraits de code Groupes Projets
Valider 9bbacd33 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

colmatage partiel de #511 : affichage du calendrier meme sans evenement plutot...

colmatage partiel de #511 : affichage du calendrier meme sans evenement plutot que le disgracieux "pas d'article a cette adresse'
parent fc126b77
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<BOUCLE_jour(ARTICLES)
{agenda date, jour, #ENV{annee}, #ENV{mois}, #ENV{jour}}
>[(#DATE|agenda_memo{#DESCRIPTIF, #TITRE, #URL_ARTICLE,
calendrier-couleur[(#ENV{theme,0}|modulo{14,1})]})]</BOUCLE_jour>[(#TOTAL_BOUCLE|agenda_affiche{<:aucun_article:>, 'jour',
calendrier-couleur[(#ENV{theme,0}|modulo{14,1})]})]</BOUCLE_jour>[(#DATE|agenda_affiche{<:aucun_article:>, 'jour',
calendrier-couleur[(#ENV{theme,0}|modulo{14,1})]})][(#TOTAL_BOUCLE|?{' ',''})
<div style='position: fixed; top:50px; left: 20px'>
<table style='width: 10px'><tr>
......
......@@ -4,6 +4,6 @@
#TITRE,
#URL_ARTICLE,
calendrier-couleur[(#ID_SECTEUR|
modulo{14,1})]})]</BOUCLE_mois>[(#TOTAL_BOUCLE|
modulo{14,1})]})]</BOUCLE_mois>[(#DATE|
agenda_affiche{<:aucun_article:>, 'mois'}
)]<//B_mois>
\ No newline at end of file
......@@ -2,6 +2,6 @@
{agenda date, semaine, #ENV{annee}, #ENV{mois}, #ENV{jour}}
>[(#DATE|agenda_memo{#DESCRIPTIF, #TITRE, #URL_ARTICLE,
[(#COMPTEUR_BOUCLE|
alterner{'calendrier-couleur2', 'calendrier-couleur4'})]})]</BOUCLE_semaine>[(#TOTAL_BOUCLE|
alterner{'calendrier-couleur2', 'calendrier-couleur4'})]})]</BOUCLE_semaine>[(#DATE|
agenda_affiche{<:aucun_article:>, 'semaine', 'calendrier-couleur2','calendrier-couleur4'}
)]<//B_semaine>
......@@ -923,36 +923,38 @@ function agenda_memo($date=0 , $descriptif='', $titre='', $url='', $cal='')
// http://doc.spip.org/@agenda_affiche
function agenda_affiche($i)
{
include_spip('inc/agenda');
include_spip('inc/minipres');
$args = func_get_args();
$nb = array_shift($args); // nombre d'evenements (on pourrait l'afficher)
$sinon = array_shift($args);
$type = array_shift($args);
if (!$nb)
return http_calendrier_init('', $type, '', '', str_replace('&amp;', '&', self()), $sinon);
$agenda = agenda_memo(0);
$evt = array();
foreach (($args ? $args : array_keys($agenda)) as $k) {
if (is_array($agenda[$k]))
foreach($agenda[$k] as $d => $v) {
$evt[$d] = $evt[$d] ? (array_merge($evt[$d], $v)) : $v;
include_spip('inc/agenda');
include_spip('inc/minipres');
$args = func_get_args();
$nb = array_shift($args); // nombre d'evenements (on pourrait l'afficher)
$sinon = array_shift($args);
$type = array_shift($args);
if (!$nb)
return http_calendrier_init('', $type, '', '', str_replace('&amp;', '&', self()), $sinon);
$agenda = agenda_memo(0);
$evt = array();
foreach (($args ? $args : array_keys($agenda)) as $k) {
if (is_array($agenda[$k]))
foreach($agenda[$k] as $d => $v) {
$evt[$d] = $evt[$d] ? (array_merge($evt[$d], $v)) : $v;
}
}
$d = array_keys($evt);
$mindate = date_ical(_request('jour')."/"._request('mois')."/"._request('annee'));
if (count($d))
$mindate = min($d);
$start = strtotime($mindate);
if ($type != 'periode')
$evt = array('', $evt);
else
{
$min = substr($mindate,6,2);
$max = $min + ((strtotime(max($d)) - $start) / (3600 * 24));
if ($max < 31) $max = 0;
$evt = array('', $evt, $min, $max);
$type = 'mois';
}
}
$d = array_keys($evt);
$mindate = min($d);
$start = strtotime($mindate);
if ($type != 'periode')
$evt = array('', $evt);
else
{
$min = substr($mindate,6,2);
$max = $min + ((strtotime(max($d)) - $start) / (3600 * 24));
if ($max < 31) $max = 0;
$evt = array('', $evt, $min, $max);
$type = 'mois';
}
return http_calendrier_init($start, $type, '', '', str_replace('&amp;', '&', self()), $evt);
return http_calendrier_init($start, $type, '', '', str_replace('&amp;', '&', self()), $evt);
}
//
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter