3 if (!defined("_ECRIRE_INC_VERSION")) return;
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';
17 $interface['table_des_tables']['gis'] = 'gis';
18 $interface['table_des_tables']['gis_liens'] = 'gis_liens';
20 // Traitements typo et raccourcis
21 $interface['table_des_traitements']['DESCRIPTIF_GIS'][] = _TRAITEMENT_RACCOURCIS
;
22 $interface['table_des_traitements']['VILLE'][] = 'typo(extraire_multi(%s))';
23 $interface['table_des_traitements']['PAYS'][] = 'typo(extraire_multi(%s))';
28 function gis_declarer_tables_objets_sql($tables){
29 /* Declaration de la table de points gis */
30 $tables['spip_gis'] = array(
31 /* Declarations principales */
32 'table_objet' => 'gis',
33 'table_objet_surnoms' => array('gis'),
35 'type_surnoms' => array('gi'),
39 "id_gis" => "bigint(21) NOT NULL",
40 "titre" => "varchar(255) NOT NULL DEFAULT ''",
41 "descriptif" => "text NOT NULL DEFAULT ''",
42 "lat" => "double NULL NULL",
43 "lon" => "double NULL NULL",
44 "zoom" => "tinyint(4) NULL NULL",
45 "adresse" => "text NOT NULL DEFAULT ''",
46 "pays" => "text NOT NULL DEFAULT ''",
47 "code_pays" => "varchar(255) NOT NULL DEFAULT ''",
48 "region" => "text NOT NULL DEFAULT ''",
49 "ville" => "text NOT NULL DEFAULT ''",
50 "code_postal" => "varchar(255) NOT NULL DEFAULT ''"
53 "PRIMARY KEY" => "id_gis",
55 'principale' => 'oui',
56 'modeles' => array('carte_gis', 'carte_gis_preview'),
58 /* Le titre, la date et la gestion du statut */
59 'titre' => "titre, '' AS lang",
61 /* L'édition, l'affichage et la recherche */
64 'url_edit' => 'gis_edit',
66 'champs_editables' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'pays'),
67 /*'champs_editables' => array(), */
68 'icone_objet' => 'gis',
69 'rechercher_champs' => array(
78 /* Les textes standard */
79 'texte_ajouter' => 'gis:texte_ajouter_gis',
80 'texte_retour' => 'icone_retour',
81 'texte_modifier' => 'gis:texte_modifier_gis',
82 'texte_creer' => 'gis:texte_creer_gis',
83 'texte_creer_associer' => 'gis:texte_creer_associer_gis',
84 'texte_objet' => 'gis:gis_singulier',
85 'texte_objets' => 'gis:gis_pluriel',
86 'info_aucun_objet' => 'gis:info_aucun_gis',
87 'info_1_objet' => 'gis:info_1_gis',
88 'info_nb_objets' => 'gis:info_nb_gis',
89 'texte_logo_objet' => 'gis:libelle_logo_gis',
92 $spip_gis_liens = array(
93 "id_gis" => "bigint(21) NOT NULL",
94 "objet" => "VARCHAR (25) DEFAULT '' NOT NULL",
95 "id_objet" => "bigint(21) NOT NULL");
97 $spip_gis_liens_key = array(
98 "PRIMARY KEY" => "id_gis,id_objet,objet",
99 "KEY id_objet" => "id_gis");
101 $tables_auxiliaires['spip_gis_liens'] = array(
102 'field' => &$spip_gis_liens,
103 'key' => &$spip_gis_liens_key);
108 function gis_declarer_tables_auxiliaires($tables_auxiliaires){
109 $spip_gis_liens = array(
110 "id_gis" => "bigint(21) NOT NULL",
111 "objet" => "VARCHAR (25) DEFAULT '' NOT NULL",
112 "id_objet" => "bigint(21) NOT NULL");
114 $spip_gis_liens_key = array(
115 "PRIMARY KEY" => "id_gis,id_objet,objet",
116 "KEY id_objet" => "id_gis");
118 $tables_auxiliaires['spip_gis_liens'] = array(
119 'field' => &$spip_gis_liens,
120 'key' => &$spip_gis_liens_key);
122 return $tables_auxiliaires;