Feature #4064: Navigation title in tree view
authorThomas Hempel <thomas.hempel@typo3.org>
Thu, 13 Sep 2007 10:23:50 +0000 (10:23 +0000)
committerThomas Hempel <thomas.hempel@typo3.org>
Thu, 13 Sep 2007 10:23:50 +0000 (10:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2508 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_browsetree.php
t3lib/class.t3lib_treeview.php
typo3/alt_db_navframe.php
typo3/class.browse_links.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php

index b22c908..5767ae9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-09-13     Thomas Hempel   <thomas@typo3-unleashed.net>
+
+       * Feature #4064: Navigation title in tree view
+       
 2007-09-11  Ingo Renner  <ingo@typo3.org>
 
        * added romainian flag, fixes bug 6000
index 47a2908..ee25883 100755 (executable)
@@ -146,7 +146,7 @@ class t3lib_browseTree extends t3lib_treeView {
        }
 
        /**
-        * Returns the title for the input record. If blank, a "no title" labele (localized) will be returned.
+        * 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           The input row array (where the key "title" is used for the title)
@@ -154,7 +154,8 @@ class t3lib_browseTree extends t3lib_treeView {
         * @return      string          The title.
         */
        function getTitleStr($row,$titleLen=30) {
-               $title = (!strcmp(trim($row['title']),'')) ? '<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$titleLen));
+                       // get the basic title from the parent implementation in t3lib_treeview
+               $title = parent::getTitleStr($row,$titleLen);
                if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
                        $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain',
                                                'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'], 'sys_domain'), '', 'sorting', 1);
index 57b0e6c..6af8b17 100755 (executable)
@@ -667,7 +667,7 @@ class t3lib_treeView {
 
 
        /**
-        * Returns the title for the input record. If blank, a "no title" labele (localized) will be returned.
+        * 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           The input row array (where the key "title" is used for the title)
@@ -675,7 +675,16 @@ class t3lib_treeView {
         * @return      string          The title.
         */
        function getTitleStr($row,$titleLen=30) {
-               $title = (!strcmp(trim($row['title']),'')) ? '<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$titleLen));
+               if ($this->ext_showNavTitle && strlen(trim($row['nav_title'])) > 0)     {
+                       $title = '<span title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:title',1).' '.htmlspecialchars(trim($row['title'])).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['nav_title'],$titleLen)).'</span>';
+               } else {
+                       $title = htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$titleLen));
+                       if (strlen(trim($row['nav_title'])) > 0)        {
+                               $title = '<span title="'.$GLOBALS['LANG']->sL('LLL:EXT:cms/locallang_tca.xml:pages.nav_title',1).' '.htmlspecialchars(trim($row['nav_title'])).'">'.$title.'</span>';
+                       } 
+                       $title = (strlen(trim($row['title'])) == 0) ? '<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>' : $title;
+               }
+               
                return $title;
        }
 
index d8f09bb..ea1d5cd 100755 (executable)
@@ -107,6 +107,7 @@ class SC_alt_db_navframe {
                $this->pagetree = t3lib_div::makeInstance('webPageTree');
                $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
                $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
+               $this->pagetree->ext_showNavTitle = $BE_USER->getTSConfigVal('options.pageTree.showNavTitle');
                $this->pagetree->ext_dontSeparateNotinmenuPages = $BE_USER->getTSConfigVal('options.pageTree.dontSeparateNotinmenuPages');
                $this->pagetree->ext_dontAlphasortNotinmenuPages = $BE_USER->getTSConfigVal('options.pageTree.dontAlphasortNotinmenuPages');
                $this->pagetree->thisScript = 'alt_db_navframe.php';
@@ -116,6 +117,7 @@ class SC_alt_db_navframe {
                $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:
index 4548869..bd32af1 100755 (executable)
@@ -1448,6 +1448,8 @@ class browse_links {
                $pagetree = t3lib_div::makeInstance('TBE_PageTree');
                $pagetree->thisScript=$this->thisScript;
                $pagetree->ext_pArrPages = !strcmp($pArr[3],'pages')?1:0;
+               $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
+               $pagetree->addField('nav_title');
                $tree=$pagetree->getBrowsableTree();
 
                        // Making the list of elements, if applicable:
index 14223f7..02dadd0 100644 (file)
@@ -785,6 +785,8 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                $content.=$this->addAttributesForm();
                                
                                $pagetree = t3lib_div::makeInstance('tx_rtehtmlarea_pageTree');
+                               $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
+                               $pagetree->addField('nav_title');
                                $tree=$pagetree->getBrowsableTree();
                                $cElements = $this->expandPage();
                                $content.= '