Bug #20072 » 10515.diff
typo3/class.file_list.inc (working copy) | ||
---|---|---|
var $sortRev = 1; // Reverse sorting flag
|
||
var $firstElementNumber=0;
|
||
var $clipBoard = 0;
|
||
var $bigControlPanel = 0;
|
||
// internal
|
||
var $JScode = '';
|
||
... | ... | |
* @param boolean Show clipboard flag
|
||
* @return void
|
||
*/
|
||
function start($path,$pointer,$sort,$sortRev,$clipBoard=0) {
|
||
function start($path,$pointer,$sort,$sortRev,$clipBoard=0,$bigControlPanel=0) {
|
||
$this->counter=0;
|
||
$this->totalbytes=0;
|
||
$this->JScode='';
|
||
... | ... | |
$this->sortRev=$sortRev;
|
||
$this->firstElementNumber=$pointer;
|
||
$this->clipBoard = $clipBoard;
|
||
$this->bigControlPanel = $bigControlPanel;
|
||
// setting the maximum length of the filenames to the user's settings or minimum 30 (= $this->fixedL)
|
||
$this->fixedL = max($this->fixedL, $GLOBALS['BE_USER']->uc['titleLen']);
|
||
... | ... | |
function getTable($files,$dirs,$rowlist) {
|
||
// Adds the code of files/dirs
|
||
$out='';
|
||
$titleCol = 'file';
|
||
$titleCol = 'file';
|
||
$upLevelDir = dirname(substr($files['files'][0]['path'], 0, -1)) . '/';
|
||
$levelUp = $GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($upLevelDir) ? $this->linkWrapDir('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/folder_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />', $upLevelDir) : '';
|
||
// Cleaning rowlist for duplicates and place the $titleCol as the first column always!
|
||
$rowlist = t3lib_div::rmFromList($titleCol,$rowlist);
|
||
$rowlist = t3lib_div::uniqueList($rowlist);
|
||
$rowlist = $rowlist ? $titleCol.','.$rowlist : $titleCol;
|
||
if ($this->clipBoard) $rowlist.=',_CLIPBOARD_';
|
||
if ($this->bigControlPanel || $this->clipBoard) {
|
||
$rowlist = str_replace('file,', 'file,_CLIPBOARD_,', $rowlist);
|
||
}
|
||
$this->fieldArray = explode(',',$rowlist);
|
||
// Directories are added
|
||
... | ... | |
// Header line is drawn
|
||
$theData = Array();
|
||
reset($this->fieldArray);
|
||
while(list(,$v)=each($this->fieldArray)) {
|
||
if ($v=='_CLIPBOARD_') {
|
||
|
||
foreach ($this->fieldArray as $v) {
|
||
if ($v=='_CLIPBOARD_' && $this->clipBoard) {
|
||
$cells=array();
|
||
$table='_FILE';
|
||
$elFromTable = $this->clipObj->elFromTable($table);
|
||
if (count($elFromTable)) {
|
||
if (count($elFromTable)) {
|
||
$cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('_FILE',$this->path)).'" onclick="return '.htmlspecialchars($this->clipObj->confirmMsg('_FILE',$this->path,'into',$elFromTable)).'">'.
|
||
'<img'.t3lib_iconWorks::skinImg('','gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_paste',1).'" alt="" /></a>';
|
||
}
|
||
... | ... | |
'<img'.t3lib_iconWorks::skinImg('','gfx/clip_select.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_markRecords',1).'" alt="" />'.
|
||
'</a>';
|
||
}
|
||
$theData[$v] = implode('',$cells);
|
||
} else { // Normal row:
|
||
$theT = $this->linkWrapSort($GLOBALS['LANG']->getLL('c_'.$v,1), $this->path,$v);
|
||
$theData[$v] = $theT;
|
||
}
|
||
}
|
||
$out.=$this->addelement(1,'',$theData,' class="c-headLine"','');
|
||
$out.=$this->addelement(1,$levelUp,$theData,' class="c-headLine"','');
|
||
$out.=$iOut;
|
||
// half line is drawn
|
||
... | ... | |
$theData[$field]= $this->linkWrapDir($title,$path);
|
||
break;
|
||
case '_CLIPBOARD_':
|
||
$theData[$field]=$this->makeClip($theFile);
|
||
$temp = '';
|
||
if ($this->bigControlPanel) {
|
||
$temp .= $this->makeEdit($theFile);
|
||
}
|
||
$temp .= $this->makeClip($theFile);
|
||
$theData[$field] = $temp;
|
||
break;
|
||
case '_REF_':
|
||
$theData[$field]=$this->makeRef($theFile);
|
||
... | ... | |
$theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile[$field]);
|
||
break;
|
||
case '_CLIPBOARD_':
|
||
$theData[$field]=$this->makeClip($theFile);
|
||
$temp = '';
|
||
if ($this->bigControlPanel) {
|
||
$temp .= $this->makeEdit($theFile);
|
||
}
|
||
$temp .= $this->makeClip($theFile);
|
||
$theData[$field] = $temp;
|
||
break;
|
||
case '_REF_':
|
||
$theData[$field]=$this->makeRef($theFile);
|
||
... | ... | |
}
|
||
/**
|
||
* Creates the edit control section
|
||
*
|
||
* @param array Array with information about the file/directory for which to make the edit control section for the listing.
|
||
* @return string HTML-table
|
||
*/
|
||
function makeEdit($theData) {
|
||
$cells=array();
|
||
$fullIdent = $theData['path'].$theData['file'];
|
||
//edit
|
||
$editOnClick = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'file_edit.php?target=' .
|
||
rawurlencode($fullIdent) .
|
||
'&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location);return false;';
|
||
$cells[] = '<a href="#" onclick="' . $editOnClick . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/edit.gif','width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.edit') .'" alt="" /></a>';
|
||
//rename
|
||
$editOnClick = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'file_rename.php?target=' .
|
||
rawurlencode($fullIdent) .
|
||
'&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location);return false;';
|
||
$cells[] = '<a href="#" onclick="' . $editOnClick . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/rename.gif','width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.rename') .'" alt="" /></a>';
|
||
//info
|
||
$editOnClick = 'top.launchView(\'' . $fullIdent . '\', \'\');return false;';
|
||
$cells[] = '<a href="#" onclick="' . $editOnClick . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/zoom2.gif','width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.info') . '" alt="" /></a>';
|
||
// Compile items into a DIV-element:
|
||
return ' <!-- EDIT CONTROLS: -->
|
||
<div class="typo3-editCtrl">
|
||
' . implode('
|
||
', $cells).'
|
||
</div>';
|
||
}
|
||
|
||
/**
|
||
* Make reference count
|
||
*
|
||
* @param array Array with information about the file/directory for which to make the clipboard panel for the listing.
|
typo3/file_list.php (working copy) | ||
---|---|---|
'sort' => '',
|
||
'reverse' => '',
|
||
'displayThumbs' => '',
|
||
'clipBoard' => ''
|
||
'clipBoard' => '',
|
||
'bigControlPanel' => ''
|
||
);
|
||
// CLEANSE SETTINGS
|
||
... | ... | |
// Start up filelisting object, include settings.
|
||
$this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
|
||
$this->filelist->start($this->id,$this->pointer,$this->MOD_SETTINGS['sort'],$this->MOD_SETTINGS['reverse'],$this->MOD_SETTINGS['clipBoard']);
|
||
$this->filelist->start($this->id, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
|
||
// Generate the list
|
||
$this->filelist->generateList();
|
||
... | ... | |
<div id="typo3-listOptions">
|
||
';
|
||
// Add "display bigControlPanel" checkbox:
|
||
$pageContent.=t3lib_BEfunc::getFuncCheck($this->id,'SET[bigControlPanel]',$this->MOD_SETTINGS['bigControlPanel'],'file_list.php','','id="bigControlPanel"').' <label for="bigControlPanel">'.$LANG->getLL('bigControlPanel',1).'</label><br />';
|
||
|
||
// Add "display thumbnails" checkbox:
|
||
$pageContent.=t3lib_BEfunc::getFuncCheck($this->id,'SET[displayThumbs]',$this->MOD_SETTINGS['displayThumbs'],'file_list.php','','id="checkDisplayThumbs"').' <label for="checkDisplayThumbs">'.$LANG->getLL('displayThumbs',1).'</label><br />';
|
||
typo3/stylesheet.css (working copy) | ||
---|---|---|
table#typo3-filelist tr td div.typo3-clipCtrl {
|
||
background-color: #abbbb4;
|
||
text-align: center;
|
||
float: left;
|
||
}
|
||
table#typo3-filelist tr td div.typo3-editCtrl {
|
||
background-color: #abbbb4;
|
||
text-align: center;
|
||
float: left;
|
||
padding-right: 10px;
|
||
}
|
||
/* - - - - - - - - - - - - - - - - - - - - -
|
||
Clipboard
|
typo3/sysext/lang/locallang_mod_file_list.xml (working copy) | ||
---|---|---|
</meta>
|
||
<data type="array">
|
||
<languageKey index="default" type="array">
|
||
<label index="bigControlPanel">Extended view</label>
|
||
<label index="clipBoard">Show clipboard</label>
|
||
<label index="clip_paste">Paste in clipboard content</label>
|
||
<label index="clip_pasteInto">Paste into: Clipboard content is inserted into this folder</label>
|
typo3/sysext/t3skin/stylesheets/typo3-file-list.css (working copy) | ||
---|---|---|
text-align: center;
|
||
}
|
||
table#typo3-filelist tr td div.typo3-clipCtrl {
|
||
table#typo3-filelist tr td div.typo3-clipCtrl,
|
||
table#typo3-filelist tr td div.typo3-editCtrl {
|
||
background-color:transparent;
|
||
}
|