[SPIP] ~maj v2.1.25-->2.1.26
[velocampus/web/www.git] / www / plugins / auto / fullcalendar / base / fullcalendar_init.php
1 <?php
2
3 /* * * * * * * * * * * * * * * * * * * *
4 *
5 * - FullCalendar pour SPIP -
6 *
7 * Création des tables dans la base MySQL
8 *
9 * Auteur : Grégory PASCAL - ngombe at gmail dot com
10 * Modifs : 05/04/2011
11 *
12 */
13
14
15 $GLOBALS['fullcalendar_version'] = 0.1;
16
17 function fullcalendar_verifier_base(){
18 $version_base = $GLOBALS['fullcalendar_version'];
19 $current_version = 0.0;
20 if ( (!isset($GLOBALS['meta']['fullcalendar_base_version']) )
21 || (($current_version = $GLOBALS['meta']['fullcalendar_base_version'])!=$version_base)) {
22 include_spip('base/fullcalendar');
23 if ($current_version==0.0){
24 include_spip('base/create');
25 include_spip('base/abstract_sql');
26 creer_base();
27 ecrire_meta('fullcalendar_base_version',$current_version=$version_base);
28 ecrire_meta('fullcalendar','a:19:{s:11:"defaultView";s:5:"month";s:8:"useTheme";s:4:"true";s:11:"aspectRatio";s:4:"1.35";s:8:"weekends";s:4:"true";s:8:"firstDay";s:1:"1";s:10:"headerLeft";s:5:"today";s:12:"headerCenter";s:5:"title";s:11:"headerRight";s:9:"prev,next";s:17:"month_titleFormat";s:9:"MMMM yyyy";s:18:"month_columnFormat";s:4:"dddd";s:16:"month_timeFormat";s:0:"";s:16:"week_titleFormat";s:34:"d [MMMM] [ yyyy]{ - d MMMM yyyy}";s:17:"week_columnFormat";s:6:"dddd d";s:21:"week_timeFormat_basic";s:6:"H(:mm)";s:22:"week_timeFormat_agenda";s:6:"H(:mm)";s:15:"day_titleFormat";s:16:"dddd d MMMM yyyy";s:16:"day_columnFormat";s:11:"dddd d MMMM";s:20:"day_timeFormat_basic";s:13:"H:mm{ - H:mm}";s:21:"day_timeFormat_agenda";s:13:"H:mm{ - H:mm}";}');
29 }
30 ecrire_metas();
31 }
32 }
33
34 function fullcalendar_effacer_tables(){
35 $table_prefix = $GLOBALS['table_prefix'] ;
36 include_spip('base/abstract_sql');
37 sql_drop ("spip_fullcalendar_main");
38 sql_drop ("spip_fullcalendar_events");
39 sql_drop ("spip_fullcalendar_styles");
40 effacer_meta('fullcalendar_base_version');
41 effacer_meta('fullcalendar');
42 ecrire_metas();
43 }
44
45 function fullcalendar_install($action){
46 $version_base = $GLOBALS['fullcalendar_version'];
47 switch ($action){
48 case 'test':
49 return (isset($GLOBALS['meta']['fullcalendar_base_version'])
50 AND ($GLOBALS['meta']['fullcalendar_base_version']>=$version_base));
51 break;
52 case 'install':
53 fullcalendar_verifier_base();
54 break;
55 case 'uninstall':
56 fullcalendar_effacer_tables();
57 break;
58 }
59 }
60 ?>