Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Build/rector/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Ssch\TYPO3Rector\CodeQuality\General\ExtEmConfRector;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
Expand Down
12 changes: 9 additions & 3 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use T3docs\BlogExample\Domain\Repository\PostRepository;
use T3docs\BlogExample\Service\BlogFactory;
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\Template\Components\ComponentFactory;
use TYPO3\CMS\Backend\Template\Components\Menu\Menu;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
Expand Down Expand Up @@ -58,6 +59,7 @@ public function __construct(
protected readonly ModuleTemplateFactory $moduleTemplateFactory,
private readonly IconFactory $iconFactory,
private readonly LanguageServiceFactory $languageServiceFactory,
protected readonly ComponentFactory $componentFactory,
) {}

public function addPopulateButton(ButtonBar $buttonBar): void
Expand Down Expand Up @@ -265,17 +267,21 @@ private function buildMenu(ModuleTemplate $view, string &$context): Menu
'index' => [
'controller' => 'Backend',
'action' => 'index',
'label' => $this->getLanguageService()->sL('blog_example.messages:administration.menu.index'),
'label' => $this->getLanguageService()->translate('administration.menu.index', 'blog_example.messages') ?? 'abc',
],
'showAllComents' => [
'controller' => 'Backend',
'action' => 'showAllComments',
'label' => $this->getLanguageService()->sL('blog_example.messages:administration.menu.comments'),
'label' => $this->getLanguageService()->translate('administration.menu.comments', 'blog_example.messages') ?? 'abc',
],
];

$menuRegistry = $view->getDocHeaderComponent()->getMenuRegistry();
//$menu = $this->componentFactory->createMenu();
//$menu->setIdentifier('viewSelector')->setLabel('View');

$menu = $view->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
$menu->setIdentifier('BlogExampleModuleMenu');
$menu->setIdentifier('BlogExampleModuleMenu')->setLabel('View');

foreach ($menuItems as $menuItemConfig) {
$isActive = $this->request->getControllerActionName() === $menuItemConfig['action'];
Expand Down
1 change: 1 addition & 0 deletions Classes/Domain/Model/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Post extends AbstractEntity implements \Stringable
/**
* @var ?ObjectStorage<Tag>
*/
#[Cascade(['value' => 'remove'])]
public ?ObjectStorage $tags = null;

/**
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject;
use Symfony\Component\Validator\Constraints as Assert;
use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject;

/**
* A blog post tag
Expand Down
14 changes: 0 additions & 14 deletions Classes/Service/BlogFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use T3docs\BlogExample\Domain\Model\Comment;
use T3docs\BlogExample\Domain\Model\Person;
use T3docs\BlogExample\Domain\Model\Post;
use T3docs\BlogExample\Domain\Model\Tag;
use TYPO3\CMS\Core\SingletonInterface;

/*
Expand Down Expand Up @@ -76,19 +75,6 @@ public function createBlog(int $blogNumber = 1): Blog
$comment->setContent('Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.');
$post->addComment($comment);

// create some random tags
if (random_int(0, 1) > 0) {
$tag = new Tag('MVC');
$post->addTag($tag);
}
if (random_int(0, 1) > 0) {
$tag = new Tag('Domain Driven Design');
$post->addTag($tag);
}
if (random_int(0, 1) > 0) {
$tag = new Tag('TYPO3');
$post->addTag($tag);
}
// add the post to the current blog
$blog->addPost($post);
$post->setBlog($blog);
Expand Down
5 changes: 2 additions & 3 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

declare(strict_types=1);
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

defined('TYPO3') or die();
Expand All @@ -19,7 +18,7 @@
'blog_example_icon',
'blog_example',
'LLL:blog_example.plugin:blog_list.description',
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml'
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml',
);
ExtensionUtility::registerPlugin(
'blog_example',
Expand All @@ -28,5 +27,5 @@
'blog_example_icon',
'blog_example',
'LLL:blog_example.plugin:blog_admin.description',
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml'
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml',
);
1 change: 1 addition & 0 deletions Resources/Private/Backend/Templates/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<tr>
<th class="nowrap align-top">Blog</th>
<th class="align-top">Description</th>
<th class="align-top">Description</th>
<th class="align-top">&nbsp;</th>
</tr>
</thead>
Expand Down