Browse Source

Faisons profiter le site public du calendrier modernisé via la lib js fullcalendar+json.

Le squelette calendrier_quete.json produit la liste des choses a afficher entre 2 dates, il est donc facilement modifiable indepemment de l'affichage du calendrier qui est pris en charge par contenu/calendrier.
C'est la dist ou Zpip qui s'occupent d'encapsuler ce fichier dans une page complète.
svn/root/tags/plugins/organiseur/0.3.1
cedric@yterium.com 12 years ago
parent
commit
3f47abb6d7
  1. 8
      .gitattributes
  2. 15
      calendrier.html
  3. 36
      calendrier_jour.html
  4. 9
      calendrier_mois.html
  5. 8
      calendrier_periode.html
  6. 6
      calendrier_quete.json.html
  7. 8
      calendrier_quete.json_fonctions.php
  8. 7
      calendrier_semaine.html
  9. 67
      contenu/calendrier.html

8
.gitattributes vendored

@ -4,11 +4,9 @@ action/quete_calendrier.php -text
base/organiseur.php -text
base/organiseur_upgrade.php -text
/calendrier.css -text
/calendrier.html -text
/calendrier_jour.html -text
/calendrier_mois.html -text
/calendrier_periode.html -text
/calendrier_semaine.html -text
/calendrier_quete.json.html -text
/calendrier_quete.json_fonctions.php -text
contenu/calendrier.html -text
exec/calendrier.php -text
exec/menu_agenda.php -text
exec/message.php -text

15
calendrier.html

