Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | if (!defined('_ECRIRE_INC_VERSION')) return; |
---|
4 | |
---|
5 | /** |
---|
6 | * Insertion des css du plugin dans les pages publiques |
---|
7 | * |
---|
8 | * @param $flux |
---|
9 | * @return mixed |
---|
10 | */ |
---|
11 | function gisban_insert_head_css($flux) { |
---|
12 | $flux .="\n".'<link rel="stylesheet" href="'. find_in_path('lib/leaflet.photon/leaflet.photon.css') .'" />'; |
---|
13 | $flux .="\n".'<link rel="stylesheet" href="'. find_in_path('css/photon_search_gis.css') .'" />'; |
---|
14 | return $flux; |
---|
15 | } |
---|
16 | |
---|
17 | /** |
---|
18 | * Insertion des scripts et css du plugin dans les pages de l'espace privé |
---|
19 | * |
---|
20 | * @param $flux |
---|
21 | * @return mixed |
---|
22 | */ |
---|
23 | function gisban_header_prive($flux) { |
---|
24 | $flux .= gisban_insert_head_css(''); |
---|
25 | return $flux; |
---|
26 | } |
---|
27 | |
---|
28 | |
---|
29 | /** |
---|
30 | * Ajouter le module leaflet.photon.js dans les javascripts chargés |
---|
31 | * |
---|
32 | * @param $flux |
---|
33 | * @return mixed |
---|
34 | */ |
---|
35 | function gisban_recuperer_fond($flux) { |
---|
36 | if ($flux['args']['fond'] == 'modeles/carte_gis') { |
---|
37 | $modele = recuperer_fond('inclure/inc-carte-gisban', $flux['data']['contexte']); |
---|
38 | $flux['data']['texte'] .= "\n" . $modele; |
---|
39 | } |
---|
40 | if ($flux['args']['fond'] == 'javascript/gis.js') { |
---|
41 | $ajouts = "var filter_gisban = '". lire_config('gisban/filtre_gisban') ."';\n"; |
---|
42 | $ajouts .= "\n" . spip_file_get_contents(find_in_path('lib/leaflet.photon/leaflet.photon.js')); |
---|
43 | $flux['data']['texte'] .= $ajouts; |
---|
44 | } |
---|
45 | return $flux; |
---|
46 | } |
---|
47 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.