Project

General

Profile

Feature #19575 » class.file_list.inc.diff

Administrator Admin, 2008-11-05 21:55

View differences:

typo3/class.file_list.inc (working copy)
// half line is drawn
$theData = Array();
$theData[$titleCol] = '';
$iOut.=$this->addelement(0,'',$theData);
}
......
<!--
File list table:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-filelist">
<table border="0" cellpadding="0" cellspacing="1" id="typo3-filelist">
'.$out.'
</table>';
}
......
* @return string HTML table rows.
*/
function formatDirList($items) {
$out='';
$out = '';
// Files:
if (count($items['sorting'])) {
reset($items['sorting']);
while (list($key,) = each($items['sorting'])) {
list($flag,$code) = $this->fwd_rwd_nav();
$out.=$code;
if ($flag) {
// Initialization
// Folders:
if (count($items['sorting'])) {
foreach ($items['sorting'] as $key => $val) {
list($flag, $code) = $this->fwd_rwd_nav();
$out .= $code;
if ($flag) {
// Initialization
$theFile = $items['files'][$key];
$this->counter++;
list($title,$icon,$path) = $this->dirData($theFile);
list($title, $icon, $path) = $this->dirData($theFile);
// The icon with link
$theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
// The icon with link
$theIcon = '<img' . t3lib_iconWorks::skinImg($this->backPath, $icon, 'width="18" height="16"') . ' title="' . htmlspecialchars($theFile['file']) . '" alt="" />';
if ($this->clickMenus) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon, $path);
}
// Preparing and getting the data-array
// Preparing and getting the data-array
$theData = Array();
reset($this->fieldArray);
while(list(,$field)=each($this->fieldArray)) {
switch($field) {
foreach ($this->fieldArray as $key => $field) {
switch($field) {
case 'size':
// $theData[$field]=t3lib_div::formatSize($theFile[$field]);
$theData[$field] = t3lib_div::formatSize($theFile[$field]);
break;
case 'rw':
$theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
$theData[$field] = (($theFile['readable']) ? '' : '<span class="typo3-red"><b>R</b></span>') . (($theFile['writable']) ? '' : '<span class="typo3-red"><b>W</b></span>');
break;
case 'fileext':
// $theData[$field]=strtoupper($theFile['fileext']);
$theData[$field] = strtoupper($theFile['fileext']);
break;
case 'tstamp':
$theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile['tstamp']);
$theData[$field] = Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile['tstamp']);
break;
case 'file':
$theData[$field]= $this->linkWrapDir($title,$path);
$theData[$field] = $this->linkWrapDir($title, $path);
break;
case '_CLIPBOARD_':
$theData[$field]=$this->makeClip($theFile);
$theData[$field] = $this->makeClip($theFile);
break;
case '_REF_':
$theData[$field]=$this->makeRef($theFile);
$theData[$field] = $this->makeRef($theFile);
break;
default:
$theData[$field]=t3lib_div::fixed_lgd($theFile[$field],$this->fixedL);
break;
$theData[$field] = t3lib_div::fixed_lgd($theFile[$field], $this->fixedL);
}
}
$out.=$this->addelement(1,$theIcon,$theData);
$altRow = 'class="' . ($i++ % 2 == 0 ? 'bgColor6' : 'bgColor4') . '"';
$out .= $this->addelement(1, $theIcon, $theData, $altRow);
}
$this->eCounter++;
}
......
* @param array File items
* @return string HTML table rows.
*/
function formatFileList($items) {
$out='';
function formatFileList($items) {
$out = '';
// Files:
if (count($items['sorting'])) {
reset($items['sorting']);
while (list($key,) = each($items['sorting'])) {
list($flag,$code) = $this->fwd_rwd_nav();
$out.=$code;
if ($flag) {
// Initialization
// Files:
if (count($items['sorting'])) {
foreach ($items['sorting'] as $key => $val) {
list($flag, $code) = $this->fwd_rwd_nav();
$out .= $code;
if ($flag) {
// Initialization
$theFile = $items['files'][$key];
$this->counter++;
$this->totalbytes+=$theFile['size'];
$this->totalbytes += $theFile['size'];
$ext = $items['files'][$key][fileext];
$icon = t3lib_BEfunc::getFileIcon($ext);
// The icon with link
$theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/fileicons/'.$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$theFile['path'].$theFile['file']);
// The icon with link
$theIcon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/fileicons/' . $icon, 'width="18" height="16"') . ' title="' . htmlspecialchars($theFile['file']) . '" alt="" />';
if ($this->clickMenus) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon, $theFile['path'] . $theFile['file']);
}
// Preparing and getting the data-array
// Preparing and getting the data-array
$theData = Array();
reset($this->fieldArray);
while(list(,$field)=each($this->fieldArray)) {
switch($field) {
foreach ($this->fieldArray as $key => $field) {
switch($field) {
case 'size':
$theData[$field]=t3lib_div::formatSize($theFile[$field]);
$theData[$field] = t3lib_div::formatSize($theFile[$field]);
break;
case 'rw':
$theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
$theData[$field] = (($theFile['readable']) ? '' : '<span class="typo3-red"><b>R</b></span>') . (($theFile['writable']) ? '' : '<span class="typo3-red"><b>W</b></span>');
break;
case 'fileext':
$theData[$field]=strtoupper($theFile[$field]);
$theData[$field] = strtoupper($theFile[$field]);
break;
case 'tstamp':
$theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile[$field]);
$theData[$field] = Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile[$field]);
break;
case '_CLIPBOARD_':
$theData[$field]=$this->makeClip($theFile);
$theData[$field] = $this->makeClip($theFile);
break;
case '_REF_':
$theData[$field]=$this->makeRef($theFile);
$theData[$field] = $this->makeRef($theFile);
break;
case 'file':
$theData[$field] = $this->linkWrapFile($theFile[$field],$theFile['path'].$theFile['file']);
$theData[$field] = $this->linkWrapFile($theFile[$field],$theFile['path'] . $theFile['file']);
break;
default:
$theData[$field]=t3lib_div::fixed_lgd($theFile[$field],$this->fixedL);
break;
$theData[$field] = t3lib_div::fixed_lgd($theFile[$field], $this->fixedL);
}
}
$out.= $this->addelement(1,$theIcon,$theData);
$altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '"';
$out .= $this->addelement(1, $theIcon, $theData, $altRows);
// Thumbsnails?
if ($this->thumbs && $this->isImage($theFile['fileext'])) {
// Thumbsnails?
if ($this->thumbs && $this->isImage($theFile['fileext'])) {
$thumbData = array();
$theFile_R = rawurlencode($theFile['path'].$theFile['file']);
$theFile_R = rawurlencode($theFile['path'] . $theFile['file']);
$titleCol = $this->fieldArray[0];
$theFile_abs = $theFile['path'].$theFile['file'];
$check = basename($theFile_abs).':'.filemtime($theFile_abs).':'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
$params = '&file='.$theFile_R;
$params.= '&md5sum='.t3lib_div::shortMD5($check);
$href = $this->backPath.$this->thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
$theFile_abs = $theFile['path'] . $theFile['file'];
$check = basename($theFile_abs) . ':' . filemtime($theFile_abs) . ':' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
$params = '&file=' . $theFile_R;
$params .= '&md5sum=' . t3lib_div::shortMD5($check);
$href = $this->backPath . $this->thumbScript . '?&dummy=' . $GLOBALS['EXEC_TIME'] . $params;
$thumbData[$titleCol]='<img src="'.htmlspecialchars($href).'" hspace="2" title="'.htmlspecialchars(trim($theFile['file'])).'" alt="" />';
$out.= $this->addelement(4,'',$thumbData);
$thumbData[$titleCol] = '<img src="' . htmlspecialchars($href) . '" hspace="2" title="' . htmlspecialchars(trim($theFile['file'])) . '" alt="" />';
$out .= $this->addelement(4, '', $thumbData);
}
}
$this->eCounter++;
(4-4/7)