@ -1,15 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" lang="#LANG" dir="#LANG_DIR">
<head>
<title><:icone_agenda:> - [(#NOM_SITE_SPIP|textebrut)]</title>
[<meta name="description" content="(#DESCRIPTIF_SITE_SPIP|couper{150}|attribut_html)" />]
<INCLURE{fond=inc-head} />
<meta name="robots" content="none" />
<link rel="stylesheet" href="#CHEMIN{calendrier.css}" type="text/css" />
<script type="text/javascript" src="agenda.html#EVAL{_DIR_JAVASCRIPT}layer.js"> </script>
<script type="text/javascript" src="agenda.html#EVAL{_DIR_JAVASCRIPT}presentation.js"> </script>
</head>
<body class="page_agenda">
[(#ENV{type, mois}|agenda_connu)<INCLURE{fond=calendrier_#ENV{type,mois}, type, delais=900, annee, mois, jour, echelle, partie_cal, theme} />]
</body></html>

36
calendrier_jour.html

@ -1,36 +0,0 @@
<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>[(#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><td class='calendrier-couleur1'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,0})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur2'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,1})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur3'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,2})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur4'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,3})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur5'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,4})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur6'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,5})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur7'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,6})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur8'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,7})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur9'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,8})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur10'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,9})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur11'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,10})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur12'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,11})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur13'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,12})]'>&nbsp;&nbsp;</a></td></tr>
<tr><td class='calendrier-couleur14'><a style='text-decoration: none;'
rel='nofollow' href='[(#SELF|parametre_url{theme,13})]'>&nbsp;&nbsp;</a></td></tr>
</table>
</div>
]<//B_jour>

9
calendrier_mois.html

@ -1,9 +0,0 @@
<BOUCLE_mois(ARTICLES)
{agenda date, mois, #ENV{annee}, #ENV{mois}}
>[(#DATE|agenda_memo{#DESCRIPTIF,
#TITRE,
#URL_ARTICLE,
calendrier-couleur[(#ID_SECTEUR|
modulo{14,1})]})]</BOUCLE_mois>[(#DATE|
agenda_affiche{<:aucun_article:>, 'mois'}
)]<//B_mois>

8
calendrier_periode.html

@ -1,8 +0,0 @@
<BOUCLE_periode(ARTICLES)
{agenda date, periode,
#ENV{annee}, #ENV{mois}, #ENV{jour},
#ENV{annee_fin}, #ENV{mois_fin}, #ENV{jour_fin}}>[
(#DATE|agenda_memo{#DESCRIPTIF, #TITRE, #URL_ARTICLE, 'calendrier-couleur6'})
]</BOUCLE_periode>[(#TOTAL_BOUCLE|
agenda_affiche{<:aucun_article:>, 'periode', 'calendrier-couleur6'}
)]<//B_periode>

6
calendrier_quete.json.html

@ -0,0 +1,6 @@
#HTTP_HEADER{Content-type:text/javascript;}
[<BOUCLE_periode(ARTICLES)
{agenda date, periode,
#ENV{start}|todate|affdate{Y}, #ENV{start}|todate|affdate{m}, #ENV{start}|todate|affdate{d},
#ENV{end}|todate|affdate{Y}, #ENV{end}|todate|affdate{m}, #ENV{end}|todate|affdate{d}}{', '}>
[(#ARRAY{id,#ID_ARTICLE,title,[(#TITRE|html2unicode|unicode2charset)],allDay,#EVAL{false},start,#DATE,end,#DATE,url,#URL_ARTICLE,className,calendrier-couleur6,description,[(#INTRODUCTION|html2unicode|unicode2charset)]}|json_encode)]</BOUCLE_periode>]

8
calendrier_quete.json_fonctions.php

@ -0,0 +1,8 @@
<?php
include_spip('inc/json');
function todate($t){return date('Y-m-d H:i:s',$t);}
?>

7
calendrier_semaine.html

@ -1,7 +0,0 @@
<BOUCLE_semaine(ARTICLES)
{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>[(#DATE|
agenda_affiche{<:aucun_article:>, 'semaine', 'calendrier-couleur2','calendrier-couleur4'}
)]<//B_semaine>

67
contenu/calendrier.html

@ -0,0 +1,67 @@
<div id="loading" style="position:absolute;top:20px;left:350px;padding:5px 30px;display:none;border:1px solid #ddd;background:#eee;z-index:100;"><:organiseur:loading:></div>
<div id="calendrier"></div>
<link rel='stylesheet' type='text/css' href='#CHEMIN{lib/fullcalendar/fullcalendar.css}' />
<link rel="stylesheet" type="text/css" href="#CHEMIN{calendrier.css}" />
<script type='text/javascript' src='#CHEMIN{lib/fullcalendar/fullcalendar.min.js}'></script>
<script type="text/javascript">/*<![CDATA[*/
jQuery(document).ready(function() {
// page is now ready, initialize the calendar...
$('#calendrier').fullCalendar({
editable: false,
events: "[(#URL_PAGE{calendrier_quete.json})]",
header: {
left: 'prevYear,prev,next,nextYear today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
firstDay: 1,
monthNames:['<:date_mois_1|attribut_html:>','<:date_mois_2|attribut_html:>','<:date_mois_3|attribut_html:>','<:date_mois_4|attribut_html:>','<:date_mois_5|attribut_html:>','<:date_mois_6|attribut_html:>','<:date_mois_7|attribut_html:>','<:date_mois_8|attribut_html:>','<:date_mois_9|attribut_html:>','<:date_mois_10|attribut_html:>','<:date_mois_11|attribut_html:>','<:date_mois_12|attribut_html:>'],
monthNamesShort:['<:date_mois_1_abbr|attribut_html:>','<:date_mois_2_abbr|attribut_html:>','<:date_mois_3_abbr|attribut_html:>','<:date_mois_4_abbr|attribut_html:>','<:date_mois_5_abbr|attribut_html:>','<:date_mois_6_abbr|attribut_html:>','<:date_mois_7_abbr|attribut_html:>','<:date_mois_8_abbr|attribut_html:>','<:date_mois_9_abbr|attribut_html:>','<:date_mois_10_abbr|attribut_html:>','<:date_mois_11_abbr|attribut_html:>','<:date_mois_12_abbr|attribut_html:>'],
dayNames:['<:date_jour_1|attribut_html:>','<:date_jour_2|attribut_html:>','<:date_jour_3|attribut_html:>','<:date_jour_4|attribut_html:>','<:date_jour_5|attribut_html:>','<:date_jour_6|attribut_html:>','<:date_jour_7|attribut_html:>'],
dayNamesShort:['<:date_jour_1_abbr|attribut_html:>','<:date_jour_2_abbr|attribut_html:>','<:date_jour_3_abbr|attribut_html:>','<:date_jour_4_abbr|attribut_html:>','<:date_jour_5_abbr|attribut_html:>','<:date_jour_6_abbr|attribut_html:>','<:date_jour_7_abbr|attribut_html:>'],
buttonText: {
today: '<:date_aujourdhui|attribut_html:>',
month: '<:organiseur:cal_par_mois|attribut_html:>',
day: '<:organiseur:cal_par_jour|attribut_html:>',
week: '<:organiseur:cal_par_semaine|attribut_html:>'
},
weekMode : 'liquid',
loading: function(bool) {
if (bool) $('#loading').show();
else $('#loading').hide();
},
timeFormat: {
// for agendaWeek and agendaDay
agenda: "H'h'mm{ - H'h'mm}", // 5h00 - 6h30
// for all other views
'': "H'h'(mm)" // 19h
},
axisFormat: "H'h'(mm)",
allDayText:'<:organiseur:cal_jour_entier|attribut_html:>',
columnFormat: {
month: 'ddd', // Mon
week: 'ddd d/M', // Mon 9/7
day: 'dddd d/M' // Monday 9/7
},
titleFormat: {
month: 'MMMM yyyy', // September 2009
week: "d [ MMM] [ yyyy]{ '&#8212;' d MMM yyyy}", // Sep 7 - 13 2009
day: 'dddd d MMM yyyy' // Tuesday, Sep 8, 2009
},
dayClick: function(date, allDay, jsEvent, view) {
if(view.name=='month'){
$('.fc-button-agendaWeek').click();
$('#calendrier').fullCalendar( 'gotoDate', date );
}
else
if(view.name=='agendaWeek'){
$('.fc-button-agendaDay').click();
$('#calendrier').fullCalendar( 'gotoDate', date );
}
},
isRTL : [(#LANG_DIR|=={rtl}|?{true,false})]
})
});
/*]]>*/</script>
Loading…
Cancel
Save