1 | <?php |
---|
2 | /** |
---|
3 | * Plugin Contacts & Organisations pour Spip 2.0 |
---|
4 | * Licence GPL (c) 2009 - 2010 - Ateliers CYM |
---|
5 | */ |
---|
6 | |
---|
7 | |
---|
8 | /** |
---|
9 | * Affichage du formulaire de choix Contact/Organisation |
---|
10 | * dans la colonne de vue d'un auteur |
---|
11 | **/ |
---|
12 | function contacts_affiche_gauche($flux){ |
---|
13 | if ($flux['args']['exec'] == 'auteur_infos'){ |
---|
14 | $flux['data'] .= recuperer_fond('prive/boite/selecteur_contacts_organisations', array( |
---|
15 | 'id_auteur'=>$flux['args']['id_auteur'] |
---|
16 | ), array('ajax'=>true)); |
---|
17 | } |
---|
18 | return $flux; |
---|
19 | } |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | /** |
---|
26 | * |
---|
27 | * Insertion dans la vue des auteurs |
---|
28 | * des informations relatives aux contacts et organisations |
---|
29 | */ |
---|
30 | function contacts_affiche_milieu($flux){ |
---|
31 | if ($flux['args']['exec'] == 'auteur_infos') { |
---|
32 | $data = recuperer_fond('prive/contenu/contact', |
---|
33 | array('id_auteur' => $flux['args']['id_auteur'], 'cadre'=>'oui')); |
---|
34 | $data .= recuperer_fond('prive/contenu/organisation', |
---|
35 | array('id_auteur' => $flux['args']['id_auteur'], 'cadre'=>'oui')); |
---|
36 | $flux['data'] = $data . $flux['data']; |
---|
37 | } |
---|
38 | return $flux; |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | /** |
---|
43 | * Prendre en compte les tables dans la recherche d'éléments. |
---|
44 | * |
---|
45 | * @param |
---|
46 | * @return |
---|
47 | **/ |
---|
48 | function contacts_rechercher_liste_des_champs($tables){ |
---|
49 | |
---|
50 | // ajouter la recherche sur contact |
---|
51 | $tables['contact']['id_contact'] = 12; |
---|
52 | $tables['contact']['nom'] = 4; |
---|
53 | $tables['contact']['prenom'] = 2; |
---|
54 | |
---|
55 | // ajouter la recherche sur organisations |
---|
56 | $tables['organisation']['id_auteur'] = 12; |
---|
57 | $tables['organisation']['nom'] = 4; |
---|
58 | |
---|
59 | return $tables; |
---|
60 | } |
---|
61 | |
---|
62 | |
---|
63 | /** |
---|
64 | * Autoriser les champs extras sur les objets |
---|
65 | * Contacs et Organisations |
---|
66 | **/ |
---|
67 | function contacts_objets_extensibles($objets){ |
---|
68 | return array_merge($objets, array( |
---|
69 | 'contact' => _T('contacts:contacts'), |
---|
70 | 'organisation' => _T('contacts:organisations'), |
---|
71 | )); |
---|
72 | } |
---|
73 | |
---|
74 | /** |
---|
75 | * Ajoute une feuille de style pour la v-card |
---|
76 | * Peut être surchargé ensuite |
---|
77 | **/ |
---|
78 | function contacts_insert_head($flux){ |
---|
79 | |
---|
80 | $flux .= '<!-- insertion de la css contacts--><link rel="stylesheet" type="text/css" href="'.find_in_path('contacts.css').'" media="all" />'; |
---|
81 | |
---|
82 | return $flux; |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | ?> |
---|