Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
[FIXED] TYPO3 v12 compatibility
  • Loading branch information
oliverschloebe committed Mar 30, 2024
1 parent 9fdb1be commit a7b5096
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
18 changes: 11 additions & 7 deletions Classes/Controller/JnPhpcontentController.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php
namespace Joppnet\JnPhpcontentelement\Controller;

use Psr\Http\Message\ResponseInterface;
use Joppnet\JnPhpcontentelement\Domain\Repository\JnPhpcontentRepository;

/***
*
* This file is part of the "[joppnet] Page PHP Content Element" Extension for TYPO3 CMS.
*
* 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 <oli@joppnet.de>, joppnet
* (c) 2022-2024 Oliver Schlöbe <oli@joppnet.de>, joppnet
*
***/

Expand All @@ -18,29 +21,30 @@
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;
}

/**
* 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();
}
}
16 changes: 8 additions & 8 deletions Classes/Domain/Model/JnPhpcontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <oli@joppnet.de>, joppnet
* (c) 2022-2024 Oliver Schlöbe <oli@joppnet.de>, joppnet
*
***/

Expand All @@ -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;
}
Expand All @@ -47,7 +47,7 @@ public function getName()
* @param string $name
* @return void
*/
public function setName($name)
public function setName($name): void
{
$this->name = $name;
}
Expand All @@ -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 ');
Expand All @@ -71,7 +71,7 @@ public function getPhpcontentParsed()
*
* @return string $phpcontent
*/
public function getPhpcontent()
public function getPhpcontent(): string
{
return $this->getPhpcontentParsed();
#return $this->phpcontent;
Expand All @@ -83,7 +83,7 @@ public function getPhpcontent()
* @param string $phpcontent
* @return void
*/
public function setPhpcontent($phpcontent)
public function setPhpcontent($phpcontent): void
{
$this->phpcontent = $phpcontent;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/JnPhpcontentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <oli@joppnet.de>, joppnet
* (c) 2022-2024 Oliver Schlöbe <oli@joppnet.de>, joppnet
*
***/

Expand Down
9 changes: 9 additions & 0 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false

Joppnet\JnPhpcontentelement\:
resource: '../Classes/*'
exclude: '../Classes/Domain/Model/*'
16 changes: 11 additions & 5 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Joppnet.JnPhpcontentelement',
'Phpcelist',
'[joppnet] PHP Content Element'
);
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

defined('TYPO3') or die();

(function () {
ExtensionUtility::registerPlugin(
'JnPhpcontentelement',
'Phpcelist',
'[joppnet] PHP Content Element'
);
})();
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Latest Stable Version](https://poser.pugx.org/joppnet/jn_phpcontentelement/v/stable.svg)](https://extensions.typo3.org/extension/jn_phpcontentelement/)
[![TYPO3 12](https://img.shields.io/badge/TYPO3-12-orange.svg)](https://get.typo3.org/version/12)
[![TYPO3 11](https://img.shields.io/badge/TYPO3-11-orange.svg)](https://get.typo3.org/version/11)
[![TYPO3 10](https://img.shields.io/badge/TYPO3-10-orange.svg)](https://get.typo3.org/version/10)
[![Total Downloads](https://poser.pugx.org/joppnet/jn_phpcontentelement/d/total.svg)](https://packagist.org/packages/joppnet/jn_phpcontentelement)
Expand Down
18 changes: 8 additions & 10 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@
}'
);

// if (TYPO3_MODE === 'BE') {
// $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']
// );
// }
// }
$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']
);
}
})();
Binary file added jn_phpcontentelement_1.3.0.zip
Binary file not shown.

0 comments on commit a7b5096

Please sign in to comment.