Currently IconUtility::mapRecordTypeToSpriteIconName() doesn't support the multi level type
This code snippet makes it respect the "generated" type value as possible value.
748 $column = $GLOBALS['TCA'][$table]['ctrl']['typeicon_column'];
749 if ($column === 'type') {
750 $recordType[1] = \TYPO3\CMS\Backend\Utility\BackendUtility::getTCAtypeValue($table, $row);
751 } elseif (isset($row[$column])) {
752 $recordType[1] = $row[$column];
753 } else {
754 $recordType[1] = 'default';
755 }
So then the TCA would need to be:
'type' => 'file:type',
'typeicon_column' => 'type',
'typeicon_classes' => array(
'1' => 'mimetypes-text-text',
'2' => 'mimetypes-media-image',
'3' => 'mimetypes-media-audio',
'4' => 'mimetypes-media-video',
'5' => 'mimetypes-application',
'default' => 'mimetypes-other-other'
),
A second solution could be is to leave the 'typeicon_column' out of the TCA and then when 'typeicon_classes' is set use the 'type' value to find the icon class.
if (is_array($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) {
$type = \TYPO3\CMS\Backend\Utility\BackendUtility::getTCAtypeValue($table, $row)
if (array_key_exists($type, $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) {
$recordType[0] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'][$type];
} else {
$recordType[0] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['default'];
}
} else {
$recordType[0] = 'tcarecords-' . $table . '-default';
}