1 | <?php |
---|
2 | |
---|
3 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
4 | |
---|
5 | function boussole_declarer_tables_principales($tables_principales) { |
---|
6 | |
---|
7 | // Tables des boussoles : spip_boussoles |
---|
8 | $boussoles = array( |
---|
9 | "id_site" => "bigint(21) NOT NULL", |
---|
10 | "id_syndic" => "bigint(21) DEFAULT 0 NOT NULL", |
---|
11 | "aka_boussole" => "varchar(32) DEFAULT '' NOT NULL", |
---|
12 | "aka_site" => "varchar(32) DEFAULT '' NOT NULL", |
---|
13 | "url_site" => "varchar(255) DEFAULT '' NOT NULL", |
---|
14 | "aka_groupe" => "varchar(32) DEFAULT '' NOT NULL", |
---|
15 | "rang_groupe" => "integer DEFAULT 0 NOT NULL", |
---|
16 | "rang_site" => "integer DEFAULT 0 NOT NULL", |
---|
17 | "affiche" => "varchar(3) DEFAULT '' NOT NULL", |
---|
18 | "maj" => "timestamp"); |
---|
19 | |
---|
20 | $boussoles_key = array( |
---|
21 | "PRIMARY KEY" => "id_site" |
---|
22 | ); |
---|
23 | |
---|
24 | $tables_principales['spip_boussoles'] = |
---|
25 | array('field' => &$boussoles, 'key' => &$boussoles_key); |
---|
26 | |
---|
27 | // Tables des informations logos et traductions pour les boussoles : spip_boussoles_extras |
---|
28 | $boussoles_extras = array( |
---|
29 | "aka_boussole" => "varchar(32) DEFAULT '' NOT NULL", |
---|
30 | "type_objet" => "varchar(8) DEFAULT '' NOT NULL", |
---|
31 | "aka_objet" => "varchar(32) DEFAULT '' NOT NULL", |
---|
32 | "nom_objet" => "text DEFAULT '' NOT NULL", |
---|
33 | "slogan_objet" => "text DEFAULT '' NOT NULL", |
---|
34 | "descriptif_objet" => "text DEFAULT '' NOT NULL", |
---|
35 | "logo_objet" => "varchar(255) DEFAULT '' NOT NULL", // Attention à utiliser avec #CHAMP_SQL{logo_objet} |
---|
36 | "maj" => "timestamp"); |
---|
37 | |
---|
38 | $boussoles_extras_key = array( |
---|
39 | "PRIMARY KEY" => "aka_boussole, type_objet, aka_objet" |
---|
40 | ); |
---|
41 | |
---|
42 | $tables_principales['spip_boussoles_extras'] = |
---|
43 | array('field' => &$boussoles_extras, 'key' => &$boussoles_extras_key); |
---|
44 | |
---|
45 | return $tables_principales; |
---|
46 | } |
---|
47 | |
---|
48 | |
---|
49 | function boussole_declarer_tables_interfaces($interface) { |
---|
50 | // Les tables |
---|
51 | $interface['table_des_tables']['boussoles'] = 'boussoles'; |
---|
52 | $interface['table_des_tables']['boussoles_extras'] = 'boussoles_extras'; |
---|
53 | |
---|
54 | // Les traitements |
---|
55 | $interface['table_des_traitements']['URL_SITE']['boussoles']= 'safehtml(vider_url(%s))'; |
---|
56 | $interface['table_des_traitements']['SLOGAN']['boussoles_extras'] = _TRAITEMENT_RACCOURCIS; |
---|
57 | $interface['table_des_traitements']['DESCRIPTION']['boussoles_extras'] = _TRAITEMENT_RACCOURCIS; |
---|
58 | |
---|
59 | return $interface; |
---|
60 | } |
---|
61 | |
---|
62 | ?> |
---|