. */ 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; /** * Edit note objects. */ class EditNotePage implements RequestHandlerInterface { use ViewResponseTrait; /** * Show a form to create a new note object. * * @param ServerRequestInterface $request * * @return ResponseInterface */ 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, ]); } }