[PLUGINS] +acces restreint
[ptitvelo/web/www.git] / www / plugins / accesrestreint_3_5 / base / accesrestreint.php
1 <?php
2 /**
3 * Plugin Acces Restreint 3.0 pour Spip 2.0
4 * Licence GPL (c) 2006-2008 Cedric Morin
5 *
6 */
7
8
9 if (!defined("_ECRIRE_INC_VERSION")) return;
10
11 function accesrestreint_declarer_tables_interfaces($interface){
12 $interface['tables_jointures']['spip_auteurs'][] = 'zones_liens';
13 $interface['tables_jointures']['spip_zones'][] = 'zones_liens';
14 $interface['tables_jointures']['spip_rubriques'][] = 'zones_liens';
15
16 //-- Table des tables ----------------------------------------------------
17
18 $interface['table_des_tables']['zones']='zones';
19
20 return $interface;
21 }
22
23 function accesrestreint_declarer_tables_objets_sql($tables){
24 $tables['spip_zones'] = array(
25 'texte_modifier' => 'accesrestreint:modifier_zone',
26 'texte_creer' => 'accesrestreint:creer_zone',
27 'texte_objets' => 'accesrestreint:titre_zones_acces',
28 'texte_objet' => 'accesrestreint:titre_zone_acces',
29 'texte_ajouter' => 'accesrestreint:texte_ajouter_zone',
30 'texte_creer_associer' => 'accesrestreint:texte_creer_associer_zone',
31 'info_aucun_objet'=> 'accesrestreint:info_aucune_zone',
32 'info_1_objet' => 'accesrestreint:info_1_zone',
33 'info_nb_objets' => 'accesrestreint:info_nb_zones',
34 'url_voir' => 'zone_edit',
35 'url_edit' => 'zone_edit',
36 'page' => false,
37
38 'principale' => "oui",
39 'champs_editables' => array('titre', 'descriptif','publique', 'privee'),
40 'field'=> array(
41 "id_zone" => "bigint(21) NOT NULL",
42 "titre" => "varchar(255) DEFAULT '' NOT NULL",
43 "descriptif" => "text DEFAULT '' NOT NULL",
44 "publique" => "char(3) DEFAULT 'oui' NOT NULL",
45 "privee" => "char(3) DEFAULT 'non' NOT NULL",
46 "maj" => "TIMESTAMP"
47 ),
48 'key' => array(
49 "PRIMARY KEY" => "id_zone",
50 ),
51 'titre' => "titre AS titre, '' AS lang",
52 );
53
54 return $tables;
55 }
56
57 function accesrestreint_declarer_tables_auxiliaires($tables_auxiliaires){
58
59 $spip_zones_liens = array(
60 "id_zone" => "bigint(21) DEFAULT '0' NOT NULL",
61 "id_objet" => "bigint(21) DEFAULT '0' NOT NULL",
62 "objet" => "VARCHAR (25) DEFAULT '' NOT NULL"
63 );
64
65 $spip_zones_liens_key = array(
66 "PRIMARY KEY" => "id_zone,id_objet,objet",
67 "KEY id_zone" => "id_zone"
68 );
69
70 $tables_auxiliaires['spip_zones_liens'] = array(
71 'field' => &$spip_zones_liens,
72 'key' => &$spip_zones_liens_key
73 );
74
75 return $tables_auxiliaires;
76 }
77
78 ?>