[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / plugins-dist / sites / base / sites.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 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 /**
16 * Interfaces des tables syndic et syndic article
17 *
18 * @param array $interfaces
19 * @return array
20 */
21 function sites_declarer_tables_interfaces($interfaces){
22
23 $interfaces['table_des_tables']['sites']='syndic'; // compat pour les boucles (SITES)
24 $interfaces['table_des_tables']['syndication']='syndic';
25 $interfaces['table_des_tables']['syndic']='syndic';
26 $interfaces['table_des_tables']['syndic_articles']='syndic_articles';
27
28 # ne sert plus ? verifier balise_URL_ARTICLE
29 $interfaces['exceptions_des_tables']['syndic_articles']['url_article']='url';
30 # ne sert plus ? verifier balise_LESAUTEURS
31 $interfaces['exceptions_des_tables']['syndic_articles']['lesauteurs']='lesauteurs';
32 $interfaces['exceptions_des_tables']['syndic_articles']['url_site']=array('syndic', 'url_site');
33 $interfaces['exceptions_des_tables']['syndic_articles']['nom_site']=array('syndic', 'nom_site');
34
35 $interfaces['table_date']['syndication'] = 'date';
36
37 $interfaces['tables_jointures']['spip_syndic_articles'][]= 'syndic';
38
39 $interfaces['table_des_traitements']['NOM_SITE'][]= _TRAITEMENT_TYPO;
40
41 // Articles syndiques : passage des donnees telles quelles, sans traitement typo
42 // la securite et conformite XHTML de ces champs est assuree par safehtml()
43 foreach(array('DESCRIPTIF','SOURCE','URL','URL_SOURCE','LESAUTEURS','TAGS') as $balise)
44 if (!isset($interfaces['table_des_traitements'][$balise]['syndic_articles']))
45 $interfaces['table_des_traitements'][$balise]['syndic_articles'] = 'safehtml(%s)';
46 else
47 if (strpos($interfaces['table_des_traitements'][$balise]['syndic_articles'],'safehtml')==false)
48 $interfaces['table_des_traitements'][$balise]['syndic_articles'] = 'safehtml('.$interfaces['table_des_traitements'][$balise]['syndic_articles'].')';
49
50 return $interfaces;
51 }
52
53
54 function sites_declarer_tables_objets_sql($tables){
55 $tables['spip_syndic'] = array(
56 'table_objet_surnoms'=>array('site'),
57 'type'=>'site',
58 'type_surnoms' => array('syndic'),
59
60 'texte_retour' => 'icone_retour',
61 'texte_objets' => 'icone_sites_references',
62 'texte_objet' => 'sites:icone_site_reference',
63 'texte_modifier' => 'sites:icone_modifier_site',
64 'texte_creer' => 'sites:icone_referencer_nouveau_site',
65 'info_aucun_objet'=> 'info_aucun_site',
66 'info_1_objet' => 'info_1_site',
67 'info_nb_objets' => 'info_nb_sites',
68 'titre' => "nom_site AS titre, '' AS lang",
69 'date' => 'date',
70 'principale' => 'oui',
71 'field'=> array(
72 "id_syndic" => "bigint(21) NOT NULL",
73 "id_rubrique" => "bigint(21) DEFAULT '0' NOT NULL",
74 "id_secteur" => "bigint(21) DEFAULT '0' NOT NULL",
75 "nom_site" => "text DEFAULT '' NOT NULL",
76 "url_site" => "text DEFAULT '' NOT NULL",
77 "url_syndic" => "text DEFAULT '' NOT NULL",
78 "descriptif" => "text DEFAULT '' NOT NULL",
79 "maj" => "TIMESTAMP",
80 "syndication" => "VARCHAR(3) DEFAULT '' NOT NULL",
81 "statut" => "varchar(10) DEFAULT '0' NOT NULL",
82 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
83 "date_syndic" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
84 "date_index" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
85 "moderation" => "VARCHAR(3) DEFAULT 'non'",
86 "miroir" => "VARCHAR(3) DEFAULT 'non'",
87 "oubli" => "VARCHAR(3) DEFAULT 'non'",
88 "resume" => "VARCHAR(3) DEFAULT 'oui'"
89 ),
90 'key' => array(
91 "PRIMARY KEY" => "id_syndic",
92 "KEY id_rubrique" => "id_rubrique",
93 "KEY id_secteur" => "id_secteur",
94 "KEY statut" => "statut, date_syndic",
95 ),
96 'join' => array(
97 "id_syndic"=>"id_syndic",
98 "id_rubrique"=>"id_rubrique"
99 ),
100 'statut' => array(
101 array('champ'=>'statut','publie'=>'publie','previsu'=>'publie,prop','exception'=>'statut')
102 ),
103 'texte_changer_statut' => 'sites:info_statut_site_1',
104 'statut_textes_instituer' => array(
105 'prop' => 'texte_statut_propose_evaluation',
106 'publie' => 'texte_statut_publie',
107 'refuse' => 'texte_statut_poubelle',
108 ),
109
110 'rechercher_champs' => array(
111 'nom_site' => 5, 'url_site' => 1, 'descriptif' => 3
112 ),
113 'champs_versionnes' => array('id_rubrique', 'id_secteur', 'nom_site', 'url_site', 'url_syndic','descriptif'),
114 );
115
116 $tables['spip_syndic_articles'] = array(
117 'table_objet_surnoms'=>array('syndic_article'),
118
119 'texte_retour' => 'icone_retour',
120 'texte_objets' => 'sites:icone_articles_syndic',
121 'texte_objet' => 'sites:icone_article_syndic',
122 'texte_modifier' => 'icone_modifier_article', # inutile en vrai
123 'info_aucun_objet'=> 'info_aucun_article_syndique',
124 'info_1_objet' => 'info_1_article_syndique',
125 'info_nb_objets' => 'info_nb_articles_syndiques',
126 'icone_objet' => 'site',
127
128 // pas de page propre ni dans ecrire ni dans le site public
129 'url_voir'=>'',
130 'url_edit'=>'',
131 'page'=>'',
132
133 'date' => 'date',
134 'editable' => 'non',
135 'principale' => 'oui',
136 'field'=> array(
137 "id_syndic_article" => "bigint(21) NOT NULL",
138 "id_syndic" => "bigint(21) DEFAULT '0' NOT NULL",
139 "titre" => "text DEFAULT '' NOT NULL",
140 "url" => "VARCHAR(255) DEFAULT '' NOT NULL",
141 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
142 "lesauteurs" => "text DEFAULT '' NOT NULL",
143 "maj" => "TIMESTAMP",
144 "statut" => "varchar(10) DEFAULT '0' NOT NULL",
145 "descriptif" => "text DEFAULT '' NOT NULL",
146 "lang" => "VARCHAR(10) DEFAULT '' NOT NULL",
147 "url_source" => "TINYTEXT DEFAULT '' NOT NULL",
148 "source" => "TINYTEXT DEFAULT '' NOT NULL",
149 "tags" => "TEXT DEFAULT '' NOT NULL"
150 ),
151 'key' => array(
152 "PRIMARY KEY" => "id_syndic_article",
153 "KEY id_syndic" => "id_syndic",
154 "KEY statut" => "statut",
155 "KEY url" => "url"
156 ),
157 'join' => array(
158 "id_syndic_article"=>"id_syndic_article",
159 "id_syndic"=>"id_syndic"
160 ),
161 'statut' => array(
162 array('champ'=>'statut','publie'=>'publie','previsu'=>'publie,prop','exception'=>'statut'),
163 array('champ'=>array(array('spip_syndic','id_syndic'),'statut'),'publie'=>'publie','previsu'=>'publie,prop','exception'=>'statut'),
164 ),
165 'statut_images' => array(
166 'puce-rouge-anim.gif','publie'=>'puce-publier-8.png','refuse'=>'puce-supprimer-8.png','dispo'=>'puce-proposer-8.png','off'=>'puce-refuser-8.png',
167 ),
168 'rechercher_champs' => array(
169 'titre' => 5, 'descriptif' => 1
170 )
171 );
172
173 return $tables;
174 }
175
176 ?>