|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +use YesWiki\Bazar\Controller\EntryController; |
3 | 4 | use YesWiki\Core\YesWikiAction; |
4 | 5 |
|
5 | 6 | class BazarCartoAction extends YesWikiAction |
@@ -39,14 +40,25 @@ public function formatArguments($arg) |
39 | 40 | $template = (!$dynamic) ? |
40 | 41 | ($arg['template'] ?? 'map.tpl.html') : |
41 | 42 | ($arg['template'] ?? 'map'); |
42 | | - if (strpos($template, 'gogomap') !== false) $template = 'gogocarto'; |
| 43 | + if (strpos($template, 'gogomap') !== false) { |
| 44 | + $template = 'gogocarto'; |
| 45 | + } |
43 | 46 | $spider = (!$dynamic) ? |
44 | 47 | ($arg['spider'] ?? 'false') : |
45 | 48 | $this->formatBoolean($arg, false, 'spider'); |
46 | 49 | $cluster = (!$dynamic) ? |
47 | 50 | ($arg['cluster'] ?? 'false') : |
48 | 51 | $this->formatBoolean($arg, false, 'cluster'); |
49 | 52 |
|
| 53 | + // Filters entries via query to remove whose withou bf_latitude nor bf_longitude |
| 54 | + $query = $this->getService(EntryController::class)->formatQuery($arg, $_GET); |
| 55 | + if (!isset($query['bf_latitude!'])) { |
| 56 | + $query['bf_latitude!'] = ""; |
| 57 | + } |
| 58 | + if (!isset($query['bf_longitude!'])) { |
| 59 | + $query['bf_longitude!'] = ""; |
| 60 | + } |
| 61 | + |
50 | 62 | return([ |
51 | 63 | /* |
52 | 64 | * Le fond de carte utilisé pour la carte |
@@ -109,7 +121,8 @@ public function formatArguments($arg) |
109 | 121 | 'template' => $template, |
110 | 122 |
|
111 | 123 | 'entrydisplay' => $arg['entrydisplay'] ?? 'sidebar', |
112 | | - 'pagination' => -1 // disable pagination |
| 124 | + 'pagination' => -1, // disable pagination |
| 125 | + 'query' => $query, |
113 | 126 | ]); |
114 | 127 | } |
115 | 128 |
|
|
0 commit comments