}
    $files = array();
    $node = new HTML_TreeNode(basename($path), basename($path), 'folder.gif');
    while (($file = readdir($dir)) !== false) {
        if ($file != '.' && $file != '..') {
            if (@is_dir("{$path}/{$file}")) {
                $addnode =& recurseDir("{$path}/{$file}");
            } else {
                $addnode = new HTML_TreeNode($file, $file, 'document2.png');
            }
            $node->addItem($addnode);
        }
    }
    closedir($dir);
    return $node;
}
?>
<html>
<head>
    <script src="./css/sniffer.js" language="JavaScript" type="text/javascript"></script>
    <script src="./css/TreeMenu.js" language="JavaScript" type="text/javascript"></script>
</head>
<body>

<div id="menuLayer"></div>
<?php 
$menu->printMenu();
?>

</body>
</html>
Exemple #2
0
    if (!$dir = opendir($path)) {
        return false;
    }
    $files = array();
    $node = &new HTML_TreeNode(basename($path), basename($path), 'folder.gif');
    while (($file = readdir($dir)) !== false) {
        if ($file != '.' && $file != '..') {
            if (@is_dir("$path/$file")) {
                $addnode = &recurseDir("$path/$file");
            } else {
                $addnode = &new HTML_TreeNode($file, $file, 'document2.png');
            }
            $node->addItem($addnode);
        }
    }
    closedir($dir);
    return $node;
}
?>
<html>
<head>
    <script src="./css/sniffer.js" language="JavaScript" type="text/javascript"></script>
    <script src="./css/TreeMenu.js" language="JavaScript" type="text/javascript"></script>
</head>
<body>

<div id="menuLayer"></div>
<?$menu->printMenu()?>

</body>
</html>