[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / exec / calendrier.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 include_spip('inc/presentation');
16
17 // http://doc.spip.org/@exec_calendrier_dist
18 function exec_calendrier_dist()
19 {
20 exec_calendrier_args(agenda_controle(), _request('type'), _request('echelle'), _request('partie_cal'));
21 }
22
23 function exec_calendrier_args($time, $type, $echelle, $partie_cal)
24 {
25 if ($time < 0) $time = time();
26
27 if (!$type)
28 $type = 'mois';
29 elseif ($type == 'semaine')
30 $GLOBALS['afficher_bandeau_calendrier_semaine'] = true;
31
32 $ancre = 'calendrier-1';
33 $r = generer_url_ecrire('calendrier', "type=$type") . "#$ancre";
34 $r = http_calendrier_init($time, $type, $echelle, $partie_cal, $r);
35
36 if (_AJAX) {
37 ajax_retour($r);
38 } else {
39 $date = date("Y-m-d", $time);
40 if ($type == 'jour') {
41 $titre = nom_jour($date)." ". affdate_jourcourt($date);
42 } else {
43 $titre = _T('titre_page_calendrier',
44 array('nom_mois' => nom_mois($date),
45 'annee' => annee($date)));
46 }
47
48 $commencer_page = charger_fonction('commencer_page', 'inc');
49 echo $commencer_page($titre, "accueil", "calendrier");
50 // ne produit rien par defaut, mais est utilisee par le plugin agenda
51 echo barre_onglets("calendrier", "calendrier");
52 echo debut_grand_cadre(true);
53 echo "\n<div>&nbsp;</div>\n<div id='", $ancre, "'>",$r,'</div>';
54 echo fin_grand_cadre(true);
55 echo fin_page();
56 }
57 }
58
59 ?>