| | 15 | // ---------- 3/3 - Declatation des interfaces, modalites d'utilisation des tables |
| | 16 | |
| | 17 | function vu_declarer_tables_interfaces($interface){ |
| | 18 | |
| | 19 | // Definir le nom des nouvelles boucles |
| | 20 | // La table ['vu_*'] aura en fait pour nom 'vu_*' |
| | 21 | $interface['table_des_tables']['vu_annonces']= 'vu_annonces'; |
| | 22 | $interface['table_des_tables']['vu_evenements'] = 'vu_evenements'; |
| | 23 | $interface['table_des_tables']['vu_publications'] = 'vu_publications'; |
| | 24 | |
| | 25 | // Indiquer les jointures possibles |
| | 26 | // de tables vu_* vers mots_vu_* : sur le champ id_* |
| | 27 | $interface['tables_jointures']['spip_vu_annonces']['id_annonce'] = 'mots_vu_annonces'; |
| | 28 | $interface['tables_jointures']['spip_vu_evenements']['id_evenement'] = 'mots_vu_evenements'; |
| | 29 | $interface['tables_jointures']['spip_vu_publications']['id_publication'] = 'mots_vu_publications'; |
| | 30 | |
| | 31 | // de tables mots_vu_* vers vu_* : sur le champ id_* |
| | 32 | $interface['tables_jointures']['spip_mots_vu_annonces']['id_annonce'] = 'vu_annonces'; |
| | 33 | $interface['tables_jointures']['spip_mots_vu_evenements']['id_evenement'] = 'vu_evenements'; |
| | 34 | $interface['tables_jointures']['spip_mots_vu_publications']['id_publication'] = 'vu_publications'; |
| | 35 | |
| | 36 | // de spip_mots vers mots_vu_* : sur le champ id_mot |
| | 37 | $interface['tables_jointures']['spip_mots']['id_mot'] = 'spip_mots_vu_annonces'; |
| | 38 | $interface['tables_jointures']['spip_mots']['id_mot'] = 'spip_mots_vu_evenements'; |
| | 39 | $interface['tables_jointures']['spip_mots']['id_mot'] = 'spip_mots_vu_publications'; |
| | 40 | |
| | 41 | // de vu_*_mots vers spip_mots : sur le champ id_mot |
| | 42 | $interface['tables_jointures']['spip_mots_vu_annonces']['id_mot'] = 'spip_mots'; |
| | 43 | $interface['tables_jointures']['spip_mots_vu_evenements']['id_mot'] = 'spip_mots'; |
| | 44 | $interface['tables_jointures']['spip_mots_vu_publications']['id_mot'] = 'spip_mots'; |
| | 45 | |
| | 46 | // Titre pour url |
| | 47 | $interface['table_titre']['spip_vu_annonces'] = "titre, '' AS lang"; |
| | 48 | $interface['table_titre']['spip_vu_evenements'] = "titre, '' AS lang"; |
| | 49 | $interface['table_titre']['spip_vu_publications'] = "titre, '' AS lang"; |
| | 50 | |
| | 51 | // On definit les traitements par défaut sur les champs qui le necessitent |
| | 52 | //$interface['table_des_traitements']['MON_CHAMPS'][]= 'ma_fonction(%s)'; |
| | 53 | $interfaces['PEREMPTION'][]= 'normaliser_date(%s)'; |
| | 54 | $interfaces['DATE_EVENEMENT'][]= 'normaliser_date(%s)'; |
| | 55 | $interfaces['DATE_PUBLICATION'][]= 'normaliser_date(%s)'; |
| | 56 | |
| | 57 | // On indique les champs 'date' pour accelerer les requetes SQL |
| | 58 | // Autorise l'utilisation des criteres 'age' et 'age_relatif' sur les nouveaux objets |
| | 59 | $interface['table_date']['vu_annonces'] = 'peremption'; |
| | 60 | $interface['table_date']['vu_annonces'] = 'date'; |
| | 61 | |
| | 62 | $interface['table_date']['vu_evenements'] = 'date_evenement'; |
| | 63 | $interface['table_date']['vu_evenements'] = 'date'; |
| | 64 | |
| | 65 | $interface['table_date']['vu_publications'] = 'date_publication'; |
| | 66 | $interface['table_date']['vu_publications'] = 'date'; |
| | 67 | |
| | 68 | return $interface; |
| 163 | | // ---------- 3/3 - Declatation des interfaces, modalites d'utilisation des tables |
| 164 | | |
| 165 | | function vu_declarer_tables_interfaces($interface){ |
| 166 | | |
| 167 | | // Definir le nom des nouvelles boucles |
| 168 | | // La table ['vu_*'] aura en fait pour nom 'vu_*' |
| 169 | | $interface['table_des_tables']['vu_annonces']= 'vu_annonces'; |
| 170 | | $interface['table_des_tables']['vu_evenements'] = 'vu_evenements'; |
| 171 | | $interface['table_des_tables']['vu_publications'] = 'vu_publications'; |
| 172 | | |
| 173 | | // Indiquer les jointures possibles |
| 174 | | // de tables vu_* vers mots_vu_* : sur le champ id_* |
| 175 | | $interface['tables_jointures']['spip_vu_annonces']['id_annonce'] = 'mots_vu_annonces'; |
| 176 | | $interface['tables_jointures']['spip_vu_evenements']['id_evenement'] = 'mots_vu_evenements'; |
| 177 | | $interface['tables_jointures']['spip_vu_publications']['id_publication'] = 'mots_vu_publications'; |
| 178 | | |
| 179 | | // de tables mots_vu_* vers vu_* : sur le champ id_* |
| 180 | | $interface['tables_jointures']['spip_mots_vu_annonces']['id_annonce'] = 'vu_annonces'; |
| 181 | | $interface['tables_jointures']['spip_mots_vu_evenements']['id_evenement'] = 'vu_evenements'; |
| 182 | | $interface['tables_jointures']['spip_mots_vu_publications']['id_publication'] = 'vu_publications'; |
| 183 | | |
| 184 | | // de spip_mots vers mots_vu_* : sur le champ id_mot |
| 185 | | $interface['tables_jointures']['spip_mots']['id_mot'] = 'spip_mots_vu_annonces'; |
| 186 | | $interface['tables_jointures']['spip_mots']['id_mot'] = 'spip_mots_vu_evenements'; |
| 187 | | $interface['tables_jointures']['spip_mots']['id_mot'] = 'spip_mots_vu_publications'; |
| 188 | | |
| 189 | | // de vu_*_mots vers spip_mots : sur le champ id_mot |
| 190 | | $interface['tables_jointures']['spip_mots_vu_annonces']['id_mot'] = 'spip_mots'; |
| 191 | | $interface['tables_jointures']['spip_mots_vu_evenements']['id_mot'] = 'spip_mots'; |
| 192 | | $interface['tables_jointures']['spip_mots_vu_publications']['id_mot'] = 'spip_mots'; |
| 193 | | |
| 194 | | // Titre pour url |
| 195 | | $interface['table_titre']['spip_vu_annonces'] = "titre, '' AS lang"; |
| 196 | | $interface['table_titre']['spip_vu_evenements'] = "titre, '' AS lang"; |
| 197 | | $interface['table_titre']['spip_vu_publications'] = "titre, '' AS lang"; |
| 198 | | |
| 199 | | // On definit les traitements par défaut sur les champs qui le necessitent |
| 200 | | //$interface['table_des_traitements']['MON_CHAMPS'][]= 'ma_fonction(%s)'; |
| 201 | | |
| 202 | | // On indique les champs 'date' pour accelerer les requetes SQL |
| 203 | | $interface['table_date']['spip_vu_annonces'] = 'peremption'; |
| 204 | | $interface['table_date']['spip_vu_annonces'] = 'date'; |
| 205 | | |
| 206 | | $interface['table_date']['spip_vu_evenement'] = 'date_evenement'; |
| 207 | | $interface['table_date']['spip_vu_evenement'] = 'date'; |
| 208 | | |
| 209 | | $interface['table_date']['spip_vu_publications'] = 'date_publication'; |
| 210 | | $interface['table_date']['spip_vu_publications'] = 'date'; |
| 211 | | |
| 212 | | return $interface; |