Bug #20072 » 10515_v3.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']);
|
||
... | ... | |
// Adds the code of files/dirs
|
||
$out='';
|
||
$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'];
|
||
$canEdit = t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $theData['realFileext']);
|
||
|
||
// prepare space icon
|
||
$iconWidth = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeWidth'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeWidth'] : 12;
|
||
$iconHeight = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeHeight'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeHeight'] : 12;
|
||
$spaceIcon = '<img src="' . $this->backPath . 'clear.gif" width="' . $iconWidth . '" height="' . $iconHeight . '" title="" alt="" />';
|
||
|
||
//edit
|
||
if ($theData['type'] == 'dir' || !$canEdit) {
|
||
$cells['edit'] = $spaceIcon;
|
||
} else {
|
||
$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['edit'] = '<a href="#" onclick="' . $editOnClick . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/edit.gif', 'width="' . $iconWidth . '" height="' . $iconHeight . '"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.edit') . '" alt="" /></a>';
|
||
}
|
||
//rename
|
||
$renameOnClick = '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['rename'] = '<a href="#" onclick="' . $renameOnClick . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/rename.gif', 'width="' . $iconWidth . '" height="' . $iconHeight . '"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.rename') . '" alt="" /></a>';
|
||
//info
|
||
$infoOnClick = 'top.launchView(\'' . $fullIdent . '\', \'\');return false;';
|
||
$cells['info'] = '<a href="#" onclick="' . $infoOnClick . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/zoom2.gif', 'width="' . $iconWidth . '" height="' . $iconHeight . '"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.info') . '" alt="" /></a>';
|
||
// Hook for manipulating edit icons.
|
||
if(is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'])) {
|
||
foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $classData) {
|
||
$hookObject = &t3lib_div::getUserObj($classData);
|
||
if(!($hookObject instanceof fileList_editIconHook)) {
|
||
throw new UnexpectedValueException('$hookObject must implement interface fileList_editIconHook', 1235225797);
|
||
}
|
||
$hookObject->manipulateEditIcons($cells, $this);
|
||
}
|
||
}
|
||
|
||
// 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/interfaces/interface.filelist_editiconshook.php (revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2008 Steffen Kamper <info@sk-typo3.de>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* interface for classes which hook into file list module and manipulateds edit icon array
|
||
*
|
||
* @author Steffen Kamper <info@sk-typo3.de>
|
||
* @package TYPO3
|
||
* @subpackage cms
|
||
*/
|
||
interface fileList_editIconHook {
|
||
/**
|
||
* modifies edit icon array
|
||
*
|
||
* @param array array of edit icons
|
||
* @param fileList parent object
|
||
* @return void
|
||
*/
|
||
public function manipulateEditIcons(&$cells, &$parentObject);
|
||
}
|
||
?>
|
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;
|
||
}
|