--- TYPO3core_t3dd/typo3/class.db_list_extra.inc 2006-08-11 17:06:18.000000000 +0200 +++ TYPO3core_testing/typo3/class.db_list_extra.inc 2006-08-11 19:46:52.000000000 +0200 @@ -97,7 +97,7 @@ var $dontShowClipControlPanels=FALSE; // If true, will disable the rendering of clipboard + control panels. var $showClipboard=FALSE; // If true, will show the clipboard in the field list. - var $noControlPanels = FALSE; // If true, will DISABLE all control panels in lists. (Takes precedence) + var $noControlPanels = FALSE; // If true, will DISABLE all control panels in lists. (Takes precedence) var $clickMenuEnabled = TRUE; // If true, clickmenus will be rendered @@ -321,8 +321,8 @@ $this->fieldArray[] = '_LOCALIZATION_b'; $addWhere.=' AND ( '.$TCA[$table]['ctrl']['languageField'].'<=0 - OR - '.$TCA[$table]['ctrl']['transOrigPointerField'].' = 0 + OR + '.$TCA[$table]['ctrl']['transOrigPointerField'].'=0 )'; } if (!t3lib_div::inList($rowlist,'_CONTROL_')) { @@ -480,8 +480,10 @@ $iOut = ''; $cc = 0; - foreach($accRows as $row) { + $alreadyShownRecords = array(); // find records which are orphaned (localized records which don't have an unlocalized version) } + foreach($accRows as $row) { + $alreadyShownRecords[] = $row['uid']; // Forward/Backwards navigation links: list($flag,$code) = $this->fwd_rwd_nav($table); $iOut.=$code; @@ -509,6 +511,7 @@ if (is_array($translations)) { foreach($translations as $lRow) { if ($GLOBALS['BE_USER']->checkLanguageAccess($lRow[$TCA[$table]['ctrl']['languageField']])) { + $alreadyShownRecords[] = $lRow['uid']; $iOut.=$this->renderListRow($table,$lRow,$cc,$titleCol,$thumbsCol,18); } } @@ -520,6 +523,30 @@ $this->eCounter++; } + // Check if there are orphaned records + if ($this->localizationView && $l10nEnabled) { + if(!count($listOfLocalisedRecords)) // prevent an empty NOT IN () clause + $alreadyShownRecords[] = -1; + $orphanedRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( + $selFieldList, + $table, + 'pid='.$row['pid']. + ' AND '.$TCA[$table]['ctrl']['languageField'].'>0'. + ' AND uid NOT IN ('.implode(',', $alreadyShownRecords).')'. + t3lib_BEfunc::deleteClause($table). + t3lib_BEfunc::versioningPlaceholderClause($table) + ); + + // Display each orphaned record + if (is_array($orphanedRecords)) { + foreach($orphanedRecords as $lRow) { + if ($GLOBALS['BE_USER']->checkLanguageAccess($lRow[$TCA[$table]['ctrl']['languageField']])) { + $iOut.=$this->renderListRow($table,$lRow,$cc,$titleCol,$thumbsCol,0,1); + } + } + } + } + // The header row for the table is now created: $out.=$this->renderListHeader($table,$currentIdList); } @@ -556,11 +583,13 @@ * @param string Table field (column) where header value is found * @param string Table field (column) where (possible) thumbnails can be found * @param integer Indent from left. + * @param boolean set to true if the record is orphaned * @return string Table row for the element * @access private * @see getTable() */ - function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0) { + function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0,$orphaned=0) { + global $LANG; $iOut = ''; if (strlen($this->searchString)) { // If in search mode, make sure the preview will show the correct page @@ -580,6 +609,10 @@ // Overriding with versions background color if any: $row_bgColor = $row['_CSSCLASS'] ? ' class="'.$row['_CSSCLASS'].'"' : $row_bgColor; + // Overriding the color if orphaned + if ($orphaned) + $row_bgColor = 'class="bgColor6"'; + // Initialization $alttext = t3lib_BEfunc::getRecordIconAltText($row,$table); $recTitle = t3lib_BEfunc::getRecordTitle($table,$row); @@ -609,6 +642,8 @@ $recTitle = t3lib_BEfunc::getProcessedValueExtra($table,$fCol,$row[$fCol],$GLOBALS['BE_USER']->uc['titleLen'],$row['uid']); } $theData[$fCol] = $this->linkWrapItems($table,$row['uid'],$recTitle,$row); + if ($orphaned) + $theData[$fCol] = '' . $theData[$fCol]; } elseif ($fCol=='pid') { $theData[$fCol]=$row[$fCol]; } elseif ($fCol=='_PATH_') { Nur in TYPO3core_testing/typo3: class.db_list_extra.inc~. Nur in TYPO3core_testing/typo3: .class.db_list_extra.inc.marks. diff -ru --exclude=.svn TYPO3core_t3dd/typo3/sysext/lang/locallang_core.xml TYPO3core_testing/typo3/sysext/lang/locallang_core.xml --- TYPO3core_t3dd/typo3/sysext/lang/locallang_core.xml 2006-08-11 16:35:14.000000000 +0200 +++ TYPO3core_testing/typo3/sysext/lang/locallang_core.xml 2006-08-11 19:44:11.000000000 +0200 @@ -132,6 +132,7 @@ + Nur in TYPO3core_testing/typo3/sysext/lang: locallang_core.xml~.