Commit aa15393d authored by Markus Sommer's avatar Markus Sommer Committed by Thomas Löffler

[TASK] Cleanup TCA and make migration

parent 1e60ba2e
<?php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'ter_fe2',
'Configuration/TypoScript/Default/',
'TER Frontend - Default Configuration'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'ter_fe2',
'Configuration/TypoScript/Rss/',
'TER Frontend - RSS Output'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'ter_fe2',
'Configuration/TypoScript/Json/',
'TER Frontend - JSON Output'
);
<?php
$extIdent = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase('ter_fe2')) . '_pi1';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$extIdent] = 'layout,select_key,recursive';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$extIdent] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$extIdent,
'FILE:EXT:ter_fe2/Configuration/FlexForms/flexform_list.xml'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'ter_fe2',
'Pi1',
'TER Frontend Index'
);
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# writing. "version" and "dependencies" must not be touched! # writing. "version" and "dependencies" must not be touched!
######################################################################## ########################################################################
$EM_CONF[$_EXTKEY] = array( $EM_CONF[$_EXTKEY] = [
'title' => 'TER Frontend Index', 'title' => 'TER Frontend Index',
'description' => 'New TER Frontend based on Extbase and Fluid', 'description' => 'New TER Frontend based on Extbase and Fluid',
'category' => 'plugin', 'category' => 'plugin',
...@@ -30,18 +30,18 @@ $EM_CONF[$_EXTKEY] = array( ...@@ -30,18 +30,18 @@ $EM_CONF[$_EXTKEY] = array(
'clearCacheOnLoad' => 0, 'clearCacheOnLoad' => 0,
'lockType' => '', 'lockType' => '',
'version' => '0.4.0', 'version' => '0.4.0',
'constraints' => array( 'constraints' => [
'depends' => array( 'depends' => [
'extbase' => '', 'extbase' => '',
'fluid' => '', 'fluid' => '',
), ],
'conflicts' => array( 'conflicts' => [
), ],
'suggests' => array( 'suggests' => [
'em' => '', 'em' => '',
'paginate' => '', 'paginate' => '',
), ],
), ],
'suggests' => array( 'suggests' => [
), ],
); ];
...@@ -3,88 +3,85 @@ if (!defined('TYPO3_MODE')) { ...@@ -3,88 +3,85 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.'); die('Access denied.');
} }
// Make plugin available in frontend // Make plugin available in frontend
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'T3o.' . $_EXTKEY, 'T3o.ter_fe2',
'Pi1', 'Pi1',
array( [
'Extension' => 'index, search, show, new, create, edit, update, delete, download, list, listLatest, uploadVersion, createVersion, removeTag', 'Extension' => 'index, search, show, new, create, edit, update, delete, download, list, listLatest, uploadVersion, createVersion, removeTag',
'Tag' => 'list, new, create, edit, update, delete, show', 'Tag' => 'list, new, create, edit, update, delete, show',
'Author' => 'list, edit, update, show', 'Author' => 'list, edit, update, show',
# 'Registerkey' => 'index, create, manage, update, edit, transfer, delete',
'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, salvage, keep', 'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, salvage, keep',
'Review' => 'update', 'Review' => 'update',
), ],
array( [
'Extension' => 'search, create, update, edit, delete, download, uploadVersion, createVersion, removeTag', 'Extension' => 'search, create, update, edit, delete, download, uploadVersion, createVersion, removeTag',
'Tag' => 'create, delete', 'Tag' => 'create, delete',
'Author' => 'update', 'Author' => 'update',
# 'Registerkey' => 'index, create, manage, update, edit, transfer, delete',
'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, salvage, keep', 'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, salvage, keep',
'Review' => 'update', 'Review' => 'update',
) ]
); );
// Register extension providers // Register extension providers
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$_EXTKEY]['extensionProviders'])) { if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders'])) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$_EXTKEY]['extensionProviders'] = array(); $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders'] = [];
} }
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$_EXTKEY]['extensionProviders']['mirrors'] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders']['mirrors'] = [
'class' => \T3o\TerFe2\Provider\MirrorProvider::class, 'class' => \T3o\TerFe2\Provider\MirrorProvider::class,
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_provider_mirrorprovider.name', 'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_provider_mirrorprovider.name',
'configuration' => array( 'configuration' => [
'repositoryId' => 1, 'repositoryId' => 1,
'fileCachePath' => 'typo3temp/tx_terfe2/files/', 'fileCachePath' => 'typo3temp/tx_terfe2/files/',
), ],
); ];
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$_EXTKEY]['extensionProviders']['file'] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders']['file'] = [
'class' => \T3o\TerFe2\Provider\FileProvider::class, 'class' => \T3o\TerFe2\Provider\FileProvider::class,
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_provider_fileprovider.name', 'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_provider_fileprovider.name',
'configuration' => array( 'configuration' => [
'extensionRootPath' => 'fileadmin/ter/', 'extensionRootPath' => 'fileadmin/ter/',
), ],
); ];
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$_EXTKEY]['extensionProviders']['soap'] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders']['soap'] = [
'class' => \T3o\TerFe2\Provider\SoapProvider::class, 'class' => \T3o\TerFe2\Provider\SoapProvider::class,
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_provider_soapprovider.name', 'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_provider_soapprovider.name',
'configuration' => array( 'configuration' => [
'wsdlUrl' => '', 'wsdlUrl' => '',
'username' => '', 'username' => '',
'password' => '', 'password' => '',
'getExtensionsFunc' => 'getExtensions', 'getExtensionsFunc' => 'getExtensions',
'getFileUrlFunc' => 'getFileUrl', 'getFileUrlFunc' => 'getFileUrl',
'getFileNameFunc' => 'getFileName', 'getFileNameFunc' => 'getFileName',
'getVersionDetailsFunc' => 'getVersionDetails', 'getVersionDetailsFunc' => 'getVersionDetails',
), ],
); ];
// Register import from queue task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\ImportExtensionsFromQueueTask::class] = array(
'extension' => $_EXTKEY,
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importextensionsfromqueuetask.name',
'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importextensionsfromqueuetask.description',
);
// Register import all extensions // Register import from queue task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\ImportAllExtensionsTask::class] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\ImportExtensionsFromQueueTask::class] = [
'extension' => $_EXTKEY, 'extension' => 'ter_fe2',
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importallextensionstask.name', 'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importextensionsfromqueuetask.name',
'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importallextensionstask.description', 'description' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importextensionsfromqueuetask.description',
); ];
// Register check for outdated extensions tassk // Register import all extensions
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\CheckForOutdatedExtensions::class] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\ImportAllExtensionsTask::class] = [
'extension' => $_EXTKEY, 'extension' => 'ter_fe2',
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforoutdatedextensions.name', 'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importallextensionstask.name',
'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforoutdatedextensions.description', 'description' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_importallextensionstask.description',
); ];
// Register check for expired extensions tassk // Register check for outdated extensions tassk
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\CheckForExpiredExtensions::class] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\CheckForOutdatedExtensions::class] = [
'extension' => $_EXTKEY, 'extension' => 'ter_fe2',
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforexpiredextensions.name', 'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforoutdatedextensions.name',
'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforexpiredextensions.description', 'description' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforoutdatedextensions.description',
); ];
// Register check for expired extensions tassk
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\CheckForExpiredExtensions::class] = [
'extension' => 'ter_fe2',
'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforexpiredextensions.name',
'description' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:tx_terfe2_task_checkforexpiredextensions.description',
];
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ter_fe2:extension'] = 'EXT:ter_fe2/Classes/Controller/Eid/ExtensionController.php'; $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ter_fe2:extension'] = 'EXT:ter_fe2/Classes/Controller/Eid/ExtensionController.php';
...@@ -3,57 +3,43 @@ if (!defined('TYPO3_MODE')) { ...@@ -3,57 +3,43 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.'); die('Access denied.');
} }
// Add plugin to list call_user_func(function () {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( $models = [
$_EXTKEY, 'extension',
'Pi1', 'tag',
'TER Frontend Index' 'version',
); 'relation',
'author',
];
// Add static TypoScript files // Add entities and value objects
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Default/', 'TER Frontend - Default Configuration'); foreach ($models as $modelName => $modelConfiguration) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Rss/', 'TER Frontend - RSS Output');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Json/', 'TER Frontend - JSON Output');
// Add flexform to field list of the Backend form
$extIdent = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY)) . '_pi1';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$extIdent] = 'layout,select_key,recursive';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$extIdent] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($extIdent, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_list.xml');
// Domain models and their label / search fields
$models = array(
'extension',
'tag',
'version',
'relation',
'author',
);
// Add entities and value objects
foreach ($models as $modelName => $modelConfiguration) {
// Add help text to the Backend form // Add help text to the Backend form
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'tx_terfe2_domain_model_' . $modelName, 'tx_terfe2_domain_model_' . $modelName,
'EXT:ter_fe2/Resources/Private/Language/locallang_csh_tx_terfe2_domain_model_' . $modelName . '.xml' 'EXT:ter_fe2/Resources/Private/Language/locallang_csh_tx_terfe2_domain_model_' . $modelName . '.xml'
); );
// Allow datasets on standard pages // Allow datasets on standard pages
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_terfe2_domain_model_' . $modelName); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
} 'tx_terfe2_domain_model_' . $modelName
);
// Add plugin to new content element wizard }
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(" $extIdent = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase('ter_fe2')) . '_pi1';
// Add plugin to new content element wizard
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
mod.wizards.newContentElement.wizardItems.special {\n mod.wizards.newContentElement.wizardItems.special {\n
elements." . $extIdent . " {\n elements.' . $extIdent . ' {\n
icon = " . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . "Resources/Public/Images/Wizard.gif\n icon = ' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Images/Wizard.gif\n
title = LLL:EXT:" . $_EXTKEY . "/Resources/Private/Language/locallang_db.xml:newContentElement.wizardItem.title\n title = LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:newContentElement.wizardItem.title\n
description = LLL:EXT:" . $_EXTKEY . "/Resources/Private/Language/locallang_db.xml:newContentElement.wizardItem.description\n\n description = LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xml:newContentElement.wizardItem.description\n\n
tt_content_defValues {\n tt_content_defValues {\n
CType = list\n CType = list\n
list_type = " . $extIdent . "\n list_type = ' . $extIdent . '\n
}\n }\n
}\n\n }\n\n
show := addToList(" . $extIdent . ")\n show := addToList(' . $extIdent . ')\n
} }
"); ');
});
This diff is collapsed.
<?php <?php
// Add static TypoScript files \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Default/', 'TER Frontend - Default TER Layout Configuration'); 'ter_layout',
'Configuration/TypoScript/Default/',
'TER Frontend - Default TER Layout Configuration'
);
...@@ -86,4 +86,4 @@ lib { ...@@ -86,4 +86,4 @@ lib {
} }
SolrSearch < plugin.tx_solr_PiSearch_Search SolrSearch < plugin.tx_solr_PiSearch_Search
} }
\ No newline at end of file
...@@ -24,18 +24,14 @@ $EM_CONF[$_EXTKEY] = [ ...@@ -24,18 +24,14 @@ $EM_CONF[$_EXTKEY] = [
'author' => 't3o team', 'author' => 't3o team',
'author_email' => 'maintenance@typo3.org', 'author_email' => 'maintenance@typo3.org',
'author_company' => 'TYPO3 Association', 'author_company' => 'TYPO3 Association',
'constraints' => 'constraints' => [
[ 'depends' => [
'depends' => 'typo3' => '7.6.12',
[ 'php' => '7.0.0'
'typo3' => '7.6.12',
'php' => '7.0.0'
],
'conflicts' =>
[
],
'suggests' =>
[
],
], ],
'conflicts' => [
],
'suggests' => [
],
],
]; ];
Markdown is supported
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