";
}
function WCalendar_body_prive($flux){
global $WCalendar_independants,$WCalendar_lies;
if (count($WCalendar_independants)+count($WCalendar_lies)){
$flux.= "";
foreach($WCalendar_independants as $infos)
$flux .= WCalendar_point_entree($infos['suffixe']);
foreach($WCalendar_lies as $infos){
$flux .= WCalendar_point_entree($infos['suffixe1']);
$flux .= WCalendar_point_entree($infos['suffixe2']);
}
}
return $flux;
}
function WCalendar_statique_jsinit($t, $s){
$vars = "
var cal$s;";
$js_a = "";
$js_b = "
var selected$s = '';
this.content$s = document.getElementById('selected_date$s');
if (this.content$s){
selected$s=this.content$s.innerHTML;
}
cal$s = new SPIP.widget.Calendar2up_INT_multi('cal$s','container$s','',selected$s);
cal$s.title = '$t';
cal$s.sync();
cal$s.render();
";
$js_c = "
function getSelectedDate$s() {
var res = document.getElementById('selected_date$s');
res.innerHTML = cal$s.getSelectedDates();
}
";
return array($vars,$js_a,$js_b,$js_c);
}
function WCalendar_jsinit($t, $s){
$vars = "
var cal$s;";
$js_a = "
if (cal$s)
cal$s.hide();";
$js_b = "
this.link$s = document.getElementById('dateLink$s');
if (this.link$s){
this.selYear$s = document.getElementById('annee$s');
this.selMonth$s = document.getElementById('mois$s');
this.selDay$s = document.getElementById('jour$s');
thisYear$s = this.selYear$s.selectedIndex+parseInt(this.selYear$s.options[0].value);
thisMonth$s = this.selMonth$s.selectedIndex;
thisDay$s = this.selDay$s.selectedIndex +1;
cal$s = new SPIP.widget.Calendar2up_INT('cal$s','container$s',(thisMonth$s+1)+'/'+thisYear$s,(thisMonth$s+1)+'/'+thisDay$s+'/'+thisYear$s);
cal$s.title = '$t';
cal$s.setChildFunction('onSelect',setDate$s);
cal$s.render();
}
";
$js_c = "
function showCalendar$s() {
hideall();
cal$s.outerContainer.style.top = (link$s.height-1+findPosY(link$s)) + 'px';
cal$s.outerContainer.style.left = (findPosX(link$s)) + 'px';
cal$s.outerContainer.style.display='block';
}
";
return array($vars,$js_a,$js_b,$js_c);
}
function WCalendar_js_verifie_lies($sd,$sf){
return "
function verifie_date$sd$sf(modif){
var Date$sd = new Date;
Date$sd.setFullYear(this.selYear$sd.selectedIndex+parseInt(selYear$sd.options[0].value));
Date$sd.setMonth(this.selMonth$sd.selectedIndex);
Date$sd.setDate( this.selDay$sd.selectedIndex + 1);
var Date$sf = new Date;
Date$sf.setFullYear(this.selYear$sf.selectedIndex+parseInt(selYear$sf.options[0].value));
Date$sf.setMonth(this.selMonth$sf.selectedIndex);
Date$sf.setDate( this.selDay$sf.selectedIndex + 1);
if (Date$sf\n";
$flux .= "\n";
$flux .= "\n";
$flux .= "\n";
$flux .= "\n";
$flux .= ''. "\n";
// les noms de mois et de jour selon les fichiers de langue :
$months_long = "";
$months_short = "";
for ($j=1;$j<=12;$j++){
$nom = entites_html(ucfirst(strtr(_T("spip:date_mois_$j"),$trans_tbl)));
$months_long .= ",'".unicode2charset(charset2unicode($nom,''))."'";
$months_short .= ",'".unicode2charset(charset2unicode(preg_replace("/^((?[0-9]{2,5};|.){0,3}).*$/i","\\1",$nom),''))."'";
}
$months_long = substr($months_long,1);
$months_short = substr($months_short,1);
$days_long = "";
$days_medium = "";
$days_short = "";
$days_1char = "";
for ($j=1;$j<=7;$j++){
$nom = entites_html(ucfirst(strtr(_T("spip:date_jour_$j"),$trans_tbl)));
$days_long .= ",'".$nom."'";
$days_medium .= ",'".preg_replace("/^((?[0-9]{2,5};|.){0,3}).*$/i","\\1",$nom)."'";
$days_short .= ",'".preg_replace("/^((?[0-9]{2,5};|.){0,2}).*$/i","\\1",$nom)."'";
$days_1char .= ",'".preg_replace("/^((?[0-9]{2,5};|.){0,1}).*$/i","\\1",$nom)."'";
}
$days_long = substr($days_long,1);
$days_medium = substr($days_medium,1);
$days_short = substr($days_short,1);
$days_1char = substr($days_1char,1);
$start_weekday = 1;
$img_arrow_left = _DIR_PLUGIN_WIDGET_CALENDAR."/img_pack/callt.gif";
$img_arrow_right = _DIR_PLUGIN_WIDGET_CALENDAR."/img_pack/calrt.gif";
$img_close = _DIR_PLUGIN_WIDGET_CALENDAR."/img_pack/calx.gif";
// le JS dynamique d'init
$flux .= "";
$flux .= $js;
}
return $flux;
}
?>