30 lines
891 B
PHP
Executable File
30 lines
891 B
PHP
Executable File
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Evomedien\Vitec\View;
|
|
|
|
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
|
use TYPO3\CMS\Backend\View\BackendLayoutView;
|
|
|
|
/**
|
|
* Overrides BackendLayoutView so the page module always reflects pages.layout
|
|
* without the editor having to set backend_layout manually.
|
|
*/
|
|
final class VitecBackendLayoutView extends BackendLayoutView
|
|
{
|
|
public function getSelectedCombinedIdentifier(int $pageId): string|false
|
|
{
|
|
if ($pageId <= 0) {
|
|
return parent::getSelectedCombinedIdentifier($pageId);
|
|
}
|
|
|
|
$page = BackendUtility::getRecord('pages', $pageId, 'layout');
|
|
if (!is_array($page) || !isset($page['layout'])) {
|
|
return parent::getSelectedCombinedIdentifier($pageId);
|
|
}
|
|
|
|
// Combined identifier format: "<dataProvider>__<layoutId>"
|
|
return 'vitec__' . (int)$page['layout'];
|
|
}
|
|
}
|