Show domain name in the page tree if is_siteroot is set for page and "options.pageTre...
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 29 Aug 2006 16:33:55 +0000 (16:33 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 29 Aug 2006 16:33:55 +0000 (16:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1696 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_browsetree.php

index a1c4993..e87f7ff 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2006-08-29  Dmitry Dulepov  <typo3@accio.lv>
 
        * Performance enhancement in t3lib/class.t3lib_tstemplate.php: use UPDATE/INSERT_on_update_fail instead of DELETE/INSERT for cache_pagesection.
+       * Show domain name in the page tree if is_siteroot is set for page and "options.pageTree.showDomainNameWithTitle" is set in user TSConfig
 
 2006-08-25  Michael Stucki  <michael@typo3.org>
 
index 0779a58..64f525c 100755 (executable)
@@ -42,8 +42,9 @@
  *   83:     function init($clause='')
  *  116:     function getTitleAttrib($row)
  *  128:     function wrapIcon($icon,$row)
+ *  150:     function getTitleStr($row,$titleLen=30)
  *
- * TOTAL FUNCTIONS: 3
+ * TOTAL FUNCTIONS: 4
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -61,7 +62,6 @@ require_once (PATH_t3lib.'class.t3lib_treeview.php');
 
 
 
-
 /**
  * Extension class for the t3lib_treeView class, specially made for browsing pages
  *
@@ -102,7 +102,7 @@ class t3lib_browseTree extends t3lib_treeView {
 
                $this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop','t3ver_id','t3ver_state','t3ver_wsid','t3ver_swapmode'));
                if (t3lib_extMgm::isLoaded('cms'))      {
-                       $this->fieldArray = array_merge($this->fieldArray,array('hidden','starttime','endtime','fe_group','module','extendToSubpages'));
+                       $this->fieldArray = array_merge($this->fieldArray,array('hidden','starttime','endtime','fe_group','module','extendToSubpages', 'is_siteroot'));
                }
        }
 
@@ -138,6 +138,26 @@ class t3lib_browseTree extends t3lib_treeView {
                }
                return $theIcon;
        }
+
+       /**
+        * Returns the title for the input record. If blank, a "no title" labele (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)
+        * @param       integer         Title length (30)
+        * @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 (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);
+                       if (is_array($rows) && count($rows) > 0) {
+                               $title = sprintf('%s [%s]', $title, $rows[0]['domainName']);
+                       }
+               }
+               return $title;
+       }
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php'])       {