Get all the files and directories of a relative path.
public getFiles ( string $path, $articleId ) : array | ||
$path | string | relative path to be base path. |
Результат | array | of file and path information.
array(0 => array('relative'=>'fullpath',...),
1 => array('filename'=>fileinfo array(),...)
fileinfo array:
array('url'=>'full url',
'relative'=>'relative to base',
'fullpath'=>'full file path',
'image'=>imageInfo array() false if not image,
'stat' => filestat)
|
//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) { global $relative; global $IMConfig; switch ($IMConfig['ViewMode']) { case 'details': ?> <script language="Javascript"> <!-- function showPreview(f_url) {
$manager = new ImageManager($IMConfig); $refreshDir = false; // 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); $articleId = isset($_REQUEST['article_id']) && is_numeric($_REQUEST['article_id']) ? $_REQUEST['article_id'] : null; // Get the list of files and directories $list = array(); if (!is_null($articleId)) { $list = $manager->getFiles($relative, $articleId); } if (isset($_REQUEST['image_id'])) { $image = $manager->getImageByNumber($articleId, $_REQUEST['image_id']); $imageAltOpt = ''; $imageTitleOpt = ''; if (isset($_REQUEST['image_alt'])) { $imageAltOpt = $_REQUEST['image_alt']; } if (isset($_REQUEST['image_title'])) { $imageTitleOpt = $_REQUEST['image_title']; } if (isset($_REQUEST['image_alignment'])) { $imageAlignOpt = $_REQUEST['image_alignment']; } if (isset($_REQUEST['image_ratio'])) {