mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-10 00:16:13 +01:00

[FEATURE] Display Plugins in "New Content Element" Wizard

resolves https://github.com/TYPO3-Documentation/tea/issues/825
This commit is contained in:
lina.wolf 2023-05-08 16:38:12 +00:00
parent ebf5f204cd
commit 4df4165df8
8 changed files with 184 additions and 2 deletions

11
Configuration/Icons.php Normal file
View file

@ -0,0 +1,11 @@
<?php
return [
// Icon identifier
'tea_plugin' => [
// Icon provider class
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
// The source SVG for the SvgIconProvider
'source' => 'EXT:tea/Resources/Public/Icons/Plugin.svg',
],
];

View file

@ -13,14 +13,14 @@ call_user_func(
// plugin title, as visible in the drop-down in the BE // plugin title, as visible in the drop-down in the BE
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_index', 'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_index',
// the icon visible in the drop-down in the BE // the icon visible in the drop-down in the BE
'EXT:tea/Resources/Public/Icons/Extension.svg' 'tea_plugin'
); );
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Tea', 'Tea',
'TeaShow', 'TeaShow',
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_show', 'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_show',
'EXT:tea/Resources/Public/Icons/Extension.svg' 'tea_plugin'
); );
// This removes the default controls from the plugin. // This removes the default controls from the plugin.

View file

@ -0,0 +1,27 @@
mod.wizards.newContentElement.wizardItems {
// add the plugins to the "Create new content element" wizard
plugins {
elements {
tea_teaindex {
title = LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_index
description = LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_index.description
iconIdentifier = tea_plugin
tt_content_defValues {
CType = list
list_type = = tea_teaindex
}
}
tea_teashow {
title = LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_show
description = LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_teashow.description
iconIdentifier = tea_plugin
tt_content_defValues {
CType = list
list_type = = tea_teashow
}
}
}
show := addToList(tea_teaindex, tea_teashow)
}
}

View file

@ -0,0 +1 @@
@import 'EXT:tea/Configuration/TsConfig/Page/*.tsconfig'

View file

@ -7,10 +7,18 @@
<source>Tea list</source> <source>Tea list</source>
<target>Teeliste</target> <target>Teeliste</target>
</trans-unit> </trans-unit>
<trans-unit id="plugin.tea_index.description">
<source>Displays a list of teas</source>
<target>Zeigt eine Liste von Tees an</target>
</trans-unit>
<trans-unit id="plugin.tea_show"> <trans-unit id="plugin.tea_show">
<source>Tea single view</source> <source>Tea single view</source>
<target>Tee-Einzelansicht</target> <target>Tee-Einzelansicht</target>
</trans-unit> </trans-unit>
<trans-unit id="plugin.tea_show.description">
<source>Displays a single tea record</source>
<target>Zeigt einen einzelnen Tee Datensatz an</target>
</trans-unit>
<trans-unit id="index.heading"> <trans-unit id="index.heading">
<source>Our selection of assorted teas</source> <source>Our selection of assorted teas</source>
<target>Unsere Auswahl an erlesenen Tees</target> <target>Unsere Auswahl an erlesenen Tees</target>

View file

@ -6,9 +6,15 @@
<trans-unit id="plugin.tea_index"> <trans-unit id="plugin.tea_index">
<source>Tea list</source> <source>Tea list</source>
</trans-unit> </trans-unit>
<trans-unit id="plugin.tea_index.description">
<source>Displays a list of teas</source>
</trans-unit>
<trans-unit id="plugin.tea_show"> <trans-unit id="plugin.tea_show">
<source>Tea single view</source> <source>Tea single view</source>
</trans-unit> </trans-unit>
<trans-unit id="plugin.tea_show.description">
<source>Displays a single tea record</source>
</trans-unit>
<trans-unit id="index.heading"> <trans-unit id="index.heading">
<source>Our selection of assorted teas</source> <source>Our selection of assorted teas</source>
</trans-unit> </trans-unit>

