Skip to content

Commit

Permalink
Refactor FileReferenceContainer constructor to inject dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
svewap committed Oct 15, 2024
1 parent 055d6cb commit 432bc62
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Classes/Backend/Form/Container/FileReferenceContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,35 @@

namespace WapplerSystems\Videos\Backend\Form\Container;

use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Backend\Form\Event\ModifyFileReferenceControlsEvent;
use TYPO3\CMS\Backend\Form\Event\ModifyFileReferenceEnabledControlsEvent;
use TYPO3\CMS\Backend\Form\InlineStackProcessor;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Resource\Index\MetaDataRepository;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;

class FileReferenceContainer extends \TYPO3\CMS\Backend\Form\Container\FileReferenceContainer {


public function __construct(
private readonly IconFactory $iconFactory,
private readonly InlineStackProcessor $inlineStackProcessor,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly ResourceFactory $resourceFactory,
private readonly ConnectionPool $connectionPool,
private readonly UriBuilder $uriBuilder,
private readonly MetaDataRepository $metaDataRepository,
) {}

protected function renderFileReferenceHeaderControl(): string
{
$controls = [];
Expand Down
2 changes: 1 addition & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1712229824] = [
'nodeName' => FileReferenceContainer::NODE_TYPE_IDENTIFIER,
'nodeName' => 'fileReferenceContainer',
'priority' => '70',
'class' => FileReferenceContainer::class,
];

0 comments on commit 432bc62

Please sign in to comment.