Project

General

Profile

Feature #16482 ยป be_tca_ctrl_thumbnail.diff

Administrator Admin, 2006-08-21 13:41

View differences:

typo3_src-4.0.1-rc1/typo3/class.db_list_extra.inc 2006-08-21 13:25:48.000000000 +0200
// Init
$addWhere = '';
$titleCol = $TCA[$table]['ctrl']['label'];
$thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
$thumbsCol = explode(',', $TCA[$table]['ctrl']['thumbnail']);
$l10nEnabled = $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'];
// Cleaning rowlist for duplicates and place the $titleCol as the first column always!
......
$selectFields = $this->fieldArray;
$selectFields[] = 'uid';
$selectFields[] = 'pid';
if ($thumbsCol) $selectFields[] = $thumbsCol; // adding column for thumbnails
if ($thumbsCol) $selectFields = array_merge($selectFields, $thumbsCol); // adding columns for thumbnails
if ($table=='pages') {
if (t3lib_extMgm::isLoaded('cms')) {
$selectFields[] = 'module';
......
// Create element in table cells:
$iOut.=$this->addelement(1,$theIcon,$theData,$row_bgColor);
// Render thumbsnails if a thumbnail column exists and there is content in it:
if ($this->thumbs && trim($row[$thumbsCol])) {
$iOut.=$this->addelement(4,'', Array($titleCol=>$this->thumbCode($row,$table,$thumbsCol)),$row_bgColor);
// Render thumbsnails if one or more thumbnail columns exists and there is content in it:
if ($this->thumbs && is_array($thumbsCol) && count($thumbsCol)) {
foreach ($thumbsCol as $thumbCol) {
if (trim($row[$thumbCol])) {
$iOut.=$this->addelement(4,'', Array($titleCol=>$this->thumbCode($row,$table,$thumbCol)),$row_bgColor);
}
}
}
// 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
// Check table validity:
if ($TCA[$table]) {
t3lib_div::loadTCA($table);
$thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
$thumbsCol = explode(',', $TCA[$table]['ctrl']['thumbnail']);
// Traverse fields:
foreach($fieldArr as $fieldName) {
if ($TCA[$table]['columns'][$fieldName]) { // Each field has its own cell (if configured in TCA)
if ($fieldName==$thumbsCol) { // If the column is a thumbnail column:
if (in_array($fieldName, $thumbsCol, true)) { // If the column is a thumbnail column:
$out[$fieldName] = $this->thumbCode($row,$table,$fieldName);
} else { // ... otherwise just render the output:
$out[$fieldName] = nl2br(htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fieldName,$row[$fieldName],0,0,0,$row['uid']),250))));
    (1-1/1)