diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..07764a7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf \ No newline at end of file diff --git a/Classes/Controller/JnPhpcontentController.php b/Classes/Controller/JnPhpcontentController.php index 6116eba..4a1e299 100644 --- a/Classes/Controller/JnPhpcontentController.php +++ b/Classes/Controller/JnPhpcontentController.php @@ -1,6 +1,9 @@ , joppnet + * (c) 2022-2024 Oliver Schlöbe , joppnet * ***/ @@ -18,17 +21,16 @@ class JnPhpcontentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { /** - * @TYPO3\CMS\Extbase\Annotation\Inject - * @var \Joppnet\JnPhpcontentelement\Domain\Repository\JnPhpcontentRepository + * @var JnPhpcontentRepository */ protected $jnPhpcontentRepository; /** * Inject the PHP content repository * - * @param \Joppnet\JnPhpcontentelement\Domain\Repository\JnPhpcontentRepository $jnPhpcontentRepository + * @param JnPhpcontentRepository $jnPhpcontentRepository */ - public function injectJnPhpcontentRepository(\Joppnet\JnPhpcontentelement\Domain\Repository\JnPhpcontentRepository $jnPhpcontentRepository) + public function injectJnPhpcontentRepository(JnPhpcontentRepository $jnPhpcontentRepository) { $this->jnPhpcontentRepository = $jnPhpcontentRepository; } @@ -36,11 +38,13 @@ public function injectJnPhpcontentRepository(\Joppnet\JnPhpcontentelement\Domain /** * action list * - * @return void + * @return ResponseInterface */ - public function listAction() + public function listAction(): ResponseInterface { $jnPhpContents = $this->jnPhpcontentRepository->findAll(); $this->view->assign('jnPhpContents', $jnPhpContents); + + return $this->htmlResponse(); } } diff --git a/Classes/Domain/Model/JnPhpcontent.php b/Classes/Domain/Model/JnPhpcontent.php index f0b6c09..39e3ef8 100644 --- a/Classes/Domain/Model/JnPhpcontent.php +++ b/Classes/Domain/Model/JnPhpcontent.php @@ -8,7 +8,7 @@ * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * - * (c) 2022 Oliver Schlöbe , joppnet + * (c) 2022-2024 Oliver Schlöbe , joppnet * ***/ @@ -22,21 +22,21 @@ class JnPhpcontent extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity * * @var string */ - protected $name = ''; + protected string $name = ''; /** * phpcontent * * @var string */ - protected $phpcontent = ''; + protected string $phpcontent = ''; /** * Returns the name * * @return string $name */ - public function getName() + public function getName(): string { return $this->name; } @@ -47,7 +47,7 @@ public function getName() * @param string $name * @return void */ - public function setName($name) + public function setName($name): void { $this->name = $name; } @@ -57,7 +57,7 @@ public function setName($name) * * @return string $outputString */ - public function getPhpcontentParsed() + public function getPhpcontentParsed(): string { ob_start(); eval('?' . chr(62) . $this->phpcontent . chr(60) . '?php '); @@ -71,7 +71,7 @@ public function getPhpcontentParsed() * * @return string $phpcontent */ - public function getPhpcontent() + public function getPhpcontent(): string { return $this->getPhpcontentParsed(); #return $this->phpcontent; @@ -83,7 +83,7 @@ public function getPhpcontent() * @param string $phpcontent * @return void */ - public function setPhpcontent($phpcontent) + public function setPhpcontent($phpcontent): void { $this->phpcontent = $phpcontent; } diff --git a/Classes/Domain/Repository/JnPhpcontentRepository.php b/Classes/Domain/Repository/JnPhpcontentRepository.php index 1bbc36e..c417313 100644 --- a/Classes/Domain/Repository/JnPhpcontentRepository.php +++ b/Classes/Domain/Repository/JnPhpcontentRepository.php @@ -8,7 +8,7 @@ * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * - * (c) 2022 Oliver Schlöbe , joppnet + * (c) 2022-2024 Oliver Schlöbe , joppnet * ***/ diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml new file mode 100644 index 0000000..ff9360a --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,9 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + Joppnet\JnPhpcontentelement\: + resource: '../Classes/*' + exclude: '../Classes/Domain/Model/*' diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 9ab6b27..bb02dcf 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,6 +1,12 @@ isRegistered($iconIdentifier)) { - // $iconRegistry->registerIcon( - // $iconIdentifier, - // \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, - // ['source' => 'EXT:jn_phpcontentelement/Resources/Public/Icons/Extension.png'] - // ); - // } - // } + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + if (!$iconRegistry->isRegistered($iconIdentifier)) { + $iconRegistry->registerIcon( + $iconIdentifier, + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => 'EXT:jn_phpcontentelement/Resources/Public/Icons/Extension.png'] + ); + } })(); diff --git a/jn_phpcontentelement_1.3.0.zip b/jn_phpcontentelement_1.3.0.zip new file mode 100644 index 0000000..11df684 Binary files /dev/null and b/jn_phpcontentelement_1.3.0.zip differ