Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
[FEATURE] CD-25505 allow DI via ObjectManager for TabHandler classes
Browse files Browse the repository at this point in the history
  • Loading branch information
kschu91 committed Aug 25, 2016
1 parent 1f24486 commit cce59ec
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Classes/Hooks/ElementBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use AOE\Linkhandler\TabHandlerInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;

/**
* Class ElementBrowser
Expand Down Expand Up @@ -142,8 +145,20 @@ public function getTab($act)
$tabHandlerClass = $configuration['tabHandler'];
}

$tabHandler = new $tabHandlerClass($this->pObj, $this->getaddPassOnParams, $configuration, $currentValue,
$this->isRTE(), $this->getCurrentPageId());
/** @var ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);

/** @var TabHandlerInterface $tabHandler */
$tabHandler = $objectManager->get(
$tabHandlerClass,
$this->pObj,
$this->getaddPassOnParams,
$configuration,
$currentValue,
$this->isRTE(),
$this->getCurrentPageId()
);

$content = $tabHandler->getTabContent();

return $content;
Expand Down

0 comments on commit cce59ec

Please sign in to comment.