-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlocation_pipelines.php
75 lines (60 loc) · 1.7 KB
/
location_pipelines.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* Utilisations de pipelines par Location
*
* @plugin Location
* @copyright 2013
* @author Rainer Müller
* @licence GNU/GPL
* @package SPIP\Location\Pipelines
*/
if (!defined('_ECRIRE_INC_VERSION')) return;
/**
* Ajout de contenu sur certaines pages,
* notamment des formulaires de liaisons entre objets
*
* @pipeline affiche_milieu
* @param array $flux Données du pipeline
* @return array Données du pipeline
*/
function location_affiche_milieu($flux) {
$texte = "";
$e = trouver_objet_exec($flux['args']['exec']);
// auteurs sur les locations
if (!$e['edition'] AND in_array($e['type'], array('location'))) {
$texte .= recuperer_fond('prive/objets/editer/liens', array(
'table_source' => 'auteurs',
'objet' => $e['type'],
'id_objet' => $flux['args'][$e['id_table_objet']]
));
}
if ($texte) {
if ($p=strpos($flux['data'],"<!--affiche_milieu-->"))
$flux['data'] = substr_replace($flux['data'],$texte,$p,0);
else
$flux['data'] .= $texte;
}
return $flux;
}
/**
* Ajout de liste sur la vue d'un auteur
*
* @pipeline affiche_auteurs_interventions
* @param array $flux Données du pipeline
* @return array Données du pipeline
*/
function location_affiche_auteurs_interventions($flux) {
if ($id_auteur = intval($flux['args']['id_auteur'])) {
$flux['data'] .= recuperer_fond('prive/objets/liste/locations', array(
'id_auteur' => $id_auteur,
'par'=>'date_debut',
'titre' => _T('location:info_locations_auteur')
), array('ajax' => true));
}
return $flux;
}
function location_header_prive($flux){
$flux .= "<link rel='stylesheet' href='".find_in_path('css/location.css')."' type='text/css'/>\n";
return $flux;
}
?>