Révision c0db737e
Ajouté par Jocelyn Delande il y a environ 11 ans
creerPano.php | ||
---|---|---|
16 | 16 |
utils::init(); |
17 | 17 |
|
18 | 18 |
if(isset($_GET['dir']) && is_dir($_GET['dir'])) { |
19 |
$base_dir = $_GET['dir'];
|
|
19 |
$base_dir = $_GET['dir']; |
|
20 | 20 |
} else { |
21 | 21 |
$base_dir='upload'; |
22 | 22 |
} |
23 | 23 |
|
24 |
try { |
|
25 |
$finfo = finfo_open(FILEINFO_MIME_TYPE); // Retourne le type mime du fichier |
|
26 |
$did = opendir($base_dir); |
|
27 |
|
|
24 |
//try { |
|
28 | 25 |
echo "<ul id=\"pano-list\">\n"; |
29 |
|
|
30 |
while(false !== ($filename = readdir($did))) { |
|
31 |
if (!preg_match('/^\.\.?$/', $filename)) { |
|
32 |
$ftype = finfo_file($finfo, $base_dir.'/'.$filename); |
|
33 |
if (isset($ftype)) { |
|
34 |
$cmt = $filename; |
|
35 |
$title = sprintf(' title="fichier de type %s"', $ftype); |
|
36 |
} else { |
|
37 |
$cmt = sprintf('<samp>%s</samp>', $filename); |
|
38 |
$title = ''; |
|
39 |
} |
|
40 |
printf ('<li%s><a href="genererPano.php?dir=%s&name=%s">%s</a></li>'."\n", $title, $base_dir, $filename, $cmt); |
|
41 |
} |
|
26 |
|
|
27 |
|
|
28 |
$panos = utils::list_available_panos($base_dir); |
|
29 |
foreach ($panos as $pano) { |
|
30 |
printf ('<li title="%s"><a href="genererPano.php?dir=%s&name=%s">%s</a></li>'."\n", |
|
31 |
$pano['title'], $base_dir, $pano['filename'], $pano['comment']); |
|
42 | 32 |
} |
33 |
|
|
43 | 34 |
echo "</ul>\n"; |
44 | 35 |
finfo_close($finfo); |
45 |
} catch (Exception $e) { |
|
36 |
//} catch (Exception $e) {
|
|
46 | 37 |
printf("<h3 class=\"warning\">désolé mais aucun site n'est disponible...</h3>\n"); |
47 |
} |
|
38 |
//}
|
|
48 | 39 |
?> |
49 | 40 |
<p id="interaction"> |
50 | 41 |
<a href="." title="Revenir à la liste des panoramas">Retour</a> |
Formats disponibles : Unified diff
separate function for listing available images