1 | <?php |
---|
2 | /* |
---|
3 | * Plugin Article Accueil |
---|
4 | * (c) 2011 Cedric Morin, Joseph |
---|
5 | * Distribue sous licence GPL |
---|
6 | * |
---|
7 | */ |
---|
8 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
9 | /** |
---|
10 | * Declaration des tables principales |
---|
11 | * |
---|
12 | * @param array $tables_principales |
---|
13 | * @return array |
---|
14 | */ |
---|
15 | function article_accueil_declarer_tables_principales($tables_principales){ |
---|
16 | |
---|
17 | $tables_principales['spip_rubriques']['field']['id_article_accueil'] = "bigint(21) DEFAULT '0' NOT NULL"; |
---|
18 | return $tables_principales; |
---|
19 | } |
---|
20 | |
---|
21 | /** |
---|
22 | * Upgrade des tables |
---|
23 | * |
---|
24 | * @param string $nom_meta_base_version |
---|
25 | * @param string $version_cible |
---|
26 | */ |
---|
27 | function article_accueil_upgrade($nom_meta_base_version,$version_cible){ |
---|
28 | include_spip('inc/meta'); |
---|
29 | $current_version = '0.0'; |
---|
30 | if ( (!isset($GLOBALS['meta'][$nom_meta_base_version]) ) |
---|
31 | || (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){ |
---|
32 | if (version_compare($current_version,'0.1','<')){ |
---|
33 | include_spip('base/create'); |
---|
34 | include_spip('base/abstract_sql'); |
---|
35 | maj_tables('spip_rubriques'); |
---|
36 | ecrire_meta($nom_meta_base_version,$current_version='0.1','non'); |
---|
37 | } |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | /** |
---|
43 | * Desinstallation |
---|
44 | * |
---|
45 | * @param string $nom_meta_base_version |
---|
46 | */ |
---|
47 | function article_accueil_vider_tables($nom_meta_base_version) { |
---|
48 | include_spip('inc/meta'); |
---|
49 | include_spip('base/abstract_sql'); |
---|
50 | sql_alter("TABLE spip_rubriques DROP id_article_accueil"); |
---|
51 | effacer_meta($nom_meta_base_version); |
---|
52 | } |
---|
53 | ?> |
---|