New CLI command vitec:import-downloads: reads the JSON export of the old site (www.vitec.com/import), cuts it out of the surrounding page template by brace counting, and imports the downloads idempotently by slug. Scope is deliberately narrow: only files under /fileadmin/downloads/Collateral/, records without title or file are skipped, records sharing one file_url are merged. Files are fetched resumably into fileadmin/downloads/Collateral/ and stored on pid 29. Legacy filenames are normalized on fetch so every imported file matches the <prefix>__<filetype>__<NN>-<letter> version convention: __NN_A -> __NN-A, ___NN -> __NN, __NNA -> __NN-A, and a bare __NN gets -A appended as its initial revision. Verified against the full export: all 179 names match afterwards, none of the already-correct ones change. tx_vitec_domain_model_download gains a second category field "type" (display taxonomy: Datasheet, Success Story, Brochure, Software) next to the filename-driven filetype categories. No SQL change needed - the core generates columns for category fields. The three download renderers emit the field as a string analogous to filetype; MM rows are distinguished by fieldname, existing queries filter on it and remain unaffected. Import values are matched via the custom columns sys_category.filetype and .type (falling back to title); missing categories are created (filetype under --category-parent, default 4; type under a "Download Type" parent). getDownloadFile() in the three download renderers gains a filepath fallback (FAL -> convention -> filepath) as a safety net for any future filename that escapes the convention - previously such records emitted file: null. Architecture spec bumped to v1.7. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
389 lines
14 KiB
PHP
389 lines
14 KiB
PHP
<?php
|
|
return [
|
|
'ctrl' => [
|
|
'title' => 'VITEC Download',
|
|
'label' => 'title',
|
|
'tstamp' => 'tstamp',
|
|
'crdate' => 'crdate',
|
|
'cruser_id' => 'cruser_id',
|
|
'versioningWS' => true,
|
|
'languageField' => 'sys_language_uid',
|
|
'transOrigPointerField' => 'l10n_parent',
|
|
'transOrigDiffSourceField' => 'l10n_diffsource',
|
|
'delete' => 'deleted',
|
|
'enablecolumns' => [
|
|
'disabled' => 'hidden',
|
|
'starttime' => 'starttime',
|
|
'endtime' => 'endtime',
|
|
],
|
|
'searchFields' => 'title,slug,teaser,description,sort1,sort2,sort3,icon,filepath,fileprefix',
|
|
'iconfile' => 'EXT:vitec/Resources/Public/Icons/tx_vitec_domain_model_download.gif'
|
|
],
|
|
'types' => [
|
|
'1' => ['showitem' => 'hidden, title, slug, keywords, teaser, description,
|
|
--div--;File, useolddl, file, fileprefix, categories, type,
|
|
--div--;Visibility, hideonapp, hideonwebsite, hideondatasheets, hideonproducts,
|
|
--div--;Currently not in use,icon, filepath, private_download, onlyondatasheets, sort1, sort2, sort3,
|
|
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
|
|
],
|
|
'columns' => [
|
|
'sys_language_uid' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
|
|
'config' => [
|
|
'type' => 'select',
|
|
'renderType' => 'selectSingle',
|
|
'special' => 'languages',
|
|
'items' => [
|
|
[
|
|
'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
|
|
-1,
|
|
'flags-multiple'
|
|
]
|
|
],
|
|
'default' => 0,
|
|
],
|
|
],
|
|
'l10n_parent' => [
|
|
'displayCond' => 'FIELD:sys_language_uid:>:0',
|
|
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
|
|
'config' => [
|
|
'type' => 'select',
|
|
'renderType' => 'selectSingle',
|
|
'default' => 0,
|
|
'items' => [
|
|
['', 0],
|
|
],
|
|
'foreign_table' => 'tx_vitec_domain_model_download',
|
|
'foreign_table_where' => 'AND {#tx_vitec_domain_model_download}.{#pid}=###CURRENT_PID### AND {#tx_vitec_domain_model_download}.{#sys_language_uid} IN (-1,0)',
|
|
],
|
|
],
|
|
'l10n_diffsource' => [
|
|
'config' => [
|
|
'type' => 'passthrough',
|
|
],
|
|
],
|
|
'hidden' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
'invertStateDisplay' => true
|
|
]
|
|
],
|
|
],
|
|
],
|
|
'starttime' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'renderType' => 'inputDateTime',
|
|
'eval' => 'datetime,int',
|
|
'default' => 0,
|
|
'behaviour' => [
|
|
'allowLanguageSynchronization' => true
|
|
]
|
|
],
|
|
],
|
|
'endtime' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'renderType' => 'inputDateTime',
|
|
'eval' => 'datetime,int',
|
|
'default' => 0,
|
|
'range' => [
|
|
'upper' => mktime(0, 0, 0, 1, 1, 2038)
|
|
],
|
|
'behaviour' => [
|
|
'allowLanguageSynchronization' => true
|
|
]
|
|
],
|
|
],
|
|
'categories' => [
|
|
'config' => [
|
|
'type' => 'category'
|
|
]
|
|
],
|
|
'type' => [
|
|
'exclude' => true,
|
|
'label' => 'Type',
|
|
'description' => 'Display taxonomy (Datasheet, Success Story, ...) - independent of the filename-driven filetype categories.',
|
|
'config' => [
|
|
'type' => 'category'
|
|
]
|
|
],
|
|
'title' => [
|
|
'exclude' => true,
|
|
'label' => 'Title',
|
|
'description' => 'Title of the Download - this will be shown in search results',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'teaser' => [
|
|
'exclude' => true,
|
|
'label' => 'Teaser Text for Download Cards',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'slug' => [
|
|
'exclude' => true,
|
|
'label' => 'Slug',
|
|
'config' => [
|
|
'type' => 'slug',
|
|
'generatorOptions' => [
|
|
'fields' => ['title'],
|
|
'fieldSeparator' => '/',
|
|
'prefixParentPageSlug' => true,
|
|
'replacements' => [
|
|
'/' => '',
|
|
],
|
|
],
|
|
'fallbackCharacter' => '-',
|
|
'eval' => 'unique',
|
|
],
|
|
],
|
|
'keywords' => [
|
|
'exclude' => true,
|
|
'label' => 'Keywords for internal search engine',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'description' => [
|
|
'exclude' => true,
|
|
'label' => 'Description',
|
|
'config' => [
|
|
'type' => 'text',
|
|
'enableRichtext' => true,
|
|
'richtextConfiguration' => 'default',
|
|
'fieldControl' => [
|
|
'fullScreenRichtext' => [
|
|
'disabled' => false,
|
|
],
|
|
],
|
|
'cols' => 40,
|
|
'rows' => 15,
|
|
'eval' => 'trim',
|
|
],
|
|
|
|
],
|
|
'file' => [
|
|
'exclude' => true,
|
|
'label' => 'Manual File Upload - if "Use manual file upload" is checked',
|
|
'config' => [
|
|
'type' => 'file',
|
|
'appearance' => [
|
|
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:media.addFileReference'
|
|
],
|
|
'foreign_types' => [
|
|
'0' => [
|
|
'showitem' => '
|
|
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
|
--palette--;;filePalette'
|
|
],
|
|
\TYPO3\CMS\Core\Resource\FileType::TEXT->value => [
|
|
'showitem' => '
|
|
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
|
--palette--;;filePalette'
|
|
],
|
|
\TYPO3\CMS\Core\Resource\FileType::IMAGE->value => [
|
|
'showitem' => '
|
|
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
|
--palette--;;filePalette'
|
|
],
|
|
\TYPO3\CMS\Core\Resource\FileType::AUDIO->value => [
|
|
'showitem' => '
|
|
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
|
--palette--;;filePalette'
|
|
],
|
|
\TYPO3\CMS\Core\Resource\FileType::VIDEO->value => [
|
|
'showitem' => '
|
|
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
|
--palette--;;filePalette'
|
|
],
|
|
\TYPO3\CMS\Core\Resource\FileType::APPLICATION->value => [
|
|
'showitem' => '
|
|
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
|
--palette--;;filePalette'
|
|
]
|
|
],
|
|
'foreign_match_fields' => [
|
|
'fieldname' => 'file',
|
|
'tablenames' => 'tx_vitec_domain_model_download',
|
|
],
|
|
'maxitems' => 1
|
|
],
|
|
],
|
|
'sort1' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:vitec/Resources/Private/Language/locallang_db.xlf:tx_vitec_domain_model_download.sort1',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'sort2' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:vitec/Resources/Private/Language/locallang_db.xlf:tx_vitec_domain_model_download.sort2',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'sort3' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:vitec/Resources/Private/Language/locallang_db.xlf:tx_vitec_domain_model_download.sort3',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'private_download' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:vitec/Resources/Private/Language/locallang_db.xlf:tx_vitec_domain_model_download.private_download',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
]
|
|
],
|
|
'default' => 0,
|
|
]
|
|
],
|
|
'hideonapp' => [
|
|
'exclude' => true,
|
|
'label' => 'Do not show this Download in the App',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
]
|
|
],
|
|
'default' => 0,
|
|
]
|
|
],
|
|
'hideonwebsite' => [
|
|
'exclude' => true,
|
|
'label' => 'Do not show this Download on the Website',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
]
|
|
],
|
|
'default' => 0,
|
|
]
|
|
],
|
|
'hideondatasheets' => [
|
|
'exclude' => true,
|
|
'label' => 'Do not show this Download on the Datasheets-Page',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
]
|
|
],
|
|
'default' => 0,
|
|
]
|
|
],
|
|
'hideonproducts' => [
|
|
'exclude' => true,
|
|
'label' => 'Do not show this Download on a Products-Page',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
]
|
|
],
|
|
'default' => 0,
|
|
]
|
|
],
|
|
'icon' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:vitec/Resources/Private/Language/locallang_db.xlf:tx_vitec_domain_model_download.icon',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'filepath' => [
|
|
'exclude' => true,
|
|
'label' => 'LLL:EXT:vitec/Resources/Private/Language/locallang_db.xlf:tx_vitec_domain_model_download.filepath',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'fileprefix' => [
|
|
'exclude' => true,
|
|
'label' => 'Fileprefix (1st part of filename)',
|
|
'description' => 'This is the first part of the filename.',
|
|
'config' => [
|
|
'type' => 'input',
|
|
'size' => 30,
|
|
'eval' => 'trim',
|
|
'default' => ''
|
|
],
|
|
],
|
|
'useolddl' => [
|
|
'exclude' => true,
|
|
'label' => 'Use manual file upload',
|
|
'config' => [
|
|
'type' => 'check',
|
|
'renderType' => 'checkboxToggle',
|
|
'items' => [
|
|
[
|
|
0 => '',
|
|
1 => '',
|
|
]
|
|
],
|
|
'default' => 0,
|
|
]
|
|
],
|
|
],
|
|
];
|