[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins-dist / breves / base / breves.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 /**
14 * Déclarations relatives à la base de données
15 *
16 * @package SPIP\Breves\Pipelines
17 **/
18
19 if (!defined('_ECRIRE_INC_VERSION')) {
20 return;
21 }
22
23 /**
24 * Déclare les alias de boucle et traitements automatiques de certaines balises
25 *
26 * @pipeline declarer_tables_interfaces
27 * @param array $interfaces
28 * Déclarations d'interface pour le compilateur
29 * @return array
30 * Déclarations d'interface pour le compilateur
31 */
32 function breves_declarer_tables_interfaces($interfaces) {
33 $interfaces['table_des_tables']['breves'] = 'breves';
34
35 $interfaces['exceptions_des_tables']['breves']['id_secteur'] = 'id_rubrique';
36 $interfaces['exceptions_des_tables']['breves']['date'] = 'date_heure';
37 $interfaces['exceptions_des_tables']['breves']['nom_site'] = 'lien_titre';
38 $interfaces['exceptions_des_tables']['breves']['url_site'] = 'lien_url';
39
40 $interfaces['table_des_traitements']['LIEN_TITRE'][] = _TRAITEMENT_TYPO;
41 $interfaces['table_des_traitements']['LIEN_URL'][] = 'vider_url(%s)';
42
43 return $interfaces;
44 }
45
46 /**
47 * Déclarer l'objet éditorial de brèves
48 *
49 * @pipeline declarer_tables_objets_sql
50 * @param array $tables
51 * Description des tables
52 * @return array
53 * Description complétée des tables
54 */
55 function breves_declarer_tables_objets_sql($tables) {
56 $tables['spip_breves'] = array(
57 'texte_retour' => 'icone_retour',
58 'texte_objets' => 'breves:breves',
59 'texte_objet' => 'breves:breve',
60 'texte_modifier' => 'breves:icone_modifier_breve',
61 'texte_creer' => 'breves:icone_nouvelle_breve',
62 'info_aucun_objet' => 'breves:info_aucun_breve',
63 'info_1_objet' => 'breves:info_1_breve',
64 'info_nb_objets' => 'breves:info_nb_breves',
65 'texte_logo_objet' => 'breves:logo_breve',
66 'texte_langue_objet' => 'breves:titre_langue_breve',
67 'titre' => 'titre, lang',
68 'date' => 'date_heure',
69 'principale' => 'oui',
70 'introduction_longueur' => '300',
71 'field' => array(
72 'id_breve' => 'bigint(21) NOT NULL',
73 'date_heure' => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
74 'titre' => "text DEFAULT '' NOT NULL",
75 'texte' => "longtext DEFAULT '' NOT NULL",
76 'lien_titre' => "text DEFAULT '' NOT NULL",
77 'lien_url' => "text DEFAULT '' NOT NULL",
78 'statut' => "varchar(6) DEFAULT '0' NOT NULL",
79 'id_rubrique' => "bigint(21) DEFAULT '0' NOT NULL",
80 'lang' => "VARCHAR(10) DEFAULT '' NOT NULL",
81 'langue_choisie' => "VARCHAR(3) DEFAULT 'non'",
82 'maj' => 'TIMESTAMP'
83 ),
84 'key' => array(
85 'PRIMARY KEY' => 'id_breve',
86 'KEY id_rubrique' => 'id_rubrique',
87 ),
88 'join' => array(
89 'id_breve' => 'id_breve',
90 'id_rubrique' => 'id_rubrique'
91 ),
92 'statut' => array(
93 array(
94 'champ' => 'statut',
95 'publie' => 'publie',
96 'previsu' => 'publie,prop',
97 'exception' => 'statut'
98 )
99 ),
100 'texte_changer_statut' => 'breves:entree_breve_publiee',
101 'aide_changer_statut' => 'brevesstatut',
102 'statut_titres' => array(
103 'prop' => 'breves:titre_breve_proposee',
104 'publie' => 'breves:titre_breve_publiee',
105 'refuse' => 'breves:titre_breve_refusee',
106 ),
107 'statut_textes_instituer' => array(
108 'prop' => 'breves:item_breve_proposee', //_T('texte_statut_propose_evaluation')
109 'publie' => 'breves:item_breve_validee', //_T('texte_statut_publie')
110 'refuse' => 'breves:item_breve_refusee', //_T('texte_statut_refuse')
111 ),
112
113 'rechercher_champs' => array(
114 'titre' => 8,
115 'texte' => 2,
116 'lien_titre' => 1,
117 'lien_url' => 1
118 ),
119 'rechercher_jointures' => array(
120 'document' => array('titre' => 2, 'descriptif' => 1)
121 ),
122 'champs_versionnes' => array('id_rubrique', 'titre', 'lien_titre', 'lien_url', 'texte'),
123 );
124
125 return $tables;
126 }