Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Classes/Service/EditModeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public function init(ServerRequestInterface $request): void
$veInfo = [
'pageId' => $pageId,
'languageId' => $siteLanguage->getLanguageId(),
'showIdWithTitle' => !empty($this->getBeUser()->getTSConfig()['options.']['pageTree.']['showPageIdWithTitle']),
'backendEditUrl' => $backendEditUrl,
'newContentUrl' => $newContentUrl,
'editContentUrl' => $editContentUrl,
Expand Down Expand Up @@ -182,8 +183,7 @@ public function canEditField(RecordInterface $record, string $field, ServerReque
}

// user access check
/** @var BackendUserAuthentication $beUser */
$beUser = $GLOBALS['BE_USER'];
$beUser = $this->getBeUser();
if ($record instanceof Record || method_exists($record, 'getLanguageId')) {
$languageId = $record->getLanguageId();
// it is not that bad if we can not check the language access, on save there might be an error message. (better than always throwing an error.
Expand Down Expand Up @@ -296,4 +296,14 @@ private function getUsedArguments(ServerRequestInterface $request): array
unset($usedArguments['editMode']);
return $usedArguments;
}

private function getBeUser(): BackendUserAuthentication
{
$beUser = $GLOBALS['BE_USER'];
if (!$beUser instanceof BackendUserAuthentication) {
throw new RuntimeException('Could not determine backend user authentication', 3305745964);
}

return $beUser;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class VeContentElement extends LitElement {
aria-label="${lll('frontend.actionBar')}"
>
<span class="action-bar-headline" title="uid:${this.uid}">
${(this.canBeMoved && this.hasContentAreaAsParent) ? '⠿ ' : ''}${this.elementName}
${(this.canBeMoved && this.hasContentAreaAsParent) ? '⠿ ' : ''}${window.veInfo.showIdWithTitle ? `[${this.uid}] ` : ''}${this.elementName}
</span>
<!-- TODO extract button bar as separate component -->
${
Expand Down