@param ServerRequestInterface $request

@return ResponseInterface
961895
public function updateFooters(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleFooterInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateOrder($modules, 'footer_order', $request);

        return redirect(route('footers'));
    }
805805
public function postAdminAction(ServerRequestInterface $request): ResponseInterface
    {
        $this->setPreference('body', $request->get('body', ''));
        $this->setPreference('head', $request->get('head', ''));

        $message = I18N::translate('The preferences for the module “%s” have been updated.', $this->title());
        FlashMessages::addMessage($message, 'success');

        return redirect($this->getConfigLink());
    }
1174050
public function updateReports(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleReportInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateAccessLevel($modules, ModuleReportInterface::class, $request);

        return redirect(route('reports'));
    }
178066
public function dispatch(ServerRequestInterface $request)
    {
        parse_str($request->getUri()->getQuery(), $args);
        $uri = '/';
        if (isset($args['page'])) {
            $uri .= $args['page'];
        }

        return $this->createDispatcher()->dispatch(
            $request->getMethod(),
            $uri
        );
    }
160993
public function updateBlocks(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleBlockInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateAccessLevel($modules, ModuleBlockInterface::class, $request);

        return redirect(route('blocks'));
    }
787838
public static function createFromServerRequest(ServerRequestInterface $request)
    {
        $data = $request->getCookieParams();
        $cookies = [];
        foreach ($data as $name => $value) {
            $cookies[] = new Cookie($name, $value);
        }

        return new static($cookies);
    }
1367020
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $user_id = (int) $request->getParsedBody()['user_id'];

        $user = $this->user_service->find($user_id);

        if ($user === null) {
            throw new NotFoundHttpException('User ID ' . $user_id . ' not found');
        }

        if ($this->user->id() !== $user_id) {
            Log::addAuthenticationLog('Masquerade as user: ' . $user->userName());
            Auth::login($user);
            Session::put('masquerade', '1');
        }

        return response('', StatusCodeInterface::STATUS_NO_CONTENT);
    }
1109249
public function edit(ServerRequestInterface $request)
    {
        if ($this->isReadOnly()) {
            return new NotFoundStatusResponse();
        }

        if ($this->active_object && $this->active_object->isLoaded()) {
            $authenticated_user = $this->getAuthenticatedUser($request);

            if ($this->shouldCheckPermissions() && !$this->canEdit($this->active_object, $authenticated_user)) {
                return new ForbiddenStatusResponse();
            }

            $request_body = $request->getParsedBody();

            if (empty($request_body)) {
                $request_body = [];
            }

            if ($this->requestBodyContainsProtectedFields($this->active_object, $request_body)) {
                return new BadRequestStatusResponse();
            }

            $this->cleanUpRequestBodyForEdit($request_body, $authenticated_user);

            try {
                return $this->pool->modify($this->active_object, $request_body);
            } catch (ValidationException $e) {
                return $e;
            }
        } else {
            return new NotFoundStatusResponse();
        }
    }
221995
public function mapProviderSave(ServerRequestInterface $request): ResponseInterface
    {
        $provider = $request->getParsedBody()['provider'] ?? '';

        Site::setPreference('map-provider', $provider);

        return redirect(route('admin-control-panel'));
    }
253648
public function handle(ServerRequestInterface $request):ResponseInterface {
		$path = $request->getUri()->getPath();
// TODO: Abstract response type needed.
		$response = new PageResponse();

		try {
			$templateDirectory = implode(DIRECTORY_SEPARATOR, [
				$this->router->getBaseViewLogicPath(),
				"_component",
			]);
			$viewAssembly = $this->router->getViewAssembly($path);
			$view = $this->getView(
				$response->getBody(),
				(string)$viewAssembly,
				$templateDirectory,
				$path,
				$request->getHeaderLine("accept")
			);
		}
		catch(BasenameNotFoundException $exception) {
// TODO: Handle view not found.
			die("The requested view is not found!!!");
		}

		LogicFactory::setView($view);
		$baseLogicDirectory = $this->router->getBaseViewLogicPath();

		$logicAssembly = $this->router->getLogicAssembly($path);

		$logicObjects = $this->createLogicObjects(
			$logicAssembly,
			$baseLogicDirectory,
			$request->getUri()
		);

		$this->dispatchLogicObjects($logicObjects);
		$this->injectCsrf($view);
		$view->stream();

		return $response;
	}
1014461
public function dispatch(ServerRequestInterface $request): ResponseInterface
    {
        $resolved = $this->resolve(0);

        return $resolved->handle($request);
    }
719944
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        if (empty($this->requestHandler)) {
            $this->requestHandler = $this->requestHandler();
        }

        return $this->pipeline->process(
            $request->withAttribute(self::ROUTE_ATTRIBUTE, $this),
            $this->requestHandler
        );
    }
633653
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        // Special handling for API requests: they get a proper API response
        if ($this->isApiRequest($request)) {
            return $this->apiResponse();
        }

        // By default, return a simple text message.
        return new HtmlResponse(self::MESSAGE, 503);
    }
386029
public function mapData(ServerRequestInterface $request): ResponseInterface
    {
        $parent_id   = (int) ($request->getQueryParams()['parent_id'] ?? 0);
        $hierarchy   = $this->getHierarchy($parent_id);
        $title       = I18N::translate('Geographic data');
        $breadcrumbs = [
            route('admin-control-panel') => I18N::translate('Control panel'),
            route('map-data')            => $title,
        ];

        foreach ($hierarchy as $row) {
            $breadcrumbs[route('map-data', ['parent_id' => $row->pl_id])] = $row->pl_place;
        }
        $breadcrumbs[] = array_pop($breadcrumbs);

        return $this->viewResponse('admin/locations', [
            'title'       => $title,
            'breadcrumbs' => $breadcrumbs,
            'parent_id'   => $parent_id,
            'placelist'   => $this->getPlaceListLocation($parent_id),
        ]);
    }
634855
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        if ($this->index >= count($this->middlewares)) {
            throw new OutOfBoundsException('Reached end of middleware stack. Does your controller return a response ?');
        }

        $middleware = $this->middlewares[$this->index++];

        return $middleware->process($request, $this);
    }
982709
public function process(ServerRequestInterface $request)
    {
        $middleware = $this->getMiddleware();
        ++$this->index;

        //When all saved middleware were called
        if (null === $middleware) {
            return $this->response;
        }
        if ($middleware instanceof MiddlewareInterface) {
            return $middleware->process($request, $this);
        }
    }
959265
public function replace(ServerRequestInterface $request): ResponseInterface
    {
        $search  = $request->get('search', '');
        $replace = $request->get('replace', '');
        $context = $request->get('context', '');

        if ($context !== 'name' && $context !== 'place') {
            $context = 'all';
        }

        $title = I18N::translate('Search and replace');

        return $this->viewResponse('search-replace-page', [
            'context' => $context,
            'replace' => $replace,
            'search'  => $search,
            'title'   => $title,
        ]);
    }