Initial Commit
This commit is contained in:
29
packages/vitec/Classes/View/VitecBackendLayoutView.php
Executable file
29
packages/vitec/Classes/View/VitecBackendLayoutView.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?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'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user