"._T('fullcalendar:style_add').".
"; sql_insert("spip_fullcalendar_styles", "(titre, bordercolor, bgcolor, textcolor)", "( ".sql_quote($_POST['StyleName']).", ".sql_quote($_POST['bordercolor']).", ".sql_quote($_POST['bgcolor']).", ".sql_quote($_POST['textcolor'])." )"); } # Modification d'un style if( isset($_POST['enregistrer']) && $_POST['action_to_take']=='UpdateStyle' && strlen($_POST['StyleName']) && strlen($_POST['bordercolor']) && strlen($_POST['bgcolor']) && strlen($_POST['textcolor']) && $_POST['id_style'] ){ $INFO="
  "._T('fullcalendar:style_edit').".

"; sql_update('spip_fullcalendar_styles', array( 'titre' => sql_quote($_POST['StyleName']), 'bordercolor' => sql_quote($_POST['bordercolor']), 'bgcolor' => sql_quote($_POST['bgcolor']), 'textcolor' => sql_quote($_POST['textcolor']) ), "id_style=".sql_quote(intval($_POST['id_style'])) ); } # Effacer un style if( $_POST['action_to_take']=='del' && $_POST['id_style'] ){ $INFO.="
  "._T('fullcalendar:style_del')." ".$_POST['id_style']."

"; sql_delete('spip_fullcalendar_styles', "id_style=".$_POST['id_style']); } # Récupère les calendriers $res = sql_select('*', 'spip_fullcalendar_main'); if(sql_count($res)){ $LISTE='
'; while ($row = sql_fetch($res)) $LISTE .= "
".$row['nom']."

"; } # Style par défaut pour la création $ACTION='AddStyle'; $ID_STYLE=''; $NOM=''; $BORDER='#0042c7'; $TEXT='#141666'; $BG='#becde9'; $BUTTON=''; # Récupère les styles $res = sql_select('*', 'spip_fullcalendar_styles'); $num_style = sql_count($res); if(!$num_style) $INFO=""._T('fullcalendar:style_welcome')."

"._T('fullcalendar:style_info'); else { $INFO.= "
"._T('fullcalendar:vous_avez')." ".$num_style." "._T('fullcalendar:styles')."

"; $HTML = " "; while ($row = sql_fetch($res)) { $id = $row['id_style']; $nom = $row['titre']; $border = $row['bordercolor']; $bg = $row['bgcolor']; $text = $row['textcolor']; # Modification d'un style ? if( $_POST['action_to_take']=='edit' && $id==$_POST['id_style'] ){ $ACTION='UpdateStyle'; $ID_STYLE=$id; $NOM=$nom; $BORDER=$border; $TEXT=$text; $BG=$bg; $BUTTON=''; } $rs = sql_select('id_event', 'spip_fullcalendar_events', 'id_style = '.$id); $rw = sql_count($rs); if(!$rw) $DELETE=""; else { $DELETE="  "._T('fullcalendar:linked_to')." ".$rw." "._T('fullcalendar:event'); $DELETE.=($rw>1)?'s.':'.'; } sql_free($rs); $HTML.="
".$nom." ".$DELETE."  

"; } sql_free($res); } $commencer_page = charger_fonction('commencer_page', 'inc'); print $commencer_page(_T('fullcalendar:fullcalendar'), "documents", "forms") ; print "

"; print gros_titre(_T('fullcalendar:gestion_styles'),'',false); print debut_gauche ("",true); print debut_boite_info(true); print "
"._T('fullcalendar:fullcalendar')."
"; print "

"; print $INFO; print fin_boite_info(true); print debut_cadre_enfonce('',true,'','',''); print "
\"CFG CFG - "._T('fullcalendar:configuration')."
"; print fin_cadre_enfonce(true); print debut_cadre_enfonce('',true,'','',''); print "
\""._T('fullcalendar:fullcalendar')." FullCalendar - "._T('fullcalendar:gestion')."
"; print fin_cadre_enfonce(true); if(strlen($LISTE)){ print debut_cadre_enfonce('',true,'',_T('fullcalendar:vos_calendriers'),''); print $LISTE; print fin_cadre_enfonce(true); } print creer_colonne_droite('',true); print debut_droite("", true); print debut_cadre_trait_couleur("", true, "", $titre=_T('fullcalendar:style_title'),"",""); # INTERFACE D'AJOUT print '

'.$BUTTON.'
'; # GESTION DES STYLES if(strlen($HTML)){ print debut_cadre_relief("", false,"", $titre = _T('fullcalendar:vos_styles')); print $HTML; print fin_cadre_relief(false); } print fin_cadre_trait_couleur(true); print fin_gauche(); print fin_page(); } ?>