be_tca_ctrl_thumbnail.diff

Administrator Admin, 2006-08-21 13:41

Download (3.1 KB)

View differences:

typo3_src-4.0.1-rc1/typo3/class.db_list_extra.inc 2006-08-21 13:25:48.000000000 +0200
310 310
			// Init
311 311
		$addWhere = '';
312 312
		$titleCol = $TCA[$table]['ctrl']['label'];
313
		$thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
313
		$thumbsCol = explode(',', $TCA[$table]['ctrl']['thumbnail']);
314 314
		$l10nEnabled = $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'];
315 315

  
316 316
			// Cleaning rowlist for duplicates and place the $titleCol as the first column always!
......
346 346
		$selectFields = $this->fieldArray;
347 347
		$selectFields[] = 'uid';
348 348
		$selectFields[] = 'pid';
349
		if ($thumbsCol)	$selectFields[] = $thumbsCol;	// adding column for thumbnails
349
		if ($thumbsCol)	$selectFields = array_merge($selectFields, $thumbsCol);	// adding columns for thumbnails
350 350
		if ($table=='pages')	{
351 351
			if (t3lib_extMgm::isLoaded('cms'))	{
352 352
				$selectFields[] = 'module';
......
636 636
			// Create element in table cells:
637 637
		$iOut.=$this->addelement(1,$theIcon,$theData,$row_bgColor);
638 638

  
639
			// Render thumbsnails if a thumbnail column exists and there is content in it:
640
		if ($this->thumbs && trim($row[$thumbsCol]))	{
641
			$iOut.=$this->addelement(4,'', Array($titleCol=>$this->thumbCode($row,$table,$thumbsCol)),$row_bgColor);
639
			// Render thumbsnails if one or more thumbnail columns exists and there is content in it:
640
		if ($this->thumbs && is_array($thumbsCol) && count($thumbsCol)) {
641
			foreach ($thumbsCol as $thumbCol) {
642
				if (trim($row[$thumbCol])) {
643
					$iOut.=$this->addelement(4,'', Array($titleCol=>$this->thumbCode($row,$table,$thumbCol)),$row_bgColor);
644
				}
645
			}
642 646
		}
643 647

  
644 648
			// Finally, return table row element:
typo3_src-4.0.1-rc1/typo3/sysext/cms/layout/class.tx_cms_layout.php 2006-08-21 13:23:34.470346504 +0200
1227 1227
			// Check table validity:
1228 1228
		if ($TCA[$table])	{
1229 1229
			t3lib_div::loadTCA($table);
1230
			$thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
1230
			$thumbsCol = explode(',', $TCA[$table]['ctrl']['thumbnail']);
1231 1231

  
1232 1232
				// Traverse fields:
1233 1233
			foreach($fieldArr as $fieldName)	{
1234 1234

  
1235 1235
				if ($TCA[$table]['columns'][$fieldName])	{	// Each field has its own cell (if configured in TCA)
1236
					if ($fieldName==$thumbsCol)	{	// If the column is a thumbnail column:
1236
					if (in_array($fieldName, $thumbsCol, true))	{	// If the column is a thumbnail column:
1237 1237
						$out[$fieldName] = $this->thumbCode($row,$table,$fieldName);
1238 1238
					} else {	// ... otherwise just render the output:
1239 1239
						$out[$fieldName] = nl2br(htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fieldName,$row[$fieldName],0,0,0,$row['uid']),250))));