1 | <?php |
---|
2 | |
---|
3 | // Sécurité |
---|
4 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
5 | |
---|
6 | function zotspip_declarer_tables_interfaces($interface){ |
---|
7 | // 'spip_' dans l'index de $tables_principales |
---|
8 | $interface['table_des_tables']['zitems']='zitems'; |
---|
9 | $interface['table_des_tables']['zcollections']='zcollections'; |
---|
10 | $interface['table_des_tables']['ztags']='ztags'; |
---|
11 | $interface['table_des_tables']['zcreators']='zcreators'; |
---|
12 | |
---|
13 | //-- Jointures ---------------------------------------------------- |
---|
14 | $interface['tables_jointures']['spip_zitems'][]= 'ztags'; |
---|
15 | $interface['tables_jointures']['spip_zitems'][]= 'zcreators'; |
---|
16 | $interface['tables_jointures']['spip_zitems'][]= 'zitems_zcollections'; |
---|
17 | $interface['tables_jointures']['spip_zcollections'][]= 'zitems_zcollections'; |
---|
18 | $interface['tables_jointures']['spip_ztags'][]= 'zitems'; |
---|
19 | $interface['tables_jointures']['spip_zcreators'][]= 'zitems'; |
---|
20 | |
---|
21 | return $interface; |
---|
22 | } |
---|
23 | |
---|
24 | function zotspip_declarer_tables_principales($tables_principales){ |
---|
25 | //-- Table zitems ----------------------------------------------------------- |
---|
26 | $zitems = array( |
---|
27 | "id_zitem" => "varchar(16) DEFAULT '' NOT NULL", |
---|
28 | "id_parent" => "varchar(16) DEFAULT '' NOT NULL", |
---|
29 | "type_ref" => "varchar(255) DEFAULT '' NOT NULL", |
---|
30 | "annee" => "smallint(6)", |
---|
31 | "titre" => "text DEFAULT '' NOT NULL", |
---|
32 | "auteurs" => "text DEFAULT '' NOT NULL", |
---|
33 | "resume" => "mediumtext DEFAULT '' NOT NULL", |
---|
34 | "date" => "varchar(255) DEFAULT '' NOT NULL", |
---|
35 | "pages" => "varchar(255) DEFAULT '' NOT NULL", |
---|
36 | "publication" => "text DEFAULT '' NOT NULL", |
---|
37 | "editeur" => "text DEFAULT '' NOT NULL", |
---|
38 | "collection" => "varchar(255) DEFAULT '' NOT NULL", |
---|
39 | "conference" => "text DEFAULT '' NOT NULL", |
---|
40 | "type_doc" => "text DEFAULT '' NOT NULL", |
---|
41 | "volume" => "varchar(255) DEFAULT '' NOT NULL", |
---|
42 | "numero" => "varchar(255) DEFAULT '' NOT NULL", |
---|
43 | "doi" => "varchar(255) DEFAULT '' NOT NULL", |
---|
44 | "isbn" => "varchar(255) DEFAULT '' NOT NULL", |
---|
45 | "issn" => "varchar(255) DEFAULT '' NOT NULL", |
---|
46 | "url" => "text DEFAULT '' NOT NULL", |
---|
47 | "extras" => "text DEFAULT '' NOT NULL", |
---|
48 | "mimetype" => "varchar(255) DEFAULT '' NOT NULL", |
---|
49 | "poids" => "bigint", |
---|
50 | "fichier" => "text DEFAULT '' NOT NULL", |
---|
51 | "json" => "mediumtext DEFAULT '' NOT NULL", |
---|
52 | "csljson" => "mediumtext DEFAULT '' NOT NULL", |
---|
53 | "updated" => "varchar(50) DEFAULT '' NOT NULL", |
---|
54 | "date_ajout"=> "varchar(50) DEFAULT '' NOT NULL" |
---|
55 | ); |
---|
56 | |
---|
57 | $zitems_cles = array( |
---|
58 | "PRIMARY KEY" => "id_zitem", |
---|
59 | "KEY id_parent" => "id_parent" |
---|
60 | ); |
---|
61 | |
---|
62 | $tables_principales['spip_zitems'] = array( |
---|
63 | 'field' => &$zitems, |
---|
64 | 'key' => &$zitems_cles |
---|
65 | ); |
---|
66 | |
---|
67 | //-- Table zcollections ----------------------------------------------------------- |
---|
68 | $zcollections = array( |
---|
69 | "id_zcollection" => "varchar(16) DEFAULT '' NOT NULL", |
---|
70 | "id_parent" => "varchar(16) DEFAULT '' NOT NULL", |
---|
71 | "zcollection" => "text DEFAULT '' NOT NULL", |
---|
72 | "updated" => "varchar(50) DEFAULT '' NOT NULL" |
---|
73 | ); |
---|
74 | |
---|
75 | $zcollections_cles = array( |
---|
76 | "PRIMARY KEY" => "id_zcollection", |
---|
77 | "KEY id_parent" => "id_parent" |
---|
78 | ); |
---|
79 | |
---|
80 | $tables_principales['spip_zcollections'] = array( |
---|
81 | 'field' => &$zcollections, |
---|
82 | 'key' => &$zcollections_cles |
---|
83 | ); |
---|
84 | |
---|
85 | //-- Table zcreators ----------------------------------------------------------- |
---|
86 | $zcreators = array( |
---|
87 | "auteur" => "varchar(150) DEFAULT '' NOT NULL", |
---|
88 | "id_zitem" => "varchar(16) DEFAULT '' NOT NULL", |
---|
89 | "role" => "varchar(30) DEFAULT '' NOT NULL", |
---|
90 | "rang" => "smallint DEFAULT '1' NOT NULL" |
---|
91 | ); |
---|
92 | |
---|
93 | $zcreators_cles = array( |
---|
94 | "PRIMARY KEY" => "auteur, id_zitem, role", |
---|
95 | "KEY auteur" => "auteur" |
---|
96 | ); |
---|
97 | |
---|
98 | $tables_principales['spip_zcreators'] = array( |
---|
99 | 'field' => &$zcreators, |
---|
100 | 'key' => &$zcreators_cles |
---|
101 | ); |
---|
102 | |
---|
103 | //-- Table ztags ----------------------------------------------------------- |
---|
104 | $ztags = array( |
---|
105 | "tag" => "varchar(255) DEFAULT '' NOT NULL", |
---|
106 | "id_zitem" => "varchar(16) DEFAULT '' NOT NULL" |
---|
107 | ); |
---|
108 | |
---|
109 | $ztags_cles = array( |
---|
110 | "PRIMARY KEY" => "tag, id_zitem", |
---|
111 | "KEY tag" => "tag" |
---|
112 | ); |
---|
113 | |
---|
114 | $tables_principales['spip_ztags'] = array( |
---|
115 | 'field' => &$ztags, |
---|
116 | 'key' => &$ztags_cles |
---|
117 | ); |
---|
118 | |
---|
119 | return $tables_principales; |
---|
120 | } |
---|
121 | |
---|
122 | function zotspip_declarer_tables_auxiliaires($tables_auxiliaires){ |
---|
123 | //-- Table zitems_zcollections ----------------------------------------------------------- |
---|
124 | $zitems_zcollections = array( |
---|
125 | "id_zitem" => "varchar(16) DEFAULT '' NOT NULL", |
---|
126 | "id_zcollection" => "varchar(16) DEFAULT '' NOT NULL" |
---|
127 | ); |
---|
128 | |
---|
129 | $zitems_zcollections_cles = array( |
---|
130 | "PRIMARY KEY" => "id_zitem, id_zcollection", |
---|
131 | "KEY id_zcollection" => "id_zcollection" |
---|
132 | ); |
---|
133 | |
---|
134 | $tables_auxiliaires['spip_zitems_zcollections'] = array( |
---|
135 | 'field' => &$zitems_zcollections, |
---|
136 | 'key' => &$zitems_zcollections_cles |
---|
137 | ); |
---|
138 | |
---|
139 | return $tables_auxiliaires; |
---|
140 | } |
---|
141 | |
---|
142 | |
---|
143 | ?> |
---|