1 | <?php |
---|
2 | /** |
---|
3 | * Plugin Autocomplétion |
---|
4 | * (c) 2012 Dimitri EXBRAYAT |
---|
5 | * Licence GNU/GPL |
---|
6 | */ |
---|
7 | |
---|
8 | if (!defined('_ECRIRE_INC_VERSION')) return; |
---|
9 | //error_reporting(E_ALL); |
---|
10 | //ini_set('display_errors','On'); |
---|
11 | /** |
---|
12 | * Fonction d'installation du plugin et de mise. |
---|
13 | **/ |
---|
14 | function autocompletion_upgrade($nom_meta_base_version, $version_cible) { |
---|
15 | |
---|
16 | $filename = include_spip("base/arrayCommunesDepRegFr"); |
---|
17 | include($filename); |
---|
18 | |
---|
19 | $maj = array(); |
---|
20 | $maj['create'] = array( |
---|
21 | array('maj_tables', array('spip_communes')), |
---|
22 | array('maj_tables', array('spip_departements')), |
---|
23 | array('maj_tables', array('spip_regions')), |
---|
24 | array('sql_insertq_multi', 'spip_communes', $spip_communesValeurs), |
---|
25 | array('sql_insertq_multi', 'spip_departements', $spip_departementsValeurs), |
---|
26 | array('sql_insertq_multi', 'spip_regions', $spip_regionsValeurs) |
---|
27 | ); |
---|
28 | |
---|
29 | include_spip('base/upgrade'); |
---|
30 | |
---|
31 | maj_plugin($nom_meta_base_version, $version_cible, $maj); |
---|
32 | |
---|
33 | } |
---|
34 | |
---|
35 | /** |
---|
36 | * Fonction de désinstallation du plugin. |
---|
37 | **/ |
---|
38 | function autocompletion_vider_tables($nom_meta_base_version) { |
---|
39 | sql_drop_table("spip_communes"); |
---|
40 | sql_drop_table("spip_departements"); |
---|
41 | sql_drop_table("spip_regions"); |
---|
42 | effacer_meta($nom_meta_base_version); |
---|
43 | } |
---|
44 | |
---|
45 | ?> |
---|