00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 class fileList extends t3lib_recordList {
00076 var $iLimit = 40;
00077 var $thumbs = 0;
00078 var $widthGif = '<img src="clear.gif" width="1" height="1" hspace="165" alt="" />';
00079 var $fixedL = 30;
00080 var $script = 'file_list.php';
00081 var $clickMenus=1;
00082
00083 var $sort = '';
00084 var $sortRev = 1;
00085 var $firstElementNumber=0;
00086 var $clipBoard = 0;
00087 var $bigControlPanel = 0;
00088
00089
00090 var $JScode = '';
00091 var $HTMLcode = '';
00092 var $totalbytes=0;
00093 var $dirs = Array();
00094 var $files = Array();
00095 var $path = '';
00096 var $eCounter=0;
00097 var $dirCounter = 0;
00098 var $totalItems='';
00099
00100 var $CBnames=array();
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 function start($path, $pointer, $sort, $sortRev, $clipBoard=0, $bigControlPanel=0) {
00115 $this->counter=0;
00116 $this->totalbytes=0;
00117 $this->JScode='';
00118 $this->HTMLcode='';
00119 $this->path = $path;
00120 $this->sort=$sort;
00121 $this->sortRev=$sortRev;
00122 $this->firstElementNumber=$pointer;
00123 $this->clipBoard = $clipBoard;
00124 $this->bigControlPanel = $bigControlPanel;
00125
00126 $this->fixedL = max($this->fixedL, $GLOBALS['BE_USER']->uc['titleLen']);
00127
00128 if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails']) {
00129 $this->thumbScript='gfx/notfound_thumb.gif';
00130 }
00131 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_common.xml');
00132 }
00133
00134
00135
00136
00137
00138
00139 function generateList() {
00140 $this->dirs = $this->readDirectory($this->path,'dir,link');
00141 $this->files = $this->readDirectory($this->path,'file');
00142 $this->totalItems=count($this->dirs['sorting'])+count($this->files['sorting']);
00143 $this->HTMLcode.=$this->getTable($this->files, $this->dirs, 'fileext,tstamp,size,rw,_REF_');
00144 }
00145
00146
00147
00148
00149
00150
00151 function getButtonsAndOtherMarkers($path) {
00152
00153
00154 $path = $GLOBALS['SOBE']->basicFF->is_directory($path);
00155
00156 if ($path) {
00157 $otherMarkers = array(
00158 'PAGE_ICON' => '',
00159 'TITLE' => '',
00160 );
00161
00162 $buttons = array(
00163 'level_up' => '',
00164 'refresh' => '',
00165 'title' => '',
00166 'page_icon' => '',
00167 );
00168
00169 $theFile = $GLOBALS['SOBE']->basicFF->getTotalFileInfo($path);
00170
00171 list($title,$icon,$path) = $this->dirData($theFile);
00172
00173
00174 $title = $GLOBALS['SOBE']->basicFF->blindPath($path);
00175
00176
00177 if ($GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($theFile['path'])) {
00178
00179 $otherMarkers['PAGE_ICON'] = '<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="'.htmlspecialchars($theFile['file']).'" />';
00180 if ($this->clickMenus) $otherMarkers['PAGE_ICON'] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'],$path);
00181
00182 $buttons['level_up'] .= $this->linkWrapDir(t3lib_iconWorks::getSpriteIcon('actions-view-go-up', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.upOneLevel', 1))), $theFile['path']);
00183 $otherMarkers['TITLE'] .= t3lib_div::removeXSS(t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)));
00184
00185
00186 } else {
00187 $otherMarkers['PAGE_ICON'] = t3lib_iconWorks::getSpriteIcon('apps-filetree-root');
00188 if ($this->clickMenus) $otherMarkers['PAGE_ICON'] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'],$path);
00189 $otherMarkers['TITLE'] .= htmlspecialchars(t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)));
00190 }
00191 }
00192
00193 $buttons['refresh'] = '<a href="'.htmlspecialchars($this->listURL()).'" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.reload', 1) . '">'.
00194 t3lib_iconWorks::getSpriteIcon('actions-system-refresh') .
00195 '</a>';
00196
00197 return array($buttons, $otherMarkers);
00198 }
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 function linkClipboardHeaderIcon($string,$table,$cmd,$warning='') {
00210 $onClickEvent = 'document.dblistForm.cmd.value=\''.$cmd.'\';document.dblistForm.submit();';
00211 if ($warning) $onClickEvent = 'if (confirm('.$GLOBALS['LANG']->JScharCode($warning).')){'.$onClickEvent.'}';
00212 return '<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">'.$string.'</a>';
00213 }
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223 function getTable($files,$dirs,$rowlist) {
00224
00225 $out='';
00226 $titleCol = 'file';
00227 $upLevelDir = dirname(substr($files['files'][0]['path'], 0, -1)) . '/';
00228 $levelUp = $GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($upLevelDir) ? $this->linkWrapDir(t3lib_iconWorks::getSpriteIcon('actions-view-go-up', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel', TRUE))), $upLevelDir) : '';
00229
00230
00231 $rowlist = t3lib_div::rmFromList($titleCol,$rowlist);
00232 $rowlist = t3lib_div::uniqueList($rowlist);
00233 $rowlist = $rowlist ? $titleCol.','.$rowlist : $titleCol;
00234 if ($this->bigControlPanel || $this->clipBoard) {
00235 $rowlist = str_replace('file,', 'file,_CLIPBOARD_,', $rowlist);
00236 }
00237 $this->fieldArray = explode(',',$rowlist);
00238
00239
00240 $iOut = '';
00241 $iOut.= $this->formatDirList($dirs);
00242
00243 if (count($dirs['sorting'])) {
00244
00245 $theData = Array();
00246 $theData[$titleCol] = '';
00247 }
00248
00249
00250
00251
00252 $iOut.= $this->formatFileList($files,$titleCol);
00253
00254
00255 $theData = Array();
00256
00257 foreach ($this->fieldArray as $v) {
00258 if ($v == '_CLIPBOARD_' && $this->clipBoard) {
00259 $cells=array();
00260 $table='_FILE';
00261 $elFromTable = $this->clipObj->elFromTable($table);
00262 if (count($elFromTable)) {
00263 $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('_FILE',$this->path)).'" onclick="return '.htmlspecialchars($this->clipObj->confirmMsg('_FILE',$this->path,'into',$elFromTable)).'" title="' . $GLOBALS['LANG']->getLL('clip_paste', 1) . '">' .
00264 t3lib_iconWorks::getSpriteIcon('actions-document-paste-after') .
00265 '</a>';
00266 }
00267 if ($this->clipObj->current!='normal' && $iOut) {
00268 $cells[]=$this->linkClipboardHeaderIcon(t3lib_iconWorks::getSpriteIcon('actions-edit-copy', array('title' => $GLOBALS['LANG']->getLL('clip_selectMarked', 1))), $table,'setCB');
00269 $cells[]=$this->linkClipboardHeaderIcon(t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => $GLOBALS['LANG']->getLL('clip_deleteMarked'))), $table,'delete',$GLOBALS['LANG']->getLL('clip_deleteMarkedWarning'));
00270 $onClick = 'checkOffCB(\'' . implode(',', $this->CBnames) . '\', this); return false;';
00271 $cells[] = '<a class="cbcCheckAll" rel="" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $GLOBALS['LANG']->getLL('clip_markRecords', TRUE) . '">' .
00272 t3lib_iconWorks::getSpriteIcon('actions-document-select').
00273 '</a>';
00274 }
00275 $theData[$v] = implode('',$cells);
00276 } else {
00277 $theT = $this->linkWrapSort($GLOBALS['LANG']->getLL('c_'.$v,1), $this->path,$v);
00278 $theData[$v] = $theT;
00279 }
00280 }
00281 $out .= '<thead>' . $this->addelement(1, $levelUp, $theData, ' class="t3-row-header"', '') . '</thead>';
00282 $out .= '<tbody>' . $iOut . '</tbody>';
00283
00284
00285
00286
00287 return '
00288
00289
00290 <!--
00291 File list table:
00292 -->
00293 <table cellpadding="0" cellspacing="0" id="typo3-filelist">
00294 '.$out.'
00295 </table>';
00296 }
00297
00298
00299
00300
00301
00302
00303 function getFolderInfo() {
00304 if($this->counter == 1) {
00305 $fileLabel = $GLOBALS['LANG']->getLL('file', true);
00306 } else {
00307 $fileLabel = $GLOBALS['LANG']->getLL('files', true);
00308 }
00309 return $this->counter . ' ' . $fileLabel . ', ' . t3lib_div::formatSize($this->totalbytes, $GLOBALS['LANG']->getLL('byteSizeUnits', true));
00310 }
00311
00312
00313
00314
00315
00316
00317
00318 function formatDirList($items) {
00319 $out='';
00320
00321
00322 if (count($items['sorting'])) {
00323 foreach ($items['sorting'] as $key => $value) {
00324 list($flag,$code) = $this->fwd_rwd_nav();
00325 $out.=$code;
00326 if ($flag) {
00327
00328 $theFile = $items['files'][$key];
00329 $this->counter++;
00330
00331 list($title,$icon,$path) = $this->dirData($theFile);
00332
00333
00334 $theIcon = t3lib_iconWorks::getSpriteIconForFile( ($theFile['type'] == 'dir' ? 'folder' : $theFile['fileext']), array('title' => htmlspecialchars($theFile['file'])));
00335 if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
00336
00337
00338 $theData = Array();
00339 foreach ($this->fieldArray as $field) {
00340 switch($field) {
00341 case 'size':
00342 $theData[$field] = t3lib_div::formatSize($theFile[$field], $GLOBALS['LANG']->getLL('byteSizeUnits', true));
00343 break;
00344 case 'rw':
00345 $theData[$field] = (($theFile['readable']) ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('read', true) . '</strong></span>') . (($theFile['writable']) ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('write', true) . '</strong></span>');
00346 break;
00347 case 'fileext':
00348 $theData[$field]=strtoupper($theFile['fileext']);
00349 break;
00350 case 'tstamp':
00351 $theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile['tstamp']);
00352 break;
00353 case 'file':
00354 $theData[$field]= $this->linkWrapDir($title,$path);
00355 break;
00356 case '_CLIPBOARD_':
00357 $temp = '';
00358 if ($this->bigControlPanel) {
00359 $temp .= $this->makeEdit($theFile);
00360 }
00361 $temp .= $this->makeClip($theFile);
00362 $theData[$field] = $temp;
00363 break;
00364 case '_REF_':
00365 $theData[$field]=$this->makeRef($theFile);
00366 break;
00367 default:
00368 $theData[$field]=t3lib_div::fixed_lgd_cs($theFile[$field],$this->fixedL);
00369 break;
00370 }
00371 }
00372 $altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor6' : 'bgColor4') . '"';
00373
00374 $out .= $this->addelement(1, $theIcon, $theData, $altRows);
00375 }
00376 $this->eCounter++;
00377 $this->dirCounter = $this->eCounter;
00378 }
00379 }
00380 return $out;
00381 }
00382
00383
00384
00385
00386
00387
00388
00389
00390 function linkWrapDir($code,$path) {
00391 $href = $this->script.'?id='.rawurlencode($path);
00392 $onclick = ' onclick="'.htmlspecialchars('top.content.nav_frame.hilight_row("file","folder'.t3lib_div::md5int($path).'_"+top.fsMod.currentBank)').'"';
00393
00394
00395 if(!strcmp($code,strip_tags($code))) {
00396 return '<a href="'.htmlspecialchars($href).'"'.$onclick.' title="'.htmlspecialchars($code).'">'.t3lib_div::fixed_lgd_cs($code,$this->fixedL).'</a>';
00397 } else {
00398 return '<a href="'.htmlspecialchars($href).'"'.$onclick.'>'.$code.'</a>';
00399 }
00400 }
00401
00402
00403
00404
00405
00406
00407
00408
00409 function linkWrapFile($code,$path) {
00410
00411 if (t3lib_div::isFirstPartOfStr($path, PATH_site)) {
00412 $href = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . substr($path, strlen(PATH_site));
00413 $aOnClick = "return top.openUrlInWindow('".$href."','WebFile');";
00414 $code = '<a href="#" title="'.htmlspecialchars($code).'" onclick="'.htmlspecialchars($aOnClick).'">'.t3lib_div::fixed_lgd_cs($code,$this->fixedL).'</a>';
00415 }
00416 return $code;
00417 }
00418
00419
00420
00421
00422
00423
00424 function listURL() {
00425 return $this->script.'?id='.rawurlencode($this->path).'&imagemode='.$this->thumbs;
00426 }
00427
00428
00429
00430
00431
00432
00433
00434 function dirData($theFile) {
00435 $path = $theFile['path'] . $theFile['file'] . '/';
00436 $webpath = t3lib_BEfunc::getPathType_web_nonweb($path);
00437
00438 $title = htmlspecialchars($theFile['file']);
00439 $icon = 'gfx/i/_icon_' . $webpath . 'folders.gif';
00440 if ($title == '_temp_') {
00441 $icon = 'gfx/i/sysf.gif';
00442 $title = '<strong>' . $GLOBALS['LANG']->getLL('temp', true) . '</strong>';
00443 }
00444 if ($title == '_recycler_') {
00445 $icon = 'gfx/i/recycler.gif';
00446 $title = '<strong>' . $GLOBALS['LANG']->getLL('recycler', true) . '</strong>';
00447 }
00448 $icon = $theFile['writable'] ? 'gfx/i/_icon_' . $webpath . 'folders_ro.gif' : $icon;
00449
00450 return array($title, $icon, $path);
00451 }
00452
00453
00454
00455
00456
00457
00458
00459 function formatFileList($items) {
00460 $out='';
00461
00462
00463 if (count($items['sorting'])) {
00464 foreach ($items['sorting'] as $key => $value) {
00465 list($flag,$code) = $this->fwd_rwd_nav();
00466 $out.=$code;
00467 if ($flag) {
00468
00469 $theFile = $items['files'][$key];
00470 $this->counter++;
00471
00472 $this->totalbytes+=$theFile['size'];
00473 $ext = $items['files'][$key][fileext];
00474 $icon = t3lib_BEfunc::getFileIcon($ext);
00475
00476
00477 $theIcon = t3lib_iconWorks::getSpriteIconForFile($theFile['fileext'], array('title' => htmlspecialchars($theFile['file'])));
00478
00479 if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$theFile['path'].$theFile['file']);
00480
00481
00482 $theData = Array();
00483 foreach ($this->fieldArray as $field) {
00484 switch($field) {
00485 case 'size':
00486 $theData[$field] = t3lib_div::formatSize($theFile[$field], $GLOBALS['LANG']->getLL('byteSizeUnits', true));
00487 break;
00488 case 'rw':
00489 $theData[$field] = (($theFile['readable']) ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('read', true) . '</strong></span>') . (($theFile['writable']) ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('write', true) . '</strong></span>');
00490 break;
00491 case 'fileext':
00492 $theData[$field]=strtoupper($theFile[$field]);
00493 break;
00494 case 'tstamp':
00495 $theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile[$field]);
00496 break;
00497 case '_CLIPBOARD_':
00498 $temp = '';
00499 if ($this->bigControlPanel) {
00500 $temp .= $this->makeEdit($theFile);
00501 }
00502 $temp .= $this->makeClip($theFile);
00503 $theData[$field] = $temp;
00504 break;
00505 case '_REF_':
00506 $theData[$field]=$this->makeRef($theFile);
00507 break;
00508 case 'file':
00509 $theData[$field] = $this->linkWrapFile($theFile[$field],$theFile['path'].$theFile['file']);
00510
00511 if ($this->thumbs && $this->isImage($theFile['fileext'])) {
00512 $thumbData = array();
00513 $theFile_R = rawurlencode($theFile['path'].$theFile['file']);
00514 $titleCol = $this->fieldArray[0];
00515
00516 $theFile_abs = $theFile['path'].$theFile['file'];
00517 $check = basename($theFile_abs).':'.filemtime($theFile_abs).':'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
00518 $params = '&file='.$theFile_R;
00519 $params.= '&md5sum='.t3lib_div::shortMD5($check);
00520 $href = $this->backPath.$this->thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
00521
00522 $theData[$field] .= '<br /><img src="'.htmlspecialchars($href).'" hspace="2" title="'.htmlspecialchars(trim($theFile['file'])).'" alt="'.htmlspecialchars(trim($theFile['file'])).'" />';
00523 }
00524 break;
00525 default:
00526 $theData[$field]=t3lib_div::fixed_lgd_cs($theFile[$field],$this->fixedL);
00527 break;
00528 }
00529 }
00530 if ($this->dirCounter % 2 == 0) {
00531 $altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor6' : 'bgColor4') . '"';
00532 } else {
00533 $altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '"';
00534 }
00535
00536 $out .= $this->addelement(1, $theIcon, $theData, $altRows);
00537 }
00538 $this->eCounter++;
00539 }
00540 }
00541 return $out;
00542 }
00543
00544
00545
00546
00547
00548
00549
00550 function isImage($ext) {
00551 return t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],strtolower($ext));
00552 }
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562 function linkWrapSort($code,$path,$col) {
00563 if ($this->sort==$col && !$this->sortRev) {
00564 $params='&SET[sort]='.$col.'&SET[reverse]=1';
00565 } else {
00566 $params='&SET[sort]='.$col.'&SET[reverse]=0';
00567 }
00568 $href = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('filelist') . 'mod1/' . $this->script . '?id=' . rawurlencode($path) . $params;
00569 return '<a href="'.htmlspecialchars($href).'">'.$code.'</a>';
00570 }
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580 function readDirectory($path,$type,$extList='') {
00581 $items = Array('files'=>array(), 'sorting'=>array());
00582 $path = $GLOBALS['SOBE']->basicFF->is_directory($path);
00583
00584 if($path && $GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($path.'/')) {
00585 $d = @dir($path);
00586 $tempArray=Array();
00587 if (is_object($d)) {
00588 while(false !== ($entry=$d->read())) {
00589 if ($entry!='.' && $entry!='..') {
00590 $wholePath = $path.'/'.$entry;
00591 if (@file_exists($wholePath) && (!$type || t3lib_div::inList($type,filetype($wholePath)))) {
00592 if ($extList) {
00593 $fI = t3lib_div::split_fileref($entry);
00594 if (t3lib_div::inList($extList,$fI['fileext'])) {
00595 $tempArray[] = $wholePath;
00596 }
00597 } else {
00598 $tempArray[] = $wholePath;
00599 }
00600 }
00601 }
00602 }
00603 $d->close();
00604 }
00605
00606 foreach ($tempArray as $val) {
00607 $temp = $GLOBALS['SOBE']->basicFF->getTotalFileInfo($val);
00608 $items['files'][] = $temp;
00609 if ($this->sort) {
00610 $items['sorting'][] = strtoupper($temp[$this->sort]);
00611 } else {
00612 $items['sorting'][] = '';
00613 }
00614 }
00615
00616 if ($this->sort) {
00617 if (!$this->sortRev) {
00618 asort($items['sorting']);
00619 } else {
00620 arsort($items['sorting']);
00621 }
00622 }
00623 }
00624 return $items;
00625 }
00626
00627
00628
00629
00630
00631
00632
00633 function makeClip($theData) {
00634 $cells=array();
00635 $fullIdent = $theData['path'].$theData['file'];
00636 $md5=t3lib_div::shortmd5($fullIdent);
00637
00638
00639 if ($this->clipObj->current=='normal') {
00640 $isSel = $this->clipObj->isSelected('_FILE',$md5);
00641 $cells[]='<a href="'.htmlspecialchars($this->clipObj->selUrlFile($fullIdent,1,($isSel=='copy'))).'">'.
00642 t3lib_iconWorks::getSpriteIcon('actions-edit-copy'.($isSel=='copy'?'-release':''),array('title'=>$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.copy',1))).
00643 '</a>';
00644 $cells[]='<a href="'.htmlspecialchars($this->clipObj->selUrlFile($fullIdent,0,($isSel=='cut'))).'">'.
00645 t3lib_iconWorks::getSpriteIcon('actions-edit-cut'.($isSel=='cut'?'-release':''),array('title'=>$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.cut',1))).
00646 '</a>';
00647 } else {
00648 $n='_FILE|'.$md5;
00649 $this->CBnames[]=$n;
00650
00651 $checked = ($this->clipObj->isSelected('_FILE',$md5)?' checked="checked"':'');
00652 $cells[]='<input type="hidden" name="CBH['.$n.']" value="0" />'.
00653 '<input type="checkbox" name="CBC['.$n.']" value="'.htmlspecialchars($fullIdent).'" class="smallCheckboxes"'.$checked.' />';
00654 }
00655
00656
00657 $elFromTable = $this->clipObj->elFromTable('_FILE');
00658 if (@is_dir($fullIdent) && count($elFromTable)) {
00659 $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('_FILE',$fullIdent)).'" onclick="return '.htmlspecialchars($this->clipObj->confirmMsg('_FILE',$fullIdent,'into',$elFromTable)).'" title="' . $GLOBALS['LANG']->getLL('clip_pasteInto', TRUE) . '">'.
00660 t3lib_iconWorks::getSpriteIcon('actions-document-paste-into') .
00661 '</a>';
00662 }
00663
00664
00665 return ' <!-- CLIPBOARD PANEL: -->
00666 <div class="typo3-clipCtrl">
00667 '.implode('
00668 ',$cells).'
00669 </div>';
00670 }
00671
00672
00673
00674
00675
00676
00677
00678 function makeEdit($theData) {
00679 $cells = array();
00680 $fullIdent = $theData['path'].$theData['file'];
00681 $canEdit = t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $theData['realFileext']);
00682
00683
00684 $iconWidth = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeWidth'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeWidth'] : 12;
00685 $iconHeight = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeHeight'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeHeight'] : 12;
00686 $spaceIcon = '<img src="' . $this->backPath . 'clear.gif" width="' . $iconWidth . '" height="' . $iconHeight . '" title="" alt="" />';
00687
00688
00689
00690 if ($theData['type'] == 'dir' || !$canEdit) {
00691 $cells['edit'] = $spaceIcon;
00692 } else {
00693 $editOnClick = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'file_edit.php?target=' .
00694 rawurlencode($fullIdent) .
00695 '&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location);return false;';
00696 $cells['edit'] = '<a href="#" onclick="' . $editOnClick . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.edit') . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-open') . '</a>';
00697 }
00698
00699 $renameOnClick = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'file_rename.php?target=' .
00700 rawurlencode($fullIdent) .
00701 '&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location);return false;';
00702 $cells['rename'] = '<a href="#" onclick="' . $renameOnClick . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.rename') . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-rename') . '</a>';
00703
00704
00705 $infoOnClick = 'top.launchView(\'' . $fullIdent . '\', \'\');return false;';
00706 $cells['info'] = '<a href="#" onclick="' . $infoOnClick . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.info') . '">' . t3lib_iconWorks::getSpriteIcon('status-dialog-information') . '</a>';
00707
00708
00709 if(is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'])) {
00710 foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $classData) {
00711 $hookObject = t3lib_div::getUserObj($classData);
00712
00713 if(!($hookObject instanceof fileList_editIconHook)) {
00714 throw new UnexpectedValueException('$hookObject must implement interface fileList_editIconHook', 1235225797);
00715 }
00716
00717 $hookObject->manipulateEditIcons($cells, $this);
00718 }
00719 }
00720
00721
00722 return ' <!-- EDIT CONTROLS: -->
00723 <div class="typo3-editCtrl">
00724 ' . implode('
00725 ', $cells).'
00726 </div>';
00727 }
00728
00729
00730
00731
00732
00733
00734
00735 function makeRef($theData) {
00736
00737
00738 $fullIdent = $theData['path'].$theData['file'];
00739
00740 if (t3lib_div::isFirstPartOfStr($fullIdent,PATH_site)) {
00741 $fullIdent = substr($fullIdent,strlen(PATH_site));
00742 }
00743
00744
00745 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
00746 '*',
00747 'sys_refindex',
00748 'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_FILE','sys_refindex').
00749 ' AND ref_string='.$GLOBALS['TYPO3_DB']->fullQuoteStr($fullIdent,'sys_refindex').
00750 ' AND deleted=0'
00751 );
00752
00753
00754 $infoData=array();
00755 if (is_array($rows)) {
00756 foreach($rows as $row) {
00757 $infoData[]=$row['tablename'].':'.$row['recuid'].':'.$row['field'];
00758 }
00759 }
00760
00761 return count($infoData) ? '<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$theData['path'].$theData['file'].'\', \'\'); return false;').'" title="'.htmlspecialchars(t3lib_div::fixed_lgd_cs(implode(' / ',$infoData),100)).'">'.count($infoData).'</a>' : '';
00762 }
00763 }
00764
00765
00766
00767 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.file_list.inc']) {
00768 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.file_list.inc']);
00769 }
00770 ?>