Index: t3lib/class.t3lib_iconworks.php =================================================================== --- t3lib/class.t3lib_iconworks.php (Revision 7896) +++ t3lib/class.t3lib_iconworks.php (Arbeitskopie) @@ -774,46 +774,60 @@ **/ protected static function mapRecordTypeToSpriteIconClass($table, $row) { $iconName = ''; + $recordType = array(); if (isset($GLOBALS['TCA'][$table]['ctrl']['typeicon_column'])) { $column = $GLOBALS['TCA'][$table]['ctrl']['typeicon_column']; - if(isset($row[$column])) { - $recordType = $row[$column]; + if (isset($row[$column])) { + $recordType[4] = $row[$column]; } else { - $recordType = 'default'; + $recordType[4] = 'default'; } // workaround to give nav_hide pages a complete different icon // although it's not a separate doctype // and to give root-pages an own icon - if ($table === 'pages' && $row['is_siteroot']) { - $recordType .= '-root'; - } else if ($table === 'pages' && $row['nav_hide']) { - $recordType .= '-hideinmenu'; - } + if ($table === 'pages') { + if ($row['is_siteroot']) { + $recordType[3] = $recordType[4] . '-root'; + } + if ($row['nav_hide']) { + $recordType[2] = $recordType[4] . '-hideinmenu'; + } + if ($row['doktype'] >= 200 && $row['module']) { + $recordType[1] = 'contains-' . $row['module']; + } + } - if(is_array($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) { - if(isset($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'][$recordType])) { - $iconName = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'][$recordType]; - } else { - $iconName = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['default']; + if (is_array($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) { + foreach ($recordType AS $key => $type) { + if($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'][$type]) { + $recordType[$key] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'][$type]; + } else { + unset($recordType[$key]); + } } - + $recordType[5] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['default']; } else { - if (in_array('tcarecords-' . $table . '-' . $recordType, $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) { - $iconName = 'tcarecords-' . $table . '-' . $recordType; - } else { - $iconName = $iconName = 'tcarecords-' . $table . '-default'; + foreach ($recordType AS $key => $type) { + $recordType[$key] = 'tcarecords-' . $table . '-' . $type; } + $recordType[5] = 'tcarecords-' . $table . '-default'; } } else { - if(is_array($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) { - $iconName = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['default']; - } else if (in_array('tcarecords-' . $table . '-default', $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) { - $iconName = 'tcarecords-' . $table . '-default'; + if (is_array($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) { + $recordType[5] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['default']; + } else { + $recordType[5] = 'tcarecords-' . $table . '-default'; } } - return self::getSpriteIconClasses(($iconName != '' ? $iconName : 'status-status-icon-missing')); + ksort($recordType); + while ($iconName === '' && list($key, $icon) = each($recordType)) { + $iconName = (in_array($icon, $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable']) ? $icon : ''); + } + t3lib_div::debug($recordType); + t3lib_div::debug($iconName); + return self::getSpriteIconClasses(($iconName !== '' ? $iconName : 'status-status-icon-missing')); }