diff options
| author | Richard Cissée <ric@richard-cissee.de> | 2020-08-27 12:47:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-27 11:47:09 +0100 |
| commit | ac34be60da3ad5156d9e991e4803eec163673042 (patch) | |
| tree | 586729401da46772af8163f6f3aa03a891369cf0 /app/Http/RequestHandlers | |
| parent | 6c7933f4ca8b6fabb580c222a39dd3efd81c5271 (diff) | |
| download | webtrees-ac34be60da3ad5156d9e991e4803eec163673042.tar.gz webtrees-ac34be60da3ad5156d9e991e4803eec163673042.tar.bz2 webtrees-ac34be60da3ad5156d9e991e4803eec163673042.zip | |
Fix Geographic Data links, adjusted to webtrees changes (#3487)
Diffstat (limited to 'app/Http/RequestHandlers')
| -rw-r--r-- | app/Http/RequestHandlers/MapDataList.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/app/Http/RequestHandlers/MapDataList.php b/app/Http/RequestHandlers/MapDataList.php index 66b360c847..7e92bfdcea 100644 --- a/app/Http/RequestHandlers/MapDataList.php +++ b/app/Http/RequestHandlers/MapDataList.php @@ -24,14 +24,13 @@ use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Module\PlaceHierarchyListModule; use Fisharebest\Webtrees\Services\MapDataService; use Fisharebest\Webtrees\Services\ModuleService; +use Fisharebest\Webtrees\Services\TreeService; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Query\Expression; -use Illuminate\Support\Collection; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use stdClass; - use function array_reverse; use function redirect; use function route; @@ -49,16 +48,20 @@ class MapDataList implements RequestHandlerInterface /** @var ModuleService */ private $module_service; + /** @var TreeService */ + private $tree_service; + /** * Dependency injection. * * @param MapDataService $map_data_service * @param ModuleService $module_service */ - public function __construct(MapDataService $map_data_service, ModuleService $module_service) + public function __construct(MapDataService $map_data_service, ModuleService $module_service, TreeService $tree_service) { $this->map_data_service = $map_data_service; $this->module_service = $module_service; + $this->tree_service = $tree_service; } /** @@ -93,17 +96,18 @@ class MapDataList implements RequestHandlerInterface $breadcrumbs[route(__CLASS__)] = $title; $breadcrumbs[route(ControlPanel::class)] = I18N::translate('Control panel'); - $show_links = $this->module_service->findByInterface(PlaceHierarchyListModule::class)->isNotEmpty(); + $show_links_via_module = $this->module_service->findByInterface(PlaceHierarchyListModule::class)->first(); $this->layout = 'layouts/administration'; return $this->viewResponse('admin/locations', [ - 'active' => $this->map_data_service->activePlaces($parent), - 'breadcrumbs' => array_reverse($breadcrumbs), - 'parent_id' => $parent_id, - 'placelist' => $this->map_data_service->getPlaceListLocation($parent_id), - 'show_links' => $show_links, - 'title' => $title, + 'active' => $this->map_data_service->activePlaces($parent), + 'breadcrumbs' => array_reverse($breadcrumbs), + 'parent_id' => $parent_id, + 'placelist' => $this->map_data_service->getPlaceListLocation($parent_id), + 'show_links_via_module' => $show_links_via_module, + 'title' => $title, + 'tree_service' => $this->tree_service, ]); } |
