2006-08-31 Ernesto Baschny <ernst@cron-it.de>
authorErnesto Baschny <ernst@cron-it.de>
Thu, 31 Aug 2006 10:51:41 +0000 (10:51 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Thu, 31 Aug 2006 10:51:41 +0000 (10:51 +0000)
* Feature #4131: Respects label_alt setting in some more places (especially labels pointing to MM tables)

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1703 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_loaddbgroup.php
t3lib/class.t3lib_tceforms.php
typo3/class.browse_links.php

index f4629cd..819178b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-08-31  Ernesto Baschny <ernst@cron-it.de>
+
+       * Feature #4131: Respects label_alt setting in some more places (especially labels pointing to MM tables)
+
 2006-08-31  Wolfgang Klinger <wolfgang@stufenlos.net>
 
        * Feature #3026: Text change for the 'Quality' label
index e5c21f4..3b92753 100755 (executable)
@@ -1863,9 +1863,17 @@ class t3lib_BEfunc       {
                                case 'select':
                                        if ($theColConf['MM'])  {
                                                        // Display the title of MM related records in lists
-                                                       $MMfield = $noRecordLookup?'uid':$TCA[$theColConf['foreign_table']]['ctrl']['label'];
+                                                       if ($noRecordLookup)    {
+                                                               $MMfield = $theColConf['foreign_table'].'.uid';
+                                                       } else  {
+                                                               $MMfields = array($theColConf['foreign_table'].'.'.$TCA[$theColConf['foreign_table']]['ctrl']['label']);
+                                                               foreach (t3lib_div::trimExplode(',', $TCA[$theColConf['foreign_table']]['ctrl']['label_alt'], 1) as $f) {
+                                                                       $MMfields[] = $theColConf['foreign_table'].'.'.$f;
+                                                               }
+                                                               $MMfield = join(',',$MMfields);
+                                                       }
                                                        $MMres = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
-                                                               $theColConf['foreign_table'].'.'.$MMfield,
+                                                               $MMfield,
                                                                ($table!=$theColConf['foreign_table']?$table:''),
                                                                $theColConf['MM'],
                                                                $theColConf['foreign_table'],
@@ -1873,10 +1881,10 @@ class t3lib_BEfunc      {
                                                        );
                                                if ($MMres) {
                                                        while($MMrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMres))   {
-                                                               $mmlA[] = $MMrow[$MMfield];
+                                                               $mmlA[] = ($noRecordLookup?$MMrow['uid']:t3lib_BEfunc::getRecordTitle($theColConf['foreign_table'], $MMrow));
                                                        }
                                                        if (is_array($mmlA)) {
-                                                               $l=implode(', ',$mmlA);
+                                                               $l=implode('; ',$mmlA);
                                                        } else {
                                                                $l = '';
                                                        }
index 94a48ff..c370e66 100755 (executable)
@@ -310,6 +310,9 @@ class t3lib_loadDBGroup     {
                                                if ($GLOBALS['TCA'][$key]['ctrl']['label'])     {
                                                        $from.= ','.$GLOBALS['TCA'][$key]['ctrl']['label'];     // Titel
                                                }
+                                               if ($GLOBALS['TCA'][$key]['ctrl']['label_alt']) {
+                                                       $from.= ','.$GLOBALS['TCA'][$key]['ctrl']['label_alt']; // Alternative Title-Fields
+                                               }
                                                if ($GLOBALS['TCA'][$key]['ctrl']['thumbnail']) {
                                                        $from.= ','.$GLOBALS['TCA'][$key]['ctrl']['thumbnail']; // Thumbnail
                                                }
@@ -342,7 +345,7 @@ class t3lib_loadDBGroup     {
                foreach($this->itemArray as $key => $val)       {
                        $theRow = $this->results[$val['table']][$val['id']];
                        if ($theRow && is_array($TCA[$val['table']]))   {
-                               $label = t3lib_div::fixed_lgd_cs(strip_tags($theRow[$TCA[$val['table']]['ctrl']['label']]),$titleLen);
+                               $label = t3lib_div::fixed_lgd_cs(strip_tags(t3lib_BEfunc::getRecordTitle($val['table'], $theRow)),$titleLen);
                                $label = ($label)?$label:'[...]';
                                $output[]=str_replace(',','',$val['table'].'_'.$val['id'].'|'.rawurlencode($label));
                        }
index ac50990..ac1e8b9 100755 (executable)
@@ -2947,7 +2947,7 @@ class t3lib_TCEforms      {
                                        while(list(,$pp)=each($itemArray))      {
                                                $pRec = t3lib_BEfunc::getRecordWSOL($pp['table'],$pp['id']);
                                                if (is_array($pRec))    {
-                                                       $pTitle = t3lib_div::fixed_lgd_cs($this->noTitle($pRec[$GLOBALS['TCA'][$pp['table']]['ctrl']['label']]),$this->titleLen);
+                                                       $pTitle = t3lib_div::fixed_lgd_cs($this->noTitle(t3lib_BEfunc::getRecordTitle($pp['table'], $pRec)),$this->titleLen);
                                                        $pUid = $pp['table'].'_'.$pp['id'];
                                                        $uidList[]=$pUid;
                                                        $opt[]='<option value="'.htmlspecialchars($pUid).'">'.htmlspecialchars($pTitle).'</option>';
index eea9726..0a08299 100755 (executable)
@@ -218,9 +218,7 @@ class TBE_browser_recordList extends localRecordList {
                        $code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code,$this->fixedL));
                }
 
-               $titleCol = $TCA[$table]['ctrl']['label'];
-               $title = $row[$titleCol];
-
+               $title = t3lib_BEfunc::getRecordTitle($table,$row);
                $ficon = t3lib_iconWorks::getIcon($table,$row);
                $aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', ".t3lib_div::quoteJSvalue($title).", '', '', '".$ficon."');";
                $ATag = '<a href="#" onclick="'.$aOnClick.'">';