View file

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 457.8778 342.01929"
xml:space="preserve"
sodipodi:docname="hot-tea.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
width="457.87781"
height="342.01929"><metadata
id="metadata988"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs986"><linearGradient
id="linearGradient992"
osb:paint="solid"><stop
style="stop-color:#ff862b;stop-opacity:1;"
offset="0"
id="stop990" /></linearGradient><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient992"
id="linearGradient994"
x1="0"
y1="320.008"
x2="480"
y2="320.008"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient992"
id="linearGradient996"
gradientUnits="userSpaceOnUse"
x1="0"
y1="320.008"
x2="480"
y2="320.008" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient992"
id="linearGradient998"
gradientUnits="userSpaceOnUse"
x1="0"
y1="320.008"
x2="480"
y2="320.008" /></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="1140"
id="namedview984"
showgrid="false"
inkscape:zoom="1.94375"
inkscape:cx="240"
inkscape:cy="102.02732"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g931"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" /><g
id="g933"
transform="matrix(0.95391211,0,0,1.187567,0,-209.02129)"
style="fill:url(#linearGradient994);fill-opacity:1"><g
id="g931"
style="fill:url(#linearGradient998);fill-opacity:1"><path
d="m 400,208.008 h -48 v -16 c 0,-8.832 -7.168,-16 -16,-16 H 16 c -8.832,0 -16,7.168 -16,16 v 128 c 0,79.392 64.608,144 144,144 h 64 c 62.496,0 115.264,-40.256 135.168,-96 H 400 c 21.6,0 41.696,-8.416 56.288,-23.392 C 471.584,329.704 480,309.608 480,288.008 c 0,-44.096 -35.872,-80 -80,-80 z m 33.664,113.952 c -8.832,9.056 -20.8,14.048 -33.664,14.048 h -49.632 c 0.608,-5.312 1.632,-10.528 1.632,-16 v -80 h 48 c 26.464,0 48,21.536 48,48 0,12.896 -4.992,24.832 -14.336,33.952 z"
id="path929"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient996);fill-opacity:1"
sodipodi:nodetypes="scssssssscscsscscscssc" /></g></g><g
id="g953"
transform="translate(0,-176.00801)" /><g
id="g955"
transform="translate(0,-176.00801)" /><g
id="g957"
transform="translate(0,-176.00801)" /><g
id="g959"
transform="translate(0,-176.00801)" /><g
id="g961"
transform="translate(0,-176.00801)" /><g
id="g963"
transform="translate(0,-176.00801)" /><g
id="g965"
transform="translate(0,-176.00801)" /><g
id="g967"
transform="translate(0,-176.00801)" /><g
id="g969"
transform="translate(0,-176.00801)" /><g
id="g971"
transform="translate(0,-176.00801)" /><g
id="g973"
transform="translate(0,-176.00801)" /><g
id="g975"
transform="translate(0,-176.00801)" /><g
id="g977"
transform="translate(0,-176.00801)" /><g
id="g979"
transform="translate(0,-176.00801)" /><g
id="g981"
transform="translate(0,-176.00801)" /></svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -3,6 +3,9 @@
declare(strict_types=1); declare(strict_types=1);
use TTN\Tea\Controller\TeaController; use TTN\Tea\Controller\TeaController;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
defined('TYPO3') or die('Access denied.'); defined('TYPO3') or die('Access denied.');
@ -32,3 +35,10 @@ ExtensionUtility::configurePlugin(
TeaController::class => '', TeaController::class => '',
] ]
); );
$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
// Only include page.tsconfig if TYPO3 version is below 12 so that it is not imported twice.
if ($versionInformation->getMajorVersion() < 12) {
ExtensionManagementUtility::addPageTSConfig(
'@import "EXT:tea/Configuration/page.tsconfig"'
);
}