Index: typo3/sysext/css_styled_content/static/setup.txt =================================================================== --- typo3/sysext/css_styled_content/static/setup.txt (revision 7192) +++ typo3/sysext/css_styled_content/static/setup.txt (working copy) @@ -120,7 +120,7 @@ addChr10BetweenParagraphs=1 } div.stripNL = 1 - div.callRecursive = 1 + div.callRecursive = 1 } nonTypoTagStdWrap.encapsLines { encapsTagList = p,pre,h1,h2,h3,h4,h5,h6 @@ -822,6 +822,8 @@ 30.bytes = 1 30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels} } + useSpacesInLinkText = 0 + stripFileExtensionFromLinkText = 0 } 20.color { Index: typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php =================================================================== --- typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php (revision 7192) +++ typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php (working copy) @@ -347,7 +347,18 @@ $GLOBALS['TSFE']->register['fileSize'] = $filesData[$key]['filesize']; $GLOBALS['TSFE']->register['fileExtension'] = $filesData[$key]['fileextension']; $GLOBALS['TSFE']->register['description'] = $filesData[$key]['description']; - $filesData[$key]['linkedFilenameParts'] = explode('//**//',$this->cObj->filelink($fileName, $conf['linkProc.'])); + $filesData[$key]['linkedFilenameParts'] + = $this->beautifyFileLink( + explode( + '//**//', + $this->cObj->filelink( + $fileName, $conf['linkProc.'] + ) + ), + $fileName, + $conf['useSpacesInLinkText'], + $conf['stripFileExtensionFromLinkText'] + ); } } @@ -874,6 +885,40 @@ ************************************/ /** + * Returns a link text string which replaces underscores in filename with + * blanks. + * + * Has the possibility to cut off FileType. + + * @param array $links + * array with [0] linked file icon, [1] text link + * @param string $fileName + * the name of the file to be linked (without path) + * @param boolean $useSpaces + * whether underscores in the file name should be replaced with spaces + * @param boolean $cutFileExtension + * whether the file extension should be removed + * + * @return array modified array with new link text + */ + protected function beautifyFileLink( + array $links, $fileName, $useSpaces = FALSE, $cutFileExtension = FALSE + ) { + $linkText = $fileName; + if ($useSpaces) { + $linkText = str_replace('_', ' ', $linkText); + } + if ($cutFileExtension) { + $pos = strrpos($linkText, '.'); + $linkText = substr($linkText, 0, $pos); + } + $links[1] = str_replace( + '>' . $fileName . '<', '>' . $linkText . '<', $links[1] + ); + return $links; + } + + /** * Returns table attributes for uploads / tables. * * @param array TypoScript configuration array