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