Public Member Functions | |
init () | |
Initialize variables, file object Incoming GET vars include id, pointer, table, imagemode. | |
menuConfig () | |
Setting the menu/session variables. | |
main () | |
Main function, creating the listing. | |
printContent () | |
Outputting the accumulated content to screen. | |
Public Attributes | |
$MCONF = array() | |
$MOD_MENU = array() | |
$MOD_SETTINGS = array() | |
$content | |
$basicFF | |
$doc | |
$id | |
$pointer | |
$table | |
$imagemode | |
$cmd | |
$overwriteExistingFiles |
|
Initialize variables, file object Incoming GET vars include id, pointer, table, imagemode.
Definition at line 103 of file file_list.php. References menuConfig(), and table(). 00103 { 00104 global $TYPO3_CONF_VARS,$FILEMOUNTS; 00105 00106 // Setting GPvars: 00107 $this->id = t3lib_div::_GP('id'); 00108 $this->pointer = t3lib_div::_GP('pointer'); 00109 $this->table = t3lib_div::_GP('table'); 00110 $this->imagemode = t3lib_div::_GP('imagemode'); 00111 $this->cmd = t3lib_div::_GP('cmd'); 00112 $this->overwriteExistingFiles = t3lib_div::_GP('overwriteExistingFiles'); 00113 00114 // Setting module name: 00115 $this->MCONF = $GLOBALS['MCONF']; 00116 00117 // File operation object: 00118 $this->basicFF = t3lib_div::makeInstance('t3lib_basicFileFunctions'); 00119 $this->basicFF->init($FILEMOUNTS,$TYPO3_CONF_VARS['BE']['fileExtensions']); 00120 00121 // Configure the "menu" - which is used internally to save the values of sorting, displayThumbs etc. 00122 $this->menuConfig(); 00123 }
|
|
Main function, creating the listing.
Definition at line 151 of file file_list.php. References filelist(). 00151 { 00152 global $BE_USER,$LANG,$BACK_PATH,$TYPO3_CONF_VARS,$FILEMOUNTS; 00153 00154 // Initialize the template object 00155 $this->doc = t3lib_div::makeInstance('template'); 00156 $this->doc->backPath = $BACK_PATH; 00157 $this->doc->docType = 'xhtml_trans'; 00158 00159 // Validating the input "id" (the path, directory!) and checking it against the mounts of the user. 00160 $this->id = $this->basicFF->is_directory($this->id); 00161 $access = $this->id && $this->basicFF->checkPathAgainstMounts($this->id.'/'); 00162 00163 // There there was access to this file path, continue, make the list 00164 if ($access) { 00165 00166 // Create filelisting object 00167 $filelist = t3lib_div::makeInstance('fileList'); 00168 $filelist->backPath = $BACK_PATH; 00169 $filelist->thumbs = $this->MOD_SETTINGS['displayThumbs']?1:$BE_USER->uc['thumbnailsByDefault']; 00170 00171 // Create clipboard object and initialize that 00172 $filelist->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); 00173 $filelist->clipObj->fileMode=1; 00174 $filelist->clipObj->initializeClipboard(); 00175 00176 $CB = t3lib_div::_GET('CB'); 00177 if ($this->cmd=='setCB') $CB['el'] = $filelist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'),t3lib_div::_POST('CBC')),'_FILE'); 00178 if (!$this->MOD_SETTINGS['clipBoard']) $CB['setP']='normal'; 00179 $filelist->clipObj->setCmd($CB); 00180 $filelist->clipObj->cleanCurrent(); 00181 $filelist->clipObj->endClipboard(); // Saves 00182 00183 // If the "cmd" was to delete files from the list (clipboard thing), do that: 00184 if ($this->cmd=='delete') { 00185 $items = $filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'),'_FILE',1); 00186 if (count($items)) { 00187 // Make command array: 00188 $FILE=array(); 00189 reset($items); 00190 while(list(,$v)=each($items)) { 00191 $FILE['delete'][]=array('data'=>$v); 00192 } 00193 00194 // Init file processing object for deleting and pass the cmd array. 00195 $fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions'); 00196 $fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']); 00197 $fileProcessor->init_actionPerms($BE_USER->user['fileoper_perms']); 00198 $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0; 00199 $fileProcessor->start($FILE); 00200 $fileProcessor->processData(); 00201 00202 $fileProcessor->printLogErrorMessages(); 00203 } 00204 } 00205 00206 // Start up filelisting object, include settings. 00207 $this->pointer = t3lib_div::intInRange($this->pointer,0,100000); 00208 $filelist->start($this->id,$this->pointer,$this->MOD_SETTINGS['sort'],$this->MOD_SETTINGS['reverse'],$this->MOD_SETTINGS['clipBoard']); 00209 00210 // Write the header 00211 $filelist->writeTop($this->id); 00212 00213 // Generate the list 00214 $filelist->generateList($this->id,$this->table); 00215 00216 // Write the footer 00217 $filelist->writeBottom(); 00218 00219 // Set top JavaScript: 00220 $this->doc->JScode=$this->doc->wrapScriptTags(' 00221 00222 if (top.fsMod) top.fsMod.recentIds["file"] = unescape("'.rawurlencode($this->id).'"); 00223 function jumpToUrl(URL) { // 00224 document.location = URL; 00225 } 00226 00227 '.$filelist->CBfunctions() // ... and add clipboard JavaScript functions 00228 ); 00229 00230 // This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers. 00231 $CMparts=$this->doc->getContextMenuCode(); 00232 $this->doc->bodyTagAdditions = $CMparts[1]; 00233 $this->doc->JScode.=$CMparts[0]; 00234 $this->doc->postCode.= $CMparts[2]; 00235 00236 00237 // Create output 00238 $this->content=''; 00239 $this->content.=$this->doc->startPage($LANG->getLL('files')); 00240 $this->content.= '<form action="'.htmlspecialchars($filelist->listURL()).'" method="post" name="dblistForm">'; 00241 $this->content.= $filelist->HTMLcode; 00242 $this->content.= '<input type="hidden" name="cmd" /></form>'; 00243 00244 // FileList Module CSH: 00245 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH'],'<br/>|'); 00246 00247 if ($filelist->HTMLcode) { // Making listing options: 00248 00249 $this->content.=' 00250 00251 <!-- 00252 Listing options for clipboard and thumbnails 00253 --> 00254 <div id="typo3-listOptions"> 00255 '; 00256 00257 // Add "display thumbnails" checkbox: 00258 $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[displayThumbs]',$this->MOD_SETTINGS['displayThumbs'],'file_list.php','').' '.$LANG->getLL('displayThumbs',1).'<br />'; 00259 00260 // Add clipboard button 00261 $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[clipBoard]',$this->MOD_SETTINGS['clipBoard'],'file_list.php','').' '.$LANG->getLL('clipBoard',1); 00262 00263 $this->content.=' 00264 </div> 00265 '; 00266 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_options', $GLOBALS['BACK_PATH']); 00267 00268 00269 // Set clipboard: 00270 if ($this->MOD_SETTINGS['clipBoard']) { 00271 $this->content.=$filelist->clipObj->printClipboard(); 00272 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']); 00273 } 00274 } 00275 00276 // Add shortcut 00277 if ($BE_USER->mayMakeShortcut()) { 00278 $this->content.='<br /><br />'.$this->doc->makeShortcutIcon('pointer,id,target,table',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']); 00279 } 00280 } else { 00281 // Create output - no access (no warning though) 00282 $this->content=''; 00283 $this->content.=$this->doc->startPage($LANG->getLL('files')); 00284 } 00285 00286 // Ending page: 00287 $this->content.= $this->doc->endPage(); 00288 }
|
|
Setting the menu/session variables.
Definition at line 130 of file file_list.php. References t3lib_BEfunc::getModuleData(). Referenced by init(). 00130 { 00131 // MENU-ITEMS: 00132 // If array, then it's a selector box menu 00133 // If empty string it's just a variable, that'll be saved. 00134 // Values NOT in this array will not be saved in the settings-array for the module. 00135 $this->MOD_MENU = array( 00136 'sort' => '', 00137 'reverse' => '', 00138 'displayThumbs' => '', 00139 'clipBoard' => '' 00140 ); 00141 00142 // CLEANSE SETTINGS 00143 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); 00144 }
|
|
Outputting the accumulated content to screen.
Definition at line 295 of file file_list.php. 00295 { 00296 00297 echo $this->content; 00298 }
|
|
Definition at line 85 of file file_list.php. |
|
Definition at line 93 of file file_list.php. |
|
Definition at line 84 of file file_list.php. |
|
Definition at line 86 of file file_list.php. |
|
Definition at line 89 of file file_list.php. |
|
Definition at line 92 of file file_list.php. |
|
Definition at line 78 of file file_list.php. |
|
Definition at line 79 of file file_list.php. |
|
Definition at line 80 of file file_list.php. |
|
Definition at line 94 of file file_list.php. |
|
Definition at line 90 of file file_list.php. |
|
Definition at line 91 of file file_list.php. |