Fixed bug #17158: Pagetree: now uses [No title] from language file if no title is...
[Packages/TYPO3.CMS.git] / t3lib / tree / pagetree / class.t3lib_tree_pagetree_commands.php
index 69f16ff..c06ee74 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
+*  (c) 2010-2011 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -288,9 +288,11 @@ final class t3lib_tree_pagetree_Commands {
                $subNode = t3lib_div::makeInstance('t3lib_tree_pagetree_Node');
                $subNode->setRecord($record);
                $subNode->setCls($record['_CSSCLASS']);
-               $subNode->setQTip(str_replace(' - ', '<br />', t3lib_BEfunc::titleAttribForPages($record, '', FALSE)));
                $subNode->setType('pages');
 
+               $qtip = t3lib_BEfunc::titleAttribForPages($record, '', FALSE);
+               $subNode->setQTip(str_replace(' - ', '<br />', htmlspecialchars($qtip)));
+
                $subNode->setId($record['uid']);
                $subNode->setMountPoint($mountPoint);
                $subNode->setWorkspaceId(($record['_ORIG_uid'] ? $record['_ORIG_uid'] : $record['uid']));
@@ -301,7 +303,13 @@ final class t3lib_tree_pagetree_Commands {
                        $field = 'nav_title';
                        $text = $record['nav_title'];
                }
-               $visibleText = t3lib_div::fixed_lgd_cs($text, $titleLength);
+
+               if (trim($text) === '') {
+                       $visibleText = '[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.no_title', TRUE) . ']';
+               } else {
+                       $visibleText = $text;
+               }
+               $visibleText = t3lib_div::fixed_lgd_cs($visibleText, $titleLength);
 
                $suffix = '';
                if ($addDomainName) {
@@ -337,4 +345,4 @@ final class t3lib_tree_pagetree_Commands {
        }
 }
 
-?>
+?>
\ No newline at end of file