Commit f4beb2c2 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

FIx CGL for t3o_planet

parent 8df84788
Pipeline #10194 failed
......@@ -14,13 +14,14 @@ namespace T3o\T3oPlanet\Backend\Preview;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem;
use TYPO3\CMS\Core\Service\FlexFormService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Core\Service\FlexFormService;
class PreviewRenderer implements \TYPO3\CMS\Backend\Preview\PreviewRendererInterface
{
public function renderPageModulePreviewContent(\TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem $item): string
public function renderPageModulePreviewContent(GridColumnItem $item): string
{
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename('EXT:t3o_planet/Resources/Private/Backend/Planet.html');
......@@ -43,21 +44,18 @@ class PreviewRenderer implements \TYPO3\CMS\Backend\Preview\PreviewRendererInter
return $view->render();
}
public function renderPageModulePreviewHeader(\TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem $item): string
public function renderPageModulePreviewHeader(GridColumnItem $item): string
{
return '';
}
public function renderPageModulePreviewFooter(\TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem $item): string
public function renderPageModulePreviewFooter(GridColumnItem $item): string
{
return '';
}
public function wrapPageModulePreview(
string $previewHeader,
string $previewContent,
\TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem $item
): string {
public function wrapPageModulePreview(string $previewHeader, string $previewContent, GridColumnItem $item): string
{
return $previewHeader . $previewContent;
}
}
......@@ -13,40 +13,47 @@ namespace T3o\T3oPlanet\Controller;
*
***/
use T3o\T3oPlanet\Domain\Model\Article;
use T3o\T3oPlanet\Domain\Repository\ArticleRepository;
use T3o\T3oPlanet\Domain\Repository\TagRepository;
use T3o\T3oPlanet\Property\TypeConverter\UploadedFileReferenceConverter;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository;
use TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository;
use TYPO3\CMS\Extbase\Property\PropertyMappingConfiguration;
class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
protected array $contentElementData;
protected ?\T3o\T3oPlanet\Domain\Repository\ArticleRepository $articleRepository;
protected ?ArticleRepository $articleRepository;
public function injectArticleRepository(\T3o\T3oPlanet\Domain\Repository\ArticleRepository $articleRepository): void
public function injectArticleRepository(ArticleRepository $articleRepository): void
{
$this->articleRepository = $articleRepository;
$this->articleRepository = $articleRepository;
}
protected ?\T3o\T3oPlanet\Domain\Repository\TagRepository $tagRepository;
protected ?TagRepository $tagRepository;
public function injectTagRepository(\T3o\T3oPlanet\Domain\Repository\TagRepository $tagRepository): void
public function injectTagRepository(TagRepository $tagRepository): void
{
$this->tagRepository = $tagRepository;
$this->tagRepository = $tagRepository;
}
protected ?\TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository $categoryRepository;
protected ?CategoryRepository $categoryRepository;
public function injectCategoryRepository(\TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository $categoryRepository): void
public function injectCategoryRepository(CategoryRepository $categoryRepository): void
{
$this->categoryRepository = $categoryRepository;
$this->categoryRepository = $categoryRepository;
}
protected \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository $userRepository;
protected FrontendUserRepository $userRepository;
public function injectUserRepository(\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository $frontendUserRepository): void
public function injectUserRepository(FrontendUserRepository $frontendUserRepository): void
{
$this->userRepository = $frontendUserRepository;
$this->userRepository = $frontendUserRepository;
}
/**
......@@ -117,9 +124,9 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
public function articlesManagementAction()
{
$statusArr = [
\T3o\T3oPlanet\Domain\Model\Article::STATUS_PENDING => 'Pending',
\T3o\T3oPlanet\Domain\Model\Article::STATUS_ACCEPTED => 'Accepted',
\T3o\T3oPlanet\Domain\Model\Article::STATUS_REJECTED => 'Rejected',
Article::STATUS_PENDING => 'Pending',
Article::STATUS_ACCEPTED => 'Accepted',
Article::STATUS_REJECTED => 'Rejected',
];
$panelType = $this->settings['panelType'];
if ($panelType) {
......@@ -185,7 +192,7 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
*
* @param \T3o\T3oPlanet\Domain\Model\Article $newT3planetArticles
*/
public function createAction(\T3o\T3oPlanet\Domain\Model\Article $newT3planetArticles)
public function createAction(Article $newT3planetArticles)
{
$backPid = (int)GeneralUtility::_GP('backPID');
......@@ -205,7 +212,7 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
$this->articleRepository->add($newT3planetArticles);
if ($backPid) {
$this->addFlashMessage('A new article inserted successfully!', 'Success!', \TYPO3\CMS\Core\Messaging\AbstractMessage::OK);
$this->addFlashMessage('A new article inserted successfully!', 'Success!', FlashMessage::OK);
$uriBuilder = $this->uriBuilder;
$uri = $uriBuilder
->setTargetPageUid($backPid)
......@@ -216,7 +223,7 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
}
}
public function getCurrentUser(): \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
public function getCurrentUser(): FrontendUser
{
if ($this->currentUser === null && $GLOBALS['TSFE']->fe_user->user['uid'] > 0) {
$this->currentUser = $this->userRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
......@@ -230,7 +237,7 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
*
* @param \T3o\T3oPlanet\Domain\Model\Article $t3planetArticles
*/
public function editAction(\T3o\T3oPlanet\Domain\Model\Article $t3planetArticles)
public function editAction(Article $t3planetArticles)
{
$t3planetCategories = $this->categoryRepository->findAll();
$t3planetTags = $this->tagRepository->findAll();
......@@ -256,7 +263,7 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
*
* @param \T3o\T3oPlanet\Domain\Model\Article $t3planetArticles
*/
public function updateAction(\T3o\T3oPlanet\Domain\Model\Article $t3planetArticles)
public function updateAction(Article $t3planetArticles)
{
$this->addFlashMessage('The article updated successfully!', 'Success!', \TYPO3\CMS\Core\Messaging\AbstractMessage::OK);
$this->articleRepository->update($t3planetArticles);
......@@ -283,7 +290,7 @@ class ArticleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
*
* @param \T3o\T3oPlanet\Domain\Model\Article $t3planetArticles
*/
public function deleteAction(\T3o\T3oPlanet\Domain\Model\Article $t3planetArticles)
public function deleteAction(Article $t3planetArticles)
{
$this->articleRepository->remove($t3planetArticles);
$this->addFlashMessage('The article deleted successfully!', 'Success!', \TYPO3\CMS\Core\Messaging\AbstractMessage::OK);
......
<?php
namespace T3o\T3oPlanet\Controller;
use T3o\T3oPlanet\Domain\Repository\TagRepository;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/***
*
* This file is part of the "Planet TYPO3" Extension for TYPO3 CMS.
......@@ -15,13 +18,13 @@ namespace T3o\T3oPlanet\Controller;
/**
* T3planetTagsController
*/
class TagController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
class TagController extends ActionController
{
protected ?\T3o\T3oPlanet\Domain\Repository\TagRepository $t3planetTagsRepository;
protected ?TagRepository $t3planetTagsRepository;
public function injectT3planetTagsRepository(\T3o\T3oPlanet\Domain\Repository\TagRepository $t3planetTagsRepository): void
public function injectT3planetTagsRepository(TagRepository $t3planetTagsRepository): void
{
$this->t3planetTagsRepository = $t3planetTagsRepository;
$this->t3planetTagsRepository = $t3planetTagsRepository;
}
/**
......@@ -36,9 +39,9 @@ class TagController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
/**
* action show
*
* @param \T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags
* @param \T3o\T3oPlanet\Domain\Model\Tag $t3planetTags
*/
public function showAction(\T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags)
public function showAction(\T3o\T3oPlanet\Domain\Model\Tag $t3planetTags)
{
$this->view->assign('t3planetTags', $t3planetTags);
}
......@@ -53,9 +56,9 @@ class TagController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
/**
* action create
*
* @param \T3o\T3oPlanet\Domain\Model\T3planetTags $newT3planetTags
* @param \T3o\T3oPlanet\Domain\Model\Tag $newT3planetTags
*/
public function createAction(\T3o\T3oPlanet\Domain\Model\T3planetTags $newT3planetTags)
public function createAction(\T3o\T3oPlanet\Domain\Model\Tag $newT3planetTags)
{
$this->addFlashMessage('The object was created. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING);
$this->t3planetTagsRepository->add($newT3planetTags);
......@@ -65,10 +68,10 @@ class TagController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
/**
* action edit
*
* @param \T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags
* @param \T3o\T3oPlanet\Domain\Model\Tag $t3planetTags
* @ignorevalidation $t3planetTags
*/
public function editAction(\T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags)
public function editAction(\T3o\T3oPlanet\Domain\Model\Tag $t3planetTags)
{
$this->view->assign('t3planetTags', $t3planetTags);
}
......@@ -76,9 +79,9 @@ class TagController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
/**
* action update
*
* @param \T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags
* @param \T3o\T3oPlanet\Domain\Model\Tag $t3planetTags
*/
public function updateAction(\T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags)
public function updateAction(\T3o\T3oPlanet\Domain\Model\Tag $t3planetTags)
{
$this->addFlashMessage('The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING);
$this->t3planetTagsRepository->update($t3planetTags);
......@@ -88,9 +91,9 @@ class TagController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
/**
* action delete
*
* @param \T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags
* @param \T3o\T3oPlanet\Domain\Model\Tag $t3planetTags
*/
public function deleteAction(\T3o\T3oPlanet\Domain\Model\T3planetTags $t3planetTags)
public function deleteAction(\T3o\T3oPlanet\Domain\Model\Tag $t3planetTags)
{
$this->addFlashMessage('The object was deleted. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING);
$this->t3planetTagsRepository->remove($t3planetTags);
......
......@@ -13,10 +13,11 @@ namespace T3o\T3oPlanet\Domain\Model;
***/
use TYPO3\CMS\Extbase\Annotation as Extbase;
use TYPO3\CMS\Extbase\Domain\Model\Category;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
const STATUS_PENDING = 0;
const STATUS_ACCEPTED = 1;
const STATUS_REJECTED = 2;
......@@ -97,7 +98,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
* @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
*/
protected ?\TYPO3\CMS\Extbase\Persistence\ObjectStorage $categoryId;
protected ?ObjectStorage $categoryId;
/**
* tagId
......@@ -105,7 +106,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\T3oPlanet\Domain\Model\Tag>
* @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
*/
protected ?\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tagId;
protected ?ObjectStorage $tagId;
/**
* __construct
......@@ -124,8 +125,8 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected function initStorageObjects()
{
$this->categoryId = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->tagId = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->categoryId = new ObjectStorage();
$this->tagId = new ObjectStorage();
}
/**
......@@ -303,7 +304,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @param \TYPO3\CMS\Extbase\Domain\Model\Category $categoryId
*/
public function addCategoryId(\TYPO3\CMS\Extbase\Domain\Model\Category $categoryId)
public function addCategoryId(Category $categoryId)
{
$this->categoryId->attach($categoryId);
}
......@@ -313,7 +314,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @param \TYPO3\CMS\Extbase\Domain\Model\Category $categoryIdToRemove
*/
public function removeCategoryId(\TYPO3\CMS\Extbase\Domain\Model\Category $categoryIdToRemove)
public function removeCategoryId(Category $categoryIdToRemove)
{
$this->categoryId->detach($categoryIdToRemove);
}
......@@ -323,7 +324,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categoryId
*/
public function getCategoryId(): \TYPO3\CMS\Extbase\Persistence\ObjectStorage
public function getCategoryId(): ObjectStorage
{
return $this->categoryId;
}
......@@ -333,7 +334,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categoryId
*/
public function setCategoryId(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $categoryId)
public function setCategoryId(ObjectStorage $categoryId)
{
$this->categoryId = $categoryId;
}
......@@ -363,7 +364,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\T3oPlanet\Domain\Model\Tag> $tagId
*/
public function getTagId(): \TYPO3\CMS\Extbase\Persistence\ObjectStorage
public function getTagId(): ObjectStorage
{
return $this->tagId;
}
......@@ -373,7 +374,7 @@ class Article extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\T3oPlanet\Domain\Model\Tag> $tagId
*/
public function setTagId(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tagId)
public function setTagId(ObjectStorage $tagId)
{
$this->tagId = $tagId;
}
......
......@@ -33,7 +33,6 @@ use TYPO3\CMS\Core\Utility\PathUtility;
use TYPO3\CMS\Extbase\Error\Error;
use TYPO3\CMS\Extbase\Property\Exception\TypeConverterException;
use TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface;
use TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter;
/**
* Class UploadedFileReferenceConverter
......
......@@ -36,14 +36,14 @@ class UploadViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\UploadViewHelpe
public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService): void
{
$this->hashService = $hashService;
$this->hashService = $hashService;
}
protected ?\TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper;
public function injectPropertyMapper(\TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper): void
{
$this->propertyMapper = $propertyMapper;
$this->propertyMapper = $propertyMapper;
}
/**
......
......@@ -44,7 +44,7 @@ call_user_func(
'className' => \TYPO3\CMS\Extbase\Domain\Model\FileReference::class
];
// Add Converter
// Add Converter
// \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('T3o\\T3oPlanet\\Property\\TypeConverter\\UploadedFileReferenceConverter');
// \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('T3o\\T3oPlanet\\Property\\TypeConverter\\ObjectStorageConverter');
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment