. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use function redirect; use function route; /** * Manage media from the control panel. */ class ManageMediaAction implements RequestHandlerInterface { /** * @param ServerRequestInterface $request * * @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { $params = (array) $request->getParsedBody(); return redirect(route(ManageMediaPage::class, [ 'files' => $params['files'], 'media_folder' => $params['media_folder'] ?? '', 'subfolders' => $params['subfolders'] ?? 'include', ])); } }