必须修改 TYPO3 扩展以适应 TYPO3 7.5 及更高版本的需要。将 myextkey 替换为您的扩展的扩展密钥。
ext_localconf.php:
if (TYPO3_MODE == 'BE') {
$pageType = 'myext10'; // a maximum of 10 characters
$icons = array(
'apps-pagetree-folder-contains-' . $pageType => 'apps-pagetree-folder-contains-myextkey.svg'
);
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
foreach ($icons as $identifier => $filename) {
$iconRegistry->registerIcon(
$identifier,
$iconRegistry->detectIconProvider($filename),
array('source' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/' . $filename)
);
}
}
配置/TCA/覆盖/pages.php:
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
// add folder icon
$pageType = 'myext10'; // a maximum of 10 characters
$iconReference = 'apps-pagetree-folder-contains-' . $pageType;
$addToModuleSelection = TRUE;
foreach ($GLOBALS['TCA']['pages']['columns']['module']['config']['items'] as $item) {
if ($item['1'] == $pageType) {
$addToModuleSelection = false;
break;
}
}
if ($addToModuleSelection) {
$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes']['contains-' . $pageType] = $iconReference;
$GLOBALS['TCA']['pages']['columns']['module']['config']['items'][] = array(
0 => 'LLL:EXT:myextkey/locallang.xml:pageModule.plugin',
1 => $pageType,
2 => $iconReference
);
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
$pageType,
'Configuration/TSconfig/Page/folder_tables.txt',
'EXT:myextkey :: Restrict pages to myextkey records'
);
本地语言.xml:
<label index="pageModule.plugin">My Extension: Table names of my extension</label>
Resources/Public/Icons/apps-pagetree-folder-contains-myextkey.svg:
扩展表的矢量图形图像文件
有关工作示例 SVG 图标,请参阅https://github.com/TYPO3/TYPO3.Icons 。
Configuration/TSconfig/Page/folder_tables.txt:
插入扩展的表名。
mod.web_list.allowedNewTables = tx_myextkey_tablename1, tx_myextkey_tablename2, tx_myextkey_tablename3