1 | <?php |
---|
2 | |
---|
3 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
4 | |
---|
5 | function gis_declarer_tables_interfaces($interface){ |
---|
6 | $interface['tables_jointures']['spip_gis'][] = 'gis_liens'; |
---|
7 | $interface['tables_jointures']['spip_gis_liens'][] = 'gis'; |
---|
8 | $interface['tables_jointures']['spip_articles'][] = 'gis_liens'; |
---|
9 | $interface['tables_jointures']['spip_auteurs'][] = 'gis_liens'; |
---|
10 | $interface['tables_jointures']['spip_breves'][] = 'gis_liens'; |
---|
11 | $interface['tables_jointures']['spip_documents'][] = 'gis_liens'; |
---|
12 | $interface['tables_jointures']['spip_groupes_mots'][] = 'gis_liens'; |
---|
13 | $interface['tables_jointures']['spip_mots'][] = 'gis_liens'; |
---|
14 | $interface['tables_jointures']['spip_rubriques'][] = 'gis_liens'; |
---|
15 | $interface['tables_jointures']['spip_syndic'][] = 'gis_liens'; |
---|
16 | |
---|
17 | $interface['table_des_tables']['gis']='gis'; |
---|
18 | $interface['table_des_tables']['gis_liens']='gis_liens'; |
---|
19 | |
---|
20 | return $interface; |
---|
21 | } |
---|
22 | |
---|
23 | function gis_declarer_tables_objets_sql($tables){ |
---|
24 | /* Declaration de la table de points gis */ |
---|
25 | $tables['spip_gis'] = array( |
---|
26 | /* Declarations principales */ |
---|
27 | 'table_objet' => 'gis', |
---|
28 | 'table_objet_surnoms' => array(), |
---|
29 | 'type' => 'gis', |
---|
30 | 'type_surnoms' => array('gis'), |
---|
31 | |
---|
32 | /* La table */ |
---|
33 | 'field'=> array( |
---|
34 | "id_gis" => "bigint(21) NOT NULL", |
---|
35 | "titre" => "varchar(255) NOT NULL DEFAULT ''", |
---|
36 | "descriptif" => "text NOT NULL DEFAULT ''", |
---|
37 | "lat" => "double NULL NULL", |
---|
38 | "lon" => "double NULL NULL", |
---|
39 | "zoom" => "tinyint(4) NULL NULL", |
---|
40 | "adresse" => "text NOT NULL DEFAULT ''", |
---|
41 | "pays" => "text NOT NULL DEFAULT ''", |
---|
42 | "code_pays" => "varchar(255) NOT NULL DEFAULT ''", |
---|
43 | "region" => "text NOT NULL DEFAULT ''", |
---|
44 | "ville" => "text NOT NULL DEFAULT ''", |
---|
45 | "code_postal" => "varchar(255) NOT NULL DEFAULT ''" |
---|
46 | ), |
---|
47 | 'key' => array( |
---|
48 | "PRIMARY KEY" => "id_gis", |
---|
49 | ), |
---|
50 | 'principale' => 'oui', |
---|
51 | /*'modeles' => array('carte_gis','carte_gis_preview'),*/ |
---|
52 | |
---|
53 | /* Le titre, la date et la gestion du statut */ |
---|
54 | 'titre' => "titre, '' AS lang", |
---|
55 | |
---|
56 | /* L'édition, l'affichage et la recherche */ |
---|
57 | 'page' => 'gis', |
---|
58 | 'url_voir' => 'gis', |
---|
59 | 'url_edit' => 'gis_editer', |
---|
60 | 'editable' => 'oui', |
---|
61 | /*'champs_editables' => array(), */ |
---|
62 | 'icone_objet' => 'gis', |
---|
63 | 'rechercher_champs' => array( |
---|
64 | 'titre' => 8, |
---|
65 | 'descriptif' => 2, |
---|
66 | 'adresse' => 2, |
---|
67 | 'pays' => 2, |
---|
68 | 'code_pays' => 2, |
---|
69 | 'region' => 2, |
---|
70 | 'ville' => 2, |
---|
71 | 'code_postal' => 2, |
---|
72 | ), |
---|
73 | |
---|
74 | /* Les textes standard */ |
---|
75 | 'texte_ajouter' => 'gis:texte_ajouter_gis', |
---|
76 | 'texte_retour' => 'icone_retour', |
---|
77 | 'texte_modifier' => 'gis:texte_modifier_gis', |
---|
78 | 'texte_creer' => 'gis:texte_creer_gis', |
---|
79 | 'texte_creer_associer' => 'gis:texte_creer_associer_gis', |
---|
80 | 'texte_objet' => 'gis:gis_singulier', |
---|
81 | 'texte_objets' => 'gis:gis_pluriel', |
---|
82 | 'info_aucun_objet'=> 'gis:info_aucun_gis', |
---|
83 | 'info_1_objet' => 'gis:info_1_gis', |
---|
84 | 'info_nb_objets' => 'gis:info_nb_gis', |
---|
85 | 'texte_logo_objet' => 'gis:libelle_logo_gis', |
---|
86 | ); |
---|
87 | |
---|
88 | $spip_gis_liens = array( |
---|
89 | "id_gis" => "bigint(21) NOT NULL", |
---|
90 | "objet" => "VARCHAR (25) DEFAULT '' NOT NULL", |
---|
91 | "id_objet" => "bigint(21) NOT NULL"); |
---|
92 | |
---|
93 | $spip_gis_liens_key = array( |
---|
94 | "PRIMARY KEY" => "id_gis,id_objet,objet", |
---|
95 | "KEY id_objet" => "id_gis"); |
---|
96 | |
---|
97 | $tables_auxiliaires['spip_gis_liens'] = array( |
---|
98 | 'field' => &$spip_gis_liens, |
---|
99 | 'key' => &$spip_gis_liens_key); |
---|
100 | |
---|
101 | return $tables; |
---|
102 | } |
---|
103 | |
---|
104 | function gis_declarer_tables_auxiliaires($tables_auxiliaires){ |
---|
105 | $spip_gis_liens = array( |
---|
106 | "id_gis" => "bigint(21) NOT NULL", |
---|
107 | "objet" => "VARCHAR (25) DEFAULT '' NOT NULL", |
---|
108 | "id_objet" => "bigint(21) NOT NULL"); |
---|
109 | |
---|
110 | $spip_gis_liens_key = array( |
---|
111 | "PRIMARY KEY" => "id_gis,id_objet,objet", |
---|
112 | "KEY id_objet" => "id_gis"); |
---|
113 | |
---|
114 | $tables_auxiliaires['spip_gis_liens'] = array( |
---|
115 | 'field' => &$spip_gis_liens, |
---|
116 | 'key' => &$spip_gis_liens_key); |
---|
117 | |
---|
118 | return $tables_auxiliaires; |
---|
119 | } |
---|
120 | |
---|
121 | ?> |
---|