Example #1
0
function exec_calendrier_args($time, $type, $echelle, $partie_cal)
{
	if ($time < 0) $time = time();

	if (!$type)
		$type = 'mois';
	elseif ($type == 'semaine')
		$GLOBALS['afficher_bandeau_calendrier_semaine'] = true;

	$ancre = 'calendrier-1';
	$r = generer_url_ecrire('calendrier', "type=$type") . "#$ancre";
	$r = http_calendrier_init($time, $type, $echelle, $partie_cal, $r);

	if (_AJAX) {
		ajax_retour($r);
	} else {
		$date = date("Y-m-d", $time);
		if ($type == 'jour') {
			$titre = nom_jour($date)." ". affdate_jourcourt($date);
		}  else {
			$titre = _T('titre_page_calendrier',
					array('nom_mois' => nom_mois($date),
						'annee' => annee($date)));
		}

		$commencer_page = charger_fonction('commencer_page', 'inc');
		echo $commencer_page($titre, "accueil", "calendrier");
// ne produit rien par defaut, mais est utilisee par le plugin agenda
		echo barre_onglets("calendrier", "calendrier"); 
		echo debut_grand_cadre(true);
		echo "\n<div>&nbsp;</div>\n<div id='", $ancre, "'>",$r,'</div>';
		echo fin_grand_cadre(true);
		echo fin_page();
	}
}
Example #2
0
function agenda_mini($i) {
  $args = func_get_args();
  $une_date = array_shift($args); // une date comme balise
  $sinon = array_shift($args);
  if (!$une_date) return $sinon;
  $type = 'mini';
  $agenda = Agenda_memo_full(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;
		}
    }
	$la_date = mktime(0, 0, 0, mois($une_date), 1, annee($une_date));
    include_spip('inc/agenda');
    return http_calendrier_init($la_date, $type, '', '', '', array('', $evt));
}
Example #3
0
function agenda_affiche_full($i)
{
	$args = func_get_args();
	$nb = array_shift($args); // nombre d'evenements (on pourrait l'afficher)
	$evt = array_shift($args);
	$type = array_shift($args);

	$agenda = agenda_memo_full(0);
	$evt_avec = array();
	$evt_sans = array();
	if (!$nb) {
		$d = array(time());
	} else {
		foreach (($args ? $args : array_keys($agenda)) as $k) {
			if (isset($agenda[$k])&&is_array($agenda[$k]))
				foreach($agenda[$k] as $d => $v) {
					$evt_avec[$d] = isset($evt_avec[$d]) ? (array_merge($evt_avec[$d], $v)) : $v;
				}
		}
		$d = array_keys($evt_avec);

		$evenements = agenda_memo_evt_full(0);
		foreach (($args ? $args : array_keys($evenements)) as $k) {
			if (isset($evenements[$k])&&is_array($evenements[$k]))
				foreach($evenements[$k] as $d => $v) {
					$evt_sans[$d] = isset($evt_sans[$d]) ? (array_merge($evt_sans[$d], $v)) : $v;
				}
		}
	}

	if (count($d)){
		$mindate = min($d);
		$start = strtotime($mindate);
	} else {
		$mindate = ($j=_request('jour')) * ($m=_request('mois')) * ($a=_request('annee'));
  	if ($mindate)
			$start = mktime(0,0,0, $m, $j, $a);
  	else
			$start = mktime(0,0,0);
	}

	if ($type != 'periode')
		$evt = array($evt_sans, $evt_avec);
	else
	{
		$min = substr($mindate,6,2);
		$max = $min + ((strtotime(max($d)) - strtotime($mindate)) / (3600 * 24));
		if ($max < 31) $max = 0;
			$evt = array($evt_sans, $evt_avec, $min, $max);
		$type = 'mois';
	}

	include_spip('inc/agenda');
	$texte=http_calendrier_init($start, $type, '', '', self(), $evt);

	return $texte;
}
Example #4
0
function agenda_periode($type, $nb, $avec, $sans='')
{
	include_spip('inc/agenda');
	$start = agenda_controle();
	if ($start<0) $start = time();
	$mindate = date("Ymd", $start);

	if ($type != 'periode')
		$evt = array($sans, $avec);
	else {
		$min = substr($mindate,6,2);
		$max = !(is_array($avec) AND $avec) ? time() : strtotime(max(array_keys($avec)));
		$max = $min + (($max - $start) / (3600 * 24));
		if ($max < 31) $max = 0;
		$evt = array($sans, $avec, $min, $max);
		$type = 'mois';
	}
	$ancre = _request('ancre');
	$s =  self('&') . (preg_match('/^[\w-]+$/', $ancre) ? "#$ancre" : '');
	return http_calendrier_init($start, $type,  _request('echelle'), _request('partie_cal'), $s, $evt);
}
Example #5
0
<?php

/***************************************************************************\
 *  SPIP, Systeme de publication pour l'internet                           *
 *                                                                         *
 *  Copyright (c) 2001-2005                                                *
 *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
 *                                                                         *
 *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
 *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
\***************************************************************************/
include 'inc/inc.php';
include_lcm('inc_calendar');
lcm_page_start(_T('title_calendar_view'));
$afficher_bandeau_calendrier = true;
echo http_calendrier_init('', $_REQUEST['type']);
lcm_page_end();