processUploads(); $manager->deleteFiles(); $refreshDir = false; //process any directory functions if($manager->deleteDirs() || $manager->processNewDir()) $refreshDir = true; //check for any sub-directory request //check that the requested sub-directory exists //and valid if(isset($_REQUEST['dir'])) { $path = rawurldecode($_REQUEST['dir']); if($manager->validRelativePath($path)) $relative = $path; } $manager = new ImageManager($IMConfig); //get the list of files and directories $list = $manager->getFiles($relative); /* ================= OUTPUT/DRAW FUNCTIONS ======================= */ /** * Draw the files in an table. */ function drawFiles($list, &$manager, $i) { global $relative; $image_per_line = 5; foreach($list as $entry => $file) { $i++; if ($i==1) { echo "";} ?>
config['base_url']}{$file['relative']}";?>" target="_blank" title=" - ">config['base_url']}{$file['relative']}"; echo "\" width=\"$size_x\" height=\"$size_y"; } ?>" alt=" - "/>
TrashEdit
"; $i=0; } }//foreach return ($i); }//function drawFiles /** * Draw the directory. */ function drawDirs($list, &$manager, $i) { global $relative; $image_per_line = 5; foreach($list as $path => $dir) { $i++; if ($i==1) { echo "";} ?>
<?php echo $dir['entry']; ?>
Trash
"; $i=0; } } //foreach return ($i); }//function drawDirs function addEmpties($list, &$manager, $j) { global $relative; $image_per_line = 5; if ($j != 0) { for ($i=$j; $i <= $image_per_line; $i++) { ?> "; $i=0; break; } } //for } }//function addEmpties /** * No directories and no files. */ function drawNoResults() { ?>
No Images Found
Invalid base directory: config['base_dir']; ?>
Image List isValidBase() == false) { drawErrorBase($manager); } elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>