Example #1
0
<?php

$path_dir = urldecode($_GET['dir']);
include PATH_INCLUDE_CONF . '/list.php';
pathdir($path_dir, $disp);
$url_parent = $GLOBALS['url_parent'];
$nav_path_dir = $GLOBALS['nav_path_dir'];
$theme = $GLOBALS['theme'];
?>

<div id="explorer-header" class="<?php 
echo $theme;
?>
-theme">
	<noscript>Vous devez activer javascript pour utiliser toutes les fonctionnalités de l'explorateur de fichiers.</noscript>
	<nav>

		<ul>

			<li><a href="?disp=<?php 
echo $disp;
?>
&dir" class="button-nav" id="home" title="Retour à la racine"></a></li>
			<li><a href="?disp=<?php 
echo $disp;
?>
&dir=<?php 
echo $url_parent;
?>
" class="button-nav" id="back" title="Retour au dossier parent"></a></li>
Example #2
0
function showdirs($path_dir, $disp)
{
    pathdir($path_dir, $disp);
    if ($path_dir != NULL) {
        $list_path_dir = $GLOBALS['list_path_dir'];
        $nbr = $GLOBALS['nbr'];
        $open_dir = $list_path_dir[0];
        //on retient le répertoire ouvert dans l'arborescence pour l'aficher différent dans la liste
        listdirs(NULL, $open_dir, $disp);
        //racine
        if ($nbr != 0) {
            $i = 1;
            while ($i <= $nbr) {
                $open_dir = $list_path_dir[$i];
                //on retient le répertoire ouvert dans l'arborescence pour l'aficher différent dans la liste
                $slice_list_path_dir = array_slice($list_path_dir, 0, $i);
                $slice_path_dir = implode('/', $slice_list_path_dir);
                //arborescence ouverte en chaine de caractères
                listdirs($slice_path_dir, $open_dir, $disp);
                //répertoires intermédiaires
                $i++;
            }
            listdirs($path_dir, NULL, $disp);
            //répertoire courent
        } else {
            listdirs($path_dir, $open_dir, $disp);
            //si un seul répertoire ouvert
        }
    } else {
        //si aucun répertoire ouvert
        listdirs(NULL, NULL, $disp);
        // racine
    }
}