* @copyright 2003-2006 Andrew Eddie, Greg Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version CVS: $Id: file_dialog.php 231860 2007-03-14 12:48:37Z ashnazg $ * @filesource * @see phpdoc.php */ if (!function_exists( 'version_compare' )) { print "phpDocumentor requires PHP version 4.1.0 or greater to function"; exit; } if ('@WEB-DIR@' != '@'.'WEB-DIR@') { /** * common file information */ require_once 'PhpDocumentor/phpDocumentor/common.inc.php'; require_once 'PhpDocumentor/HTML_TreeMenu-1.1.2/TreeMenu.php'; require_once( '@WEB-DIR@' . PATH_DELIMITER . 'PhpDocumentor/docbuilder/includes/utilities.php' ); define(PHPDOC_WEBROOT_DIR, 'PhpDocumentor'); // set up include path so we can find all files, no matter what $GLOBALS['_phpDocumentor_install_dir'] = PHPDOC_WEBROOT_DIR; // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir] $ini = phpDocumentor_parse_ini_file('@DATA-DIR@' . PATH_DELIMITER . 'PhpDocumentor/phpDocumentor.ini', true); if (isset($ini['_phpDocumentor_options']['userdir'])) { $configdir = $ini['_phpDocumentor_options']['userdir']; } else { $configdir = '@DATA-DIR@' . PATH_DELIMITER . 'PhpDocumentor/user'; } } else { define(PHPDOC_WEBROOT_DIR, dirname(dirname(__FILE__))); /** * common file information */ include_once(PHPDOC_WEBROOT_DIR . "/phpDocumentor/common.inc.php"); include_once(PHPDOC_WEBROOT_DIR . "/HTML_TreeMenu-1.1.2/TreeMenu.php"); include_once(PHPDOC_WEBROOT_DIR . "/docbuilder/includes/utilities.php" ); // set up include path so we can find all files, no matter what $GLOBALS['_phpDocumentor_install_dir'] = dirname(dirname( realpath( __FILE__ ) )); // add my directory to the include path, and make it first, should fix any errors if (substr(PHP_OS, 0, 3) == 'WIN') { ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path')); } else { ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path')); } // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir] $ini = phpDocumentor_parse_ini_file($_phpDocumentor_install_dir . PATH_DELIMITER . 'phpDocumentor.ini', true); if (isset($ini['_phpDocumentor_options']['userdir'])) { $configdir = $ini['_phpDocumentor_options']['userdir']; } else { $configdir = $_phpDocumentor_install_dir . '/user'; } } // allow the user to change this at runtime if (!empty( $_REQUEST['altuserdir'] )) { $configdir = $_REQUEST['altuserdir']; } ?> File browser path = $path; $options = array(); if ($text) $options['text'] = $text; if ($link) $options['link'] = $link; if ($icon) $options['icon'] = $icon; HTML_TreeNode::HTML_TreeNode($options,$events); } } $menu = new HTML_TreeMenu(); $filename = ''; if (isset($_GET) && isset($_GET['fileName'])) { $filename = $_GET['fileName']; } $filename = realpath($filename); $pd = (substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/'; $test = ($pd == '/') ? '/' : 'C:\\'; if (empty($filename) || ($filename == $test)) { $filename = ($pd == '/') ? '/' : 'C:\\'; $node = false; getDir($filename,$node); } else { flush(); // if ($pd != '/') $pd = $pd.$pd; $anode = false; switchDirTree($filename,$anode); // recurseDir($filename,$anode); $node = new HTML_TreeNode(array('text' => "Click to view ".addslashes($filename),'link' => "",'icon' => 'branchtop.gif')); $node->addItem($anode); }; $menu->addItem($node); if ('@WEB-DIR@' != '@'.'WEB-DIR@') { $DHTMLmenu = &new HTML_TreeMenu_DHTML($menu, array('images' => '../HTML_TreeMenu-1.1.2/images')); } else { $DHTMLmenu = &new HTML_TreeMenu_DHTML($menu, array('images' => str_replace('/docbuilder/file_dialog.php','',$_SERVER['PHP_SELF']) . '/HTML_TreeMenu-1.1.2/images')); } ?> Directory Browser
Use this to find directories and files which can be used below:
printMenu(); ?>