. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Http\ViewResponseTrait; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Registry; use Fisharebest\Webtrees\Validator; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; final class EditNotePage implements RequestHandlerInterface { use ViewResponseTrait; public function handle(ServerRequestInterface $request): ResponseInterface { $tree = Validator::attributes($request)->tree(); $xref = Validator::attributes($request)->isXref()->string('xref'); $note = Registry::noteFactory()->make($xref, $tree); $note = Auth::checkNoteAccess($note, true); return $this->viewResponse('edit/shared-note', [ 'note' => $note, 'title' => I18N::translate('Edit the shared note'), 'tree' => $tree, ]); } }