registerArgument('row', 'array', 'content data', true); $this->registerArgument('tableName', 'string', 'table name', true); $this->registerArgument('fieldName', 'string', 'field name', true); } public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ): string { $row = $arguments['row']; $tableName = $arguments['tableName']; $fieldName = $arguments['fieldName']; return self::linkEditContent( BackendUtility::thumbCode(row: $row, table: $tableName, field: $fieldName, linkInfoPopup: false), $row ); } protected static function linkEditContent(string $linkText, $row): string { if (empty($linkText)) { return $linkText; } $backendUser = self::getBackendUser(); if ( $backendUser->check('tables_modify', 'tt_content') && $backendUser->recordEditAccessInternals('tt_content', $row) && ( new Permission( $backendUser->calcPerms(BackendUtility::getRecord('pages', $row['pid']) ?? []) ) )->editContentPermissionIsGranted() ) { $urlParameters = [ 'edit' => [ 'tt_content' => [ $row['uid'] => 'edit', ], ], // @extensionScannerIgnoreLine 'returnUrl' => self::getRequest()->getAttribute('normalizedParams')->getRequestUri() . '#element-tt_content-' . $row['uid'], ]; /** @var UriBuilder $uriBuilder */ $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters); return '' . $linkText . ''; } return $linkText; } protected static function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; } protected static function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } protected static function getRequest(): ServerRequestInterface { return $GLOBALS['TYPO3_REQUEST']; } }