"TYPO3 4.0.1: typo3_src-4.0.1/typo3/class.file_list.inc Source File", "datetime" => "Sat Dec 2 19:22:21 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>

class.file_list.inc

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00075 class fileList extends t3lib_recordList {
00076         var $iLimit = 40;                                       // default Max items shown
00077         var $thumbs = 0;                                        // Boolean. Thumbnails on records containing files (pictures)
00078         var $widthGif = '<img src="clear.gif" width="1" height="1" hspace="165" alt="" />';
00079         var $fixedL = 30;                                       // Max length of strings
00080         var $script = 'file_list.php';
00081         var $clickMenus=1;                                      // If true click menus are generated on files and folders
00082 
00083         var $sort = '';                                         // The field to sort by...
00084         var $sortRev = 1;                                       // Reverse sorting flag
00085         var $firstElementNumber=0;
00086         var $clipBoard = 0;
00087 
00088                 // internal
00089         var $JScode = '';
00090         var $HTMLcode = '';
00091         var $totalbytes=0;
00092         var $dirs = Array();
00093         var $files = Array();
00094         var $path = '';
00095         var $eCounter=0;                                        // Counting the elements no matter what...
00096         var $totalItems='';
00097 
00098         var $CBnames=array();
00099 
00100 
00101 
00112         function start($path,$pointer,$sort,$sortRev,$clipBoard=0)      {
00113                 $this->counter=0;
00114                 $this->totalbytes=0;
00115                 $this->JScode='';
00116                 $this->HTMLcode='';
00117                 $this->path = $path;
00118                 $this->sort=$sort;
00119                 $this->sortRev=$sortRev;
00120                 $this->firstElementNumber=$pointer;
00121                 $this->clipBoard = $clipBoard;
00122 
00123                 if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'])  {
00124                         $this->thumbScript='gfx/notfound_thumb.gif';
00125                 }
00126         }
00127 
00133         function generateList() {
00134                 $this->dirs = $this->readDirectory($this->path,'dir,link');
00135                 $this->files = $this->readDirectory($this->path,'file');
00136                 $this->totalItems=count($this->dirs['sorting'])+count($this->files['sorting']);
00137                 $this->HTMLcode.=$this->getTable($this->files, $this->dirs, 'fileext,tstamp,size,rw,_REF_');
00138         }
00139 
00146         function writeTop($path)        {
00147                         // Makes the code for the foldericon in the top
00148                 $path = $GLOBALS['SOBE']->basicFF->is_directory($path); // Cleaning name...
00149 
00150                 if ($path)      {
00151                         $out='';
00152                         $theFile = $GLOBALS['SOBE']->basicFF->getTotalFileInfo($path);
00153                         $root = $GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($theFile['path']);
00154                         $titleCol='path';
00155                         $this->fieldArray = Array($titleCol,'up');
00156 
00157                         list($title,$icon,$path) =  $this->dirData($theFile);
00158 
00159                                 // Start compiling the HTML
00160                         $theData = Array();
00161                         $theData[$titleCol] = $this->widthGif;
00162 
00163                         $title = $GLOBALS['SOBE']->basicFF->blindPath($path);
00164                         $theData['up']='<a href="'.htmlspecialchars($this->listURL()).'">'.
00165                                         '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/refresh_n.gif','width="14" height="14"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.reload',1).'" alt="" />'.
00166                                         '</a>';
00167 
00168                         if ($root)      {
00169                                         // The icon with link
00170                                 $theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
00171                                 if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
00172 
00173                                 $theData[$titleCol].='<br />'.t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20));      // No HTML specialchars here - HTML like <b> </b> is allowed
00174                                 $theData['up'].=$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="" />',$theFile['path']);
00175                         } else {
00176                                         // root:0
00177                                 $theIcon='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/_icon_ftp.gif','width="18" height="16"').' alt="" />';
00178                                 $theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)));
00179                         }
00180 
00181                                 // Adding top element
00182                         $out.=$this->addelement(1,'',$theData,'','',$theIcon);
00183 
00184                         $this->HTMLcode.='
00185 
00186                 <!--
00187                         Page header for file list
00188                 -->
00189                                 <table border="0" cellpadding="0" cellspacing="0" id="typo3-filelist-top">
00190                                         '.$out.'
00191                                 </table>';
00192                 }
00193         }
00194 
00204         function linkClipboardHeaderIcon($string,$table,$cmd,$warning='')       {
00205                 $onClickEvent = 'document.dblistForm.cmd.value=\''.$cmd.'\';document.dblistForm.submit();';
00206                 if ($warning)   $onClickEvent = 'if (confirm('.$GLOBALS['LANG']->JScharCode($warning).')){'.$onClickEvent.'}';
00207                 return '<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">'.$string.'</a>';
00208         }
00209 
00218         function getTable($files,$dirs,$rowlist)        {
00219                         // Adds the code of files/dirs
00220                 $out='';
00221                 $titleCol = 'file';
00222 
00223                         // Cleaning rowlist for duplicates and place the $titleCol as the first column always!
00224                 $rowlist = t3lib_div::rmFromList($titleCol,$rowlist);
00225                 $rowlist = t3lib_div::uniqueList($rowlist);
00226                 $rowlist = $rowlist ? $titleCol.','.$rowlist : $titleCol;
00227                 if ($this->clipBoard)   $rowlist.=',_CLIPBOARD_';
00228                 $this->fieldArray = explode(',',$rowlist);
00229 
00230                         // half line is drawn
00231                 $theData = Array();
00232                 $theData[$titleCol] = $this->widthGif;
00233                 $out.=$this->addelement(0,'',$theData,'');
00234 
00235 
00236 
00237                         // Directories are added
00238                 $iOut = '';
00239                 $iOut.= $this->formatDirList($dirs);
00240 
00241                 if (count($dirs['sorting']))    {
00242                                 // half line is drawn
00243                         $theData = Array();
00244                         $theData[$titleCol] = '';
00245                         $iOut.=$this->addelement(0,'',$theData);
00246                 }
00247 
00248 
00249 
00250                         // Files are added
00251                 $iOut.= $this->formatFileList($files,$titleCol);
00252 
00253                         // Header line is drawn
00254                 $theData = Array();
00255                 reset($this->fieldArray);
00256                 while(list(,$v)=each($this->fieldArray))        {
00257                         if ($v=='_CLIPBOARD_')  {
00258                                 $cells=array();
00259                                 $table='_FILE';
00260                                 $elFromTable = $this->clipObj->elFromTable($table);
00261                                 if (count($elFromTable))        {
00262                                         $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('_FILE',$this->path)).'" onclick="return '.htmlspecialchars($this->clipObj->confirmMsg('_FILE',$this->path,'into',$elFromTable)).'">'.
00263                                                 '<img'.t3lib_iconWorks::skinImg('','gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_paste',1).'" alt="" /></a>';
00264                                 }
00265                                 if ($this->clipObj->current!='normal' && $iOut) {
00266                                         $cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg('','gfx/clip_copy.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_selectMarked',1).'" alt="" />',$table,'setCB');
00267                                         $cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg('','gfx/garbage.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_deleteMarked',1).'" alt="" />',$table,'delete',$GLOBALS['LANG']->getLL('clip_deleteMarkedWarning'));
00268                                         $onClick = 'checkOffCB(\''.implode(',',$this->CBnames).'\'); return false;';
00269                                         $cells[]='<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
00270                                                         '<img'.t3lib_iconWorks::skinImg('','gfx/clip_select.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_markRecords',1).'" alt="" />'.
00271                                                         '</a>';
00272                                 }
00273 
00274                                 $theData[$v] = implode('',$cells);
00275                         } else {        // Normal row:
00276                                 $theT = $this->linkWrapSort($GLOBALS['LANG']->getLL('c_'.$v,1), $this->path,$v);
00277                                 $theData[$v] = $theT;
00278                         }
00279                 }
00280                 $out.=$this->addelement(1,'',$theData,' class="c-headLine"','');
00281                 $out.=$iOut;
00282 
00283                         // half line is drawn
00284                 $theData = Array();
00285                 $theData[$titleCol] = $this->counter.' File(s), '.t3lib_div::formatSize($this->totalbytes).'bytes';
00286                 $out.=$this->addelement(1,'',$theData);
00287 
00288                         // finish
00289                 return '
00290 
00291 
00292                 <!--
00293                         File list table:
00294                 -->
00295                         <table border="0" cellpadding="0" cellspacing="0" id="typo3-filelist">
00296                                 '.$out.'
00297                         </table>';
00298         }
00299 
00306         function formatDirList($items)  {
00307                 $out='';
00308 
00309                         // Files:
00310                 if (count($items['sorting']))   {
00311                         reset($items['sorting']);
00312                         while (list($key,) = each($items['sorting']))   {
00313                                 list($flag,$code) = $this->fwd_rwd_nav();
00314                                 $out.=$code;
00315                                 if ($flag)      {
00316                                                 // Initialization
00317                                         $theFile = $items['files'][$key];
00318                                         $this->counter++;
00319 
00320                                         list($title,$icon,$path) =  $this->dirData($theFile);
00321 
00322                                                 // The icon with link
00323                                         $theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
00324                                         if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
00325 
00326                                                 //      Preparing and getting the data-array
00327                                         $theData = Array();
00328                                         reset($this->fieldArray);
00329                                         while(list(,$field)=each($this->fieldArray))    {
00330                                                 switch($field)  {
00331                                                         case 'size':
00332         //                                                      $theData[$field]=t3lib_div::formatSize($theFile[$field]);
00333                                                         break;
00334                                                         case 'rw':
00335                                                                 $theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
00336                                                         break;
00337                                                         case 'fileext':
00338         //                                                      $theData[$field]=strtoupper($theFile['fileext']);
00339                                                         break;
00340                                                         case 'tstamp':
00341                                                                 $theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile['tstamp']);
00342                                                         break;
00343                                                         case 'file':
00344                                                                 $theData[$field]= $this->linkWrapDir($title,$path);
00345                                                         break;
00346                                                         case '_CLIPBOARD_':
00347                                                                 $theData[$field]=$this->makeClip($theFile);
00348                                                         break;
00349                                                         case '_REF_':
00350                                                                 $theData[$field]=$this->makeRef($theFile);
00351                                                         break;
00352                                                         default:
00353                                                                 $theData[$field]=t3lib_div::fixed_lgd($theFile[$field],$this->fixedL);
00354                                                         break;
00355                                                 }
00356                                         }
00357                                         $out.=$this->addelement(1,$theIcon,$theData);
00358                                 }
00359                                 $this->eCounter++;
00360                         }
00361                 }
00362                 return $out;
00363         }
00364 
00372         function linkWrapDir($code,$path)       {
00373                 $href = $this->script.'?id='.rawurlencode($path);
00374                 $onclick = ' onclick="'.htmlspecialchars('top.content.nav_frame.hilight_row("file","folder'.t3lib_div::md5int($path).'_"+top.fsMod.currentBank)').'"';
00375 
00376                         // Sometimes $code contains plain HTML tags. In such a case the string should not be modified!
00377                 if(!strcmp($code,strip_tags($code)))    {
00378                         return '<a href="'.htmlspecialchars($href).'"'.$onclick.' title="'.htmlspecialchars($code).'">'.t3lib_div::fixed_lgd($code,$this->fixedL).'</a>';
00379                 } else  {
00380                         return '<a href="'.htmlspecialchars($href).'"'.$onclick.'>'.$code.'</a>';
00381                 }
00382         }
00383 
00391         function linkWrapFile($code,$path)      {
00392 
00393                 if (t3lib_div::isFirstPartOfStr($path,t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT')))    {
00394                         $href = substr($path,strlen(t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT')));
00395                         $aOnClick = "return top.openUrlInWindow('".$href."','WebFile');";
00396                         $code = '<a href="#" title="'.htmlspecialchars($code).'" onclick="'.htmlspecialchars($aOnClick).'">'.t3lib_div::fixed_lgd($code,$this->fixedL).'</a>';
00397                 }
00398                 return $code;
00399         }
00400 
00406         function listURL()      {
00407                 return $this->script.'?id='.rawurlencode($this->path).'&imagemode='.$this->thumbs;
00408         }
00409 
00416         function dirData($theFile)      {
00417                 $path = $theFile['path'].$theFile['file'].'/';
00418                 $webpath=t3lib_BEfunc::getPathType_web_nonweb($path);
00419 
00420                 $title=htmlspecialchars($theFile['file']);
00421                 $icon = 'gfx/i/_icon_'.$webpath.'folders.gif';
00422                 if ($title=='_temp_')   {
00423                         $icon = 'gfx/i/sysf.gif';
00424                         $title='<b>TEMP</b>';
00425                 }
00426                 if ($title=='_recycler_')       {
00427                         $icon = 'gfx/i/recycler.gif';
00428                         $title='<b>RECYCLER</b>';
00429                 }
00430                 $icon = $theFile['writable'] ? 'gfx/i/_icon_'.$webpath.'folders_ro.gif' : $icon;
00431 
00432                 return Array($title,$icon,$path);
00433         }
00434 
00441         function formatFileList($items) {
00442                 $out='';
00443 
00444                         // Files:
00445                 if (count($items['sorting']))   {
00446                         reset($items['sorting']);
00447                         while (list($key,) = each($items['sorting']))   {
00448                                 list($flag,$code) = $this->fwd_rwd_nav();
00449                                 $out.=$code;
00450                                 if ($flag)      {
00451                                                 // Initialization
00452                                         $theFile = $items['files'][$key];
00453                                         $this->counter++;
00454 
00455                                         $this->totalbytes+=$theFile['size'];
00456                                         $ext = $items['files'][$key][fileext];
00457                                         $icon = t3lib_BEfunc::getFileIcon($ext);
00458 
00459                                                 // The icon with link
00460                                         $theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/fileicons/'.$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
00461                                         if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$theFile['path'].$theFile['file']);
00462 
00463                                                 //      Preparing and getting the data-array
00464                                         $theData = Array();
00465                                         reset($this->fieldArray);
00466                                         while(list(,$field)=each($this->fieldArray))    {
00467                                                 switch($field)  {
00468                                                         case 'size':
00469                                                                 $theData[$field]=t3lib_div::formatSize($theFile[$field]);
00470                                                         break;
00471                                                         case 'rw':
00472                                                                 $theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
00473                                                         break;
00474                                                         case 'fileext':
00475                                                                 $theData[$field]=strtoupper($theFile[$field]);
00476                                                         break;
00477                                                         case 'tstamp':
00478                                                                 $theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile[$field]);
00479                                                         break;
00480                                                         case '_CLIPBOARD_':
00481                                                                 $theData[$field]=$this->makeClip($theFile);
00482                                                         break;
00483                                                         case '_REF_':
00484                                                                 $theData[$field]=$this->makeRef($theFile);
00485                                                         break;
00486                                                         case 'file':
00487                                                                 $theData[$field] = $this->linkWrapFile($theFile[$field],$theFile['path'].$theFile['file']);
00488                                                         break;
00489                                                         default:
00490                                                                 $theData[$field]=t3lib_div::fixed_lgd($theFile[$field],$this->fixedL);
00491                                                         break;
00492                                                 }
00493                                         }
00494                                         $out.=$this->addelement(1,$theIcon,$theData);
00495 
00496                                                 // Thumbsnails?
00497                                         if ($this->thumbs && $this->isImage($theFile['fileext']))       {
00498                                                 $thumbData=Array();
00499                                                 $theFile_R = rawurlencode($theFile['path'].$theFile['file']);
00500                                                 $titleCol=$this->fieldArray[0];
00501                                                 $href = $this->backPath.$this->thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].'&file='.$theFile_R;
00502                                                 $thumbData[$titleCol]='<img src="'.htmlspecialchars($href).'" hspace="2" title="'.htmlspecialchars(trim($theFile['file'])).'" alt="" />';
00503                                                 $out.=$this->addelement(4,'',$thumbData);
00504                                         }
00505                                 }
00506                                 $this->eCounter++;
00507                         }
00508                 }
00509                 return $out;
00510         }
00511 
00518         function isImage($ext)  {
00519                 return t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],strtolower($ext));
00520         }
00521 
00530         function linkWrapSort($code,$path,$col) {
00531                 if ($this->sort==$col && !$this->sortRev)       {               // reverse sorting
00532                         $params='&SET[sort]='.$col.'&SET[reverse]=1';
00533                 } else {
00534                         $params='&SET[sort]='.$col.'&SET[reverse]=0';
00535                 }
00536                 $href = $this->script.'?id='.rawurlencode($path).$params;
00537                 return '<a href="'.htmlspecialchars($href).'">'.$code.'</a>';
00538         }
00539 
00548         function readDirectory($path,$type,$extList='') {
00549                 $items = Array('files'=>array(), 'sorting'=>array());
00550                 $path = $GLOBALS['SOBE']->basicFF->is_directory($path); // Cleaning name...
00551 
00552                 if($path && $GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($path.'/'))       {
00553                         $d = @dir($path);
00554                         $tempArray=Array();
00555                         if (is_object($d))      {
00556                                 while($entry=$d->read()) {
00557                                         if ($entry!='.' && $entry!='..')        {
00558                                                 $wholePath = $path.'/'.$entry;          // Because of odd PHP-error where  <br />-tag is sometimes placed after a filename!!
00559                                                 if (@file_exists($wholePath) && (!$type || t3lib_div::inList($type,filetype($wholePath))))      {
00560                                                         if ($extList)   {
00561                                                                 $fI = t3lib_div::split_fileref($entry);
00562                                                                 if (t3lib_div::inList($extList,$fI['fileext'])) {
00563                                                                         $tempArray[] = $wholePath;
00564                                                                 }
00565                                                         } else {
00566                                                                 $tempArray[] = $wholePath;
00567                                                         }
00568                                                 }
00569                                         }
00570                                 }
00571                                 $d->close();
00572                         }
00573                                 // Get fileinfo
00574                         reset($tempArray);
00575                         while (list(,$val)=each($tempArray))    {
00576                                 $temp = $GLOBALS['SOBE']->basicFF->getTotalFileInfo($val);
00577                                 $items['files'][] = $temp;
00578                                 if ($this->sort)        {
00579                                         $items['sorting'][] = strtoupper($temp[$this->sort]);
00580                                 } else {
00581                                         $items['sorting'][] = '';
00582                                 }
00583                         }
00584                                 // Sort if required
00585                         if ($this->sort)        {
00586                                 if (!$this->sortRev)    {
00587                                         asort($items['sorting']);
00588                                 } else {
00589                                         arsort($items['sorting']);
00590                                 }
00591                         }
00592                 }
00593                 return $items;
00594         }
00595 
00602         function makeClip($theData)     {
00603                 $cells=array();
00604                 $fullIdent = $theData['path'].$theData['file'];
00605                 $md5=t3lib_div::shortmd5($fullIdent);
00606 
00607                         // For normal clipboard, add copy/cut buttons:
00608                 if ($this->clipObj->current=='normal')  {
00609                         $isSel = $this->clipObj->isSelected('_FILE',$md5);
00610                         $cells[]='<a href="'.htmlspecialchars($this->clipObj->selUrlFile($fullIdent,1,($isSel=='copy'))).'">'.
00611                                                 '<img'.t3lib_iconWorks::skinImg('','gfx/clip_copy'.($isSel=='copy'?'_h':'').'.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.copy',1).'" alt="" />'.
00612                                                 '</a>';
00613                         $cells[]='<a href="'.htmlspecialchars($this->clipObj->selUrlFile($fullIdent,0,($isSel=='cut'))).'">'.
00614                                                 '<img'.t3lib_iconWorks::skinImg('','gfx/clip_cut'.($isSel=='cut'?'_h':'').'.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.cut',1).'" alt="" />'.
00615                                                 '</a>';
00616                 } else {        // For numeric pads, add select checkboxes:
00617                         $n='_FILE|'.$md5;
00618                         $this->CBnames[]=$n;
00619 
00620                         $checked = ($this->clipObj->isSelected('_FILE',$md5)?' checked="checked"':'');
00621                         $cells[]='<input type="hidden" name="CBH['.$n.']" value="0" />'.
00622                                         '<input type="checkbox" name="CBC['.$n.']" value="'.htmlspecialchars($fullIdent).'" class="smallCheckboxes"'.$checked.' />';
00623                 }
00624 
00625                         // Display PASTE button, if directory:
00626                 $elFromTable = $this->clipObj->elFromTable('_FILE');
00627                 if (@is_dir($fullIdent) && count($elFromTable)) {
00628                         $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('_FILE',$fullIdent)).'" onclick="return '.htmlspecialchars($this->clipObj->confirmMsg('_FILE',$fullIdent,'into',$elFromTable)).'">'.
00629                                                 '<img'.t3lib_iconWorks::skinImg('','gfx/clip_pasteinto.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_pasteInto',1).'" alt="" />'.
00630                                                 '</a>';
00631                 }
00632 
00633                         // Compile items into a DIV-element:
00634                 return '                                                        <!-- CLIPBOARD PANEL: -->
00635                                                                                         <div class="typo3-clipCtrl">
00636                                                                                                 '.implode('
00637                                                                                                 ',$cells).'
00638                                                                                         </div>';
00639         }
00640 
00647         function makeRef($theData)      {
00648 
00649                         // First, fit path to match what is stored in the refindex:
00650                 $fullIdent = $theData['path'].$theData['file'];
00651 
00652                 if (t3lib_div::isFirstPartOfStr($fullIdent,PATH_site))  {
00653                         $fullIdent = substr($fullIdent,strlen(PATH_site));
00654                 }
00655 
00656                         // Look up the path:
00657                 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
00658                         '*',
00659                         'sys_refindex',
00660                         'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_FILE','sys_refindex').
00661                                 ' AND ref_string='.$GLOBALS['TYPO3_DB']->fullQuoteStr($fullIdent,'sys_refindex').
00662                                 ' AND deleted=0'
00663                 );
00664 
00665                         // Compile information for title tag:
00666                 $infoData=array();
00667                 if (is_array($rows)) {
00668                         foreach($rows as $row)  {
00669                                 $infoData[]=$row['tablename'].':'.$row['recuid'].':'.$row['field'];
00670                         }
00671                 }
00672 
00673                 return count($infoData) ? '<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$theData['path'].$theData['file'].'\', \'\'); return false;').'" title="'.htmlspecialchars(t3lib_div::fixed_lgd(implode(' / ',$infoData),100)).'">'.count($infoData).'</a>' : '';
00674         }
00675 }
00676 
00677 
00678 
00679 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.file_list.inc'])       {
00680         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.file_list.inc']);
00681 }
00682 ?>