Project

General

Profile

Bug #21856 ยป bug13029.diff

Administrator Admin, 2009-12-13 17:04

View differences:

typo3/class.db_list_extra.inc (Arbeitskopie)
function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0) {
$iOut = '';
if (strlen($this->searchString)) { // If in search mode, make sure the preview will show the correct page
$id_orig = $this->id;
$this->id = $row['pid'];
}
if (!$this->csvOutput) {
// Take this branch when no CSV output
if (strlen($this->searchString)) { // If in search mode, make sure the preview will show the correct page
$id_orig = $this->id;
$this->id = $row['pid'];
}
if (is_array($row)) {
if (is_array($row)) {
$this->setReferences($table, $row['uid']);
// add special classes for first and last row
$rowSpecial = '';
if ($cc == 1 && $indent == 0) {
$rowSpecial .= ' firstcol';
}
if ($cc == $this->totalRowCount || $cc == $this->iLimit) {
$rowSpecial .= ' lastcol';
}
$this->setReferences($table, $row['uid']);
// add special classes for first and last row
$rowSpecial = '';
if ($cc == 1 && $indent == 0) {
$rowSpecial .= ' firstcol';
}
if ($cc == $this->totalRowCount || $cc == $this->iLimit) {
$rowSpecial .= ' lastcol';
}
// Background color, if any:
if ($this->alternateBgColors) {
$row_bgColor = ($cc%2) ? ' class="db_list_normal'.$rowSpecial.'"' : ' class="db_list_alt'.$rowSpecial.'"';
} else {
$row_bgColor = ' class="db_list_normal'.$rowSpecial.'"';
}
// Overriding with versions background color if any:
$row_bgColor = $row['_CSSCLASS'] ? ' class="'.$row['_CSSCLASS'].'"' : $row_bgColor;
// Background color, if any:
if ($this->alternateBgColors) {
$row_bgColor = ($cc%2) ? ' class="db_list_normal'.$rowSpecial.'"' : ' class="db_list_alt'.$rowSpecial.'"';
} else {
$row_bgColor = ' class="db_list_normal'.$rowSpecial.'"';
}
// Overriding with versions background color if any:
$row_bgColor = $row['_CSSCLASS'] ? ' class="'.$row['_CSSCLASS'].'"' : $row_bgColor;
// Incr. counter.
$this->counter++;
// Incr. counter.
$this->counter++;
// The icon with link
$alttext = t3lib_BEfunc::getRecordIconAltText($row,$table);
$iconImg = t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.htmlspecialchars($alttext).'"'.($indent ? ' style="margin-left: '.$indent.'px;"' : ''));
$theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,$table,$row['uid']) : $iconImg;
// The icon with link
$alttext = t3lib_BEfunc::getRecordIconAltText($row,$table);
$iconImg = t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.htmlspecialchars($alttext).'"'.($indent ? ' style="margin-left: '.$indent.'px;"' : ''));
$theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,$table,$row['uid']) : $iconImg;
// Preparing and getting the data-array
$theData = Array();
foreach($this->fieldArray as $fCol) {
if ($fCol==$titleCol) {
$recTitle = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
// If the record is edit-locked by another user, we will show a little warning sign:
if (($lockInfo = t3lib_BEfunc::isRecordLocked($table, $row['uid']))) {
$warning = '<a href="#" onclick="' . htmlspecialchars('alert(' . $GLOBALS['LANG']->JScharCode($lockInfo['msg']) . '); return false;') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/recordlock_warning3.gif', 'width="17" height="12"') . ' title="' . htmlspecialchars($lockInfo['msg']) . '" alt="" />' .
'</a>';
}
$theData[$fCol] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
// Preparing and getting the data-array
$theData = Array();
foreach($this->fieldArray as $fCol) {
if ($fCol==$titleCol) {
$recTitle = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
// If the record is edit-locked by another user, we will show a little warning sign:
if (($lockInfo = t3lib_BEfunc::isRecordLocked($table, $row['uid']))) {
$warning = '<a href="#" onclick="' . htmlspecialchars('alert(' . $GLOBALS['LANG']->JScharCode($lockInfo['msg']) . '); return false;') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/recordlock_warning3.gif', 'width="17" height="12"') . ' title="' . htmlspecialchars($lockInfo['msg']) . '" alt="" />' .
'</a>';
}
$theData[$fCol] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
$localizationMarkerClass = '';
if (isset($GLOBALS['TCA'][$table]['ctrl']['languageField'])
&& $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] != 0) {
// it's a translated record
$localizationMarkerClass = ' localization';
$localizationMarkerClass = '';
if (isset($GLOBALS['TCA'][$table]['ctrl']['languageField'])
&& $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] != 0) {
// it's a translated record
$localizationMarkerClass = ' localization';
}
} elseif ($fCol == 'pid') {
$theData[$fCol]=$row[$fCol];
} elseif ($fCol == '_PATH_') {
$theData[$fCol]=$this->recPath($row['pid']);
} elseif ($fCol == '_REF_') {
$theData[$fCol]=$this->makeRef($table,$row['uid']);
} elseif ($fCol == '_CONTROL_') {
$theData[$fCol]=$this->makeControl($table,$row);
} elseif ($fCol == '_AFTERCONTROL_' || $fCol == '_AFTERREF_') {
$theData[$fCol] = '&nbsp;';
} elseif ($fCol == '_CLIPBOARD_') {
$theData[$fCol]=$this->makeClip($table,$row);
} elseif ($fCol == '_LOCALIZATION_') {
list($lC1, $lC2) = $this->makeLocalizationPanel($table,$row);
$theData[$fCol] = $lC1;
$theData[$fCol.'b'] = $lC2;
} elseif ($fCol == '_LOCALIZATION_b') {
// Do nothing, has been done above.
} else {
$tmpProc = t3lib_BEfunc::getProcessedValueExtra($table, $fCol, $row[$fCol], 100, $row['uid']);
$theData[$fCol] = $this->linkUrlMail(htmlspecialchars($tmpProc), $row[$fCol]);
$row[$fCol] = $tmpProc;
}
} elseif ($fCol == 'pid') {
$theData[$fCol]=$row[$fCol];
} elseif ($fCol == '_PATH_') {
$theData[$fCol]=$this->recPath($row['pid']);
} elseif ($fCol == '_REF_') {
$theData[$fCol]=$this->makeRef($table,$row['uid']);
} elseif ($fCol == '_CONTROL_') {
$theData[$fCol]=$this->makeControl($table,$row);
} elseif ($fCol == '_AFTERCONTROL_' || $fCol == '_AFTERREF_') {
$theData[$fCol] = '&nbsp;';
} elseif ($fCol == '_CLIPBOARD_') {
$theData[$fCol]=$this->makeClip($table,$row);
} elseif ($fCol == '_LOCALIZATION_') {
list($lC1, $lC2) = $this->makeLocalizationPanel($table,$row);
$theData[$fCol] = $lC1;
$theData[$fCol.'b'] = $lC2;
} elseif ($fCol == '_LOCALIZATION_b') {
// Do nothing, has been done above.
} else {
$tmpProc = t3lib_BEfunc::getProcessedValueExtra($table, $fCol, $row[$fCol], 100, $row['uid']);
$theData[$fCol] = $this->linkUrlMail(htmlspecialchars($tmpProc), $row[$fCol]);
$row[$fCol] = $tmpProc;
}
}
if (strlen($this->searchString)) { // Reset the ID if it was overwritten
$this->id = $id_orig;
}
if (strlen($this->searchString)) { // Reset the ID if it was overwritten
$this->id = $id_orig;
}
// Add row to CSV list:
if ($this->csvOutput) {
$this->addToCSV($row,$table);
}
// Add classes to table cells
$this->addElement_tdCssClass[$titleCol] = 'col-title' . $localizationMarkerClass;
if (!$this->dontShowClipControlPanels) {
$this->addElement_tdCssClass['_CONTROL_'] = 'col-control';
$this->addElement_tdCssClass['_AFTERCONTROL_'] = 'col-control-space';
$this->addElement_tdCssClass['_CLIPBOARD_'] = 'col-clipboard';
}
$this->addElement_tdCssClass['_PATH_'] = 'col-path';
$this->addElement_tdCssClass['_LOCALIZATION_'] = 'col-localizationa';
$this->addElement_tdCssClass['_LOCALIZATION_b'] = 'col-localizationb';
// Add classes to table cells
$this->addElement_tdCssClass[$titleCol] = 'col-title' . $localizationMarkerClass;
if (!$this->dontShowClipControlPanels) {
$this->addElement_tdCssClass['_CONTROL_'] = 'col-control';
$this->addElement_tdCssClass['_AFTERCONTROL_'] = 'col-control-space';
$this->addElement_tdCssClass['_CLIPBOARD_'] = 'col-clipboard';
}
$this->addElement_tdCssClass['_PATH_'] = 'col-path';
$this->addElement_tdCssClass['_LOCALIZATION_'] = 'col-localizationa';
$this->addElement_tdCssClass['_LOCALIZATION_b'] = 'col-localizationb';
// Create element in table cells:
$iOut.=$this->addelement(1,$theIcon,$theData,$row_bgColor);
// 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 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);
}
// Finally, return table row element:
return $iOut;
// Finally, return table row element:
return $iOut;
}
} else {
// Add row to CSV list:
$this->addToCSV($row,$table);
return;
}
}
    (1-1/1)