template->appVersion = Konstanty::verze; if (!$this->getUser()->isLoggedIn()) { $this->template->navrat = $this->storeRequest(); } } public function actionGeojson(): void { $this->getHttpResponse()->setContentType('application/json', 'utf-8'); $this->sendResponse(new TextResponse($this->obvod->getGeoJson())); } public function actionDefault(?int $obvod = null, ?string $filtr = null): void { if (!$this->getUser()->isLoggedIn() && $filtr !== null && $filtr !== 'obvody') { $this->redirect('this', ['obvod' => $obvod, 'filtr' => null]); } } public function renderDefault(?int $obvod = null, ?string $filtr = null): void { $prihlaseny = $this->getUser()->isLoggedIn(); $povolene = ['obvody', 'sbor', 'stari', 'nedokoncene']; if (!$prihlaseny || !in_array($filtr, $povolene, true)) { $filtr = 'obvody'; } $stari = []; if ($prihlaseny) { $stari = $this->zaznam->getStariObvodu(); foreach ($stari as &$polozka) { $polozka['url'] = $this->link('Obvod:view', $polozka['id']); } unset($polozka); } $this->template->prihlaseny = $prihlaseny; $this->template->obvod_id = $obvod; $this->template->filtr = $filtr; $this->template->maxMesicu = self::STUPNICE_MESICU; $this->template->maxPrideleni = self::STUPNICE_PRIDELENI; $this->template->stariJson = Json::encode($stari, htmlSafe: true, forceObjects: true); $this->template->sborJson = $this->sbor->getGeoJson() ?? 'null'; } }