Skip to content
Extraits de code Groupes Projets
Valider 204ea290 rédigé par esj's avatar esj
Parcourir les fichiers

filtre agenda_memo pour calendriers publics sans PHP interpolé

parent 1bcd0fbf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<link rel="stylesheet" href="ecrire/calendrier.css" type="text/css"> <link rel="stylesheet" href="ecrire/calendrier.css" type="text/css">
<script type="text/javascript" src="ecrire/layer.js"></script> <script type="text/javascript" src="ecrire/layer.js"></script>
<script type="text/javascript" src="ecrire/presentation.js"></script> <script type="text/javascript" src="ecrire/presentation.js"></script>
</head><body> </head><body>[
[(#ENV{type}|=={'jour'}|?{' ',''}) (#ENV{type}|=={'jour'}|?{' ',''}
<INCLURE(jour.php3){annee}{mois}{jour}{echelle}{partie_cal}>] )<INCLURE(jour.php3){annee}{mois}{jour}{echelle}{partie_cal}>
[(#ENV{type}|=={'semaine'}|?{' ',''}) ][(#ENV{type}|=={'semaine'}|?{' ',''}
<INCLURE(semaine.php3){annee}{mois}{jour}{echelle}{partie_cal}>] )<INCLURE(semaine.php3){annee}{mois}{jour}{echelle}{partie_cal}>
[(#ENV{type}|=={'mois'}|?{' ',''}) ][(#ENV{type}|=={'mois'}|?{' ',''}
<INCLURE(mois.php3){annee}{mois}{jour}{echelle}{partie_cal}>] )<INCLURE(mois.php3){annee}{mois}{jour}{echelle}{partie_cal}>
[(#ENV{type}|=={''}|?{' ',''}) ][(#ENV{type}|=={''}|?{' ',''}
<INCLURE(mois.php3){annee}{mois}{jour}{echelle}{partie_cal}>] )<INCLURE(mois.php3){annee}{mois}{jour}{echelle}{partie_cal}>
</body></html> ]</body></html>
<?php <BOUCLE_jour(ARTICLES)
include('ecrire/inc_calendrier.php'); {agenda date, #ENV{annee}, #ENV{mois}, #ENV{jour}, jour}>[
$articles = array(); (#DATE|agenda_memo{#DESCRIPTIF, #TITRE, #URL_ARTICLE, 'jour'})
<BOUCLE_evenements(ARTICLES) ]</BOUCLE_jour>
{agenda date, #ENV{annee}, #ENV{mois}, #ENV{jour}, jour}> [(#DATE|agenda_memo{'', '', '', 'jour', 'jour'})]
$articles[[(#DATE|date_anneemoisjour)]][] = array( </B_jour>
'CATEGORIES' => 'info_articles', <:aucun_article:>
'DESCRIPTION' => '[(#DESCRIPTIF|texte_script)]', <//B_jour>
'SUMMARY' => '[(#TITRE|texte_script)]', \ No newline at end of file
'URL' => '#URL_ARTICLE');
</BOUCLE_evenements>
echo http_calendrier_init('', 'jour', '', '', '', array($articles));
?>
<?php <BOUCLE_mois(ARTICLES)
include('ecrire/inc_calendrier.php'); {agenda date, #ENV{annee}, #ENV{mois}, #ENV{jour}, mois}>[
$articles = array(); (#DATE|agenda_memo{#DESCRIPTIF, #TITRE, #URL_ARTICLE, 'mois'})
<BOUCLE_evenements(ARTICLES) ]</BOUCLE_mois>
{agenda date, #ENV{annee}, #ENV{mois}, #ENV{jour}, mois }> [(#DATE|agenda_memo{'', '', '', 'mois', 'mois'})]
$articles[[(#DATE|date_anneemoisjour)]][] = array( </B_mois>
'CATEGORIES' => 'info_articles', <:aucun_article:>
'DESCRIPTION' => '[(#DESCRIPTIF|texte_script)]', <//B_mois>
'SUMMARY' => '[(#TITRE|texte_script)]', \ No newline at end of file
'URL' => '#URL_ARTICLE');
</BOUCLE_evenements>
echo http_calendrier_init('', 'mois', '', '', '', array($articles));
?>
<?php <BOUCLE_semaine(ARTICLES)
include('ecrire/inc_calendrier.php'); {agenda date, #ENV{annee}, #ENV{mois}, #ENV{jour}, semaine}>[
$articles = array(); (#DATE|agenda_memo{#DESCRIPTIF, #TITRE, #URL_ARTICLE, 'semaine'})
<BOUCLE_evenements(ARTICLES) ]</BOUCLE_semaine>
{agenda date, #ENV{annee}, #ENV{mois}, #ENV{jour}, semaine }> [(#DATE|agenda_memo{'', '', '', 'semaine', 'semaine'})]
$articles[[(#DATE|date_anneemoisjour)]][] = array( </B_semaine>
'CATEGORIES' => 'info_articles', <:aucun_article:>
'DESCRIPTION' => '[(#DESCRIPTIF|texte_script)]', <//B_semaine>
'SUMMARY' => '[(#TITRE|texte_script)]',
'URL' => '#URL_ARTICLE');
</BOUCLE_evenements>
echo http_calendrier_init('', 'semaine', '', '', '', array($articles));
?>
...@@ -699,6 +699,28 @@ function date_fin_semaine($annee, $mois, $jour) { ...@@ -699,6 +699,28 @@ function date_fin_semaine($annee, $mois, $jour) {
return date("Ymd", mktime(0,0,0,$mois,$debut+6,$annee)); return date("Ymd", mktime(0,0,0,$mois,$debut+6,$annee));
} }
function agenda_memo($date='', $descriptif='', $titre='', $url='', $cal='', $type='')
{
static $agenda = array();
if ($type)
{
include('ecrire/inc_calendrier.php');
echo http_calendrier_init('', $type, '', '', '',
array($agenda[$cal]));
}
else {
// rajouter une dimension dans le tableau afin d'autoriser plusieurs
// calendriers dans une même page
$agenda[$cal][(date_anneemoisjour($date))][] = array(
'CATEGORIES' => 'info_articles',
'DESCRIPTION' => texte_script($descriptif),
'SUMMARY' => texte_script($titre),
'URL' => $url);
// signifier qu'il y a qqch
return " ";
}
}
// //
// Fonctions graphiques // Fonctions graphiques
// //
......
...@@ -597,11 +597,11 @@ function calculer_squelette($squelette, $nom, $gram, $sourcefile) { ...@@ -597,11 +597,11 @@ function calculer_squelette($squelette, $nom, $gram, $sourcefile) {
foreach($boucles as $id => $boucle) { foreach($boucles as $id => $boucle) {
// Reproduire la boucle en commentaire // Indiquer la boucle en commentaire
$pretty = "BOUCLE$id(".strtoupper($boucle->type_requete).")"; $pretty = "BOUCLE$id ".strtoupper($boucle->type_requete);
// anachronique. A refaire. // anachronique. A refaire.
/* if ($boucle->param && is_array($boucle->param)) /* if ($boucle->param && is_array($boucle->param))
$pretty .= " {".join("} {", $boucle->param)."}";*/ $pretty .= " {".join("} {", $boucle->param)."}";
// sans oublier les parametres traites en amont // sans oublier les parametres traites en amont
if ($boucle->separateur) if ($boucle->separateur)
foreach($boucle->separateur as $v) foreach($boucle->separateur as $v)
...@@ -609,11 +609,11 @@ function calculer_squelette($squelette, $nom, $gram, $sourcefile) { ...@@ -609,11 +609,11 @@ function calculer_squelette($squelette, $nom, $gram, $sourcefile) {
if ($boucle->tout) if ($boucle->tout)
$pretty .= '{tout}'; $pretty .= '{tout}';
if ($boucle->plat) if ($boucle->plat)
$pretty .= '{plat}'; $pretty .= '{plat}'; */
$pretty = ereg_replace("[\r\n]", " ", $pretty); $pretty = ereg_replace("[\r\n]", " ", $pretty);
// Puis envoyer son code // Puis envoyer son code
$codeboucle = "\n//\n// <$pretty>\n//\n" $codeboucle = "\n//\n// $pretty\n//\n"
."function BOUCLE" . ereg_replace("-","_",$id) . $nom . ."function BOUCLE" . ereg_replace("-","_",$id) . $nom .
'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
$boucle->return; $boucle->return;
......
...@@ -283,8 +283,10 @@ function critere_agenda($idb, &$boucles, $crit) ...@@ -283,8 +283,10 @@ function critere_agenda($idb, &$boucles, $crit)
$boucle->where[] = "DATE_FORMAT($date, '%Y%m') = '\" . $annee . $mois .\"'"; $boucle->where[] = "DATE_FORMAT($date, '%Y%m') = '\" . $annee . $mois .\"'";
else else
$boucle->where[] = $boucle->where[] =
"DATE_FORMAT($date, '%Y%m') >= ' \" . date_debut_semaine($annee . ',' . $mois . ',' . $jour . \"' AND "DATE_FORMAT($date, '%Y%m%d') >= '\" .
DATE_FORMAT($date, '%Y%m') <= ' \" . date_fin_semaine($annee . ',' . $mois . ',' . $jour . \"'"; date_debut_semaine($annee, $mois, $jour) . \"' AND
DATE_FORMAT($date, '%Y%m%d') <= '\" .
date_fin_semaine($annee, $mois, $jour) . \"'";
} }
......
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