[BUGFIX] Move nav_title from AbstractTreeView to PageTreeView 52/36252/3
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 25 Jan 2015 19:19:32 +0000 (20:19 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 25 Jan 2015 20:10:29 +0000 (21:10 +0100)
AbstractTreeView contains references to nav_title but
doesn't really know about "nav_title".
That's something for the PageTreeView and
PageTreeNavigationController.

Change-Id: I9432514e5a475953a3f0e93767dce242ea7925ff
Resolves: #64492
Releases: master
Reviewed-on: http://review.typo3.org/36252
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/PageTreeNavigationController.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Tree/View/PageTreeView.php

index c18c948..210254b 100644 (file)
@@ -115,8 +115,6 @@ class PageTreeNavigationController {
                $this->pagetree->addField('shortcut_mode');
                $this->pagetree->addField('mount_pid');
                $this->pagetree->addField('mount_pid_ol');
-               $this->pagetree->addField('nav_hide');
-               $this->pagetree->addField('nav_title');
                $this->pagetree->addField('url');
                // Temporary DB mounts:
                $this->initializeTemporaryDBmount();
index 21cbcbb..3eb8054 100644 (file)
@@ -683,15 +683,8 @@ abstract class AbstractTreeView {
         * @return string The title.
         */
        public function getTitleStr($row, $titleLen = 30) {
-               if ($this->ext_showNavTitle && trim($row['nav_title']) !== '') {
-                       $title = '<span title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xlf:title', TRUE) . ' ' . htmlspecialchars(trim($row['title'])) . '">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</span>';
-               } else {
-                       $title = htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLen));
-                       if (trim($row['nav_title']) !== '') {
-                               $title = '<span title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/locallang_tca.xlf:pages.nav_title', TRUE) . ' ' . htmlspecialchars(trim($row['nav_title'])) . '">' . $title . '</span>';
-                       }
-                       $title = trim($row['title']) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : $title;
-               }
+               $title = htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLen));
+               $title = trim($row['title']) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : $title;
                return $title;
        }
 
index d01bc39..2fe6989 100644 (file)
@@ -29,6 +29,7 @@ class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                'uid',
                'title',
                'doktype',
+               'nav_title',
                'mount_pid',
                'php_tree_stop',
                't3ver_id',
@@ -109,4 +110,24 @@ class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                $this->stored = array();
        }
 
+       /**
+        * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
+        * Do NOT htmlspecialchar the string from this function - has already been done.
+        *
+        * @param array $row The input row array (where the key "title" is used for the title)
+        * @param int $titleLen Title length (30)
+        * @return string The title.
+        */
+       public function getTitleStr($row, $titleLen = 30) {
+               if ($this->ext_showNavTitle && trim($row['nav_title']) !== '') {
+                       $title = '<span title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xlf:title', TRUE) . ' ' . htmlspecialchars(trim($row['title'])) . '">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</span>';
+               } else {
+                       $title = htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLen));
+                       if (trim($row['nav_title']) !== '') {
+                               $title = '<span title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/locallang_tca.xlf:pages.nav_title', TRUE) . ' ' . htmlspecialchars(trim($row['nav_title'])) . '">' . $title . '</span>';
+                       }
+                       $title = trim($row['title']) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : $title;
+               }
+               return $title;
+       }
 }