Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ //includes include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('script_editor_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //include require_once "header.php"; //define function recure_dir function recur_dir($dir) { clearstatcache(); $htmldirlist = ''; $htmlfilelist = ''; $dirlist = opendir($dir); $dir_array = array(); if($dirlist !== false) while (false !== ($file = readdir($dirlist))) { if ($file != "." AND $file != ".."){ $newpath = $dir.'/'.$file; $level = explode('/',$newpath); if ( substr(strtolower($newpath), -4) == ".svn" || substr(strtolower($newpath), -4) == ".git" || substr(strtolower($newpath), -3) == ".db" || substr(strtolower($newpath), -4) == ".jpg" || substr(strtolower($newpath), -4) == ".gif" || substr(strtolower($newpath), -4) == ".png" || substr(strtolower($newpath), -4) == ".ico" || substr(strtolower($newpath), -4) == ".ttf" ){ //ignore certain files (and folders) } else { $dir_array[] = $newpath; } if ($x > 1000) { break; }; $x++; } } asort($dir_array); foreach ($dir_array as $newpath){ $level = explode('/',$newpath); if (is_dir($newpath)) { $dirname = end($level); $newpath = str_replace ('//', '/', $newpath); $htmldirlist .= "
".$dirname."
".recur_dir($newpath)."
\n"; } else { $filename = end($level); $filesize = round(filesize($newpath)/1024, 2); $newpath = str_replace ('//', '/', $newpath); $newpath = str_replace ("\\", "/", $newpath); $newpath = str_replace ($filename, '', $newpath); $htmlfilelist .= "
".$filename."
\n"; } } closedir($dirlist); return $htmldirlist ."\n". $htmlfilelist; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; ini_set("session.cookie_httponly", True); if (!isset($_SESSION)) { session_start(); } switch ($_SESSION["app"]["edit"]["dir"]) { case 'scripts': echo recur_dir($_SESSION['switch']['scripts']['dir']); break; case 'php': echo recur_dir($_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH); break; case 'grammer': echo recur_dir($_SESSION['switch']['grammar']['dir']); break; case 'provision': echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/"); break; case 'xml': echo recur_dir($_SESSION['switch']['conf']['dir']); break; } echo "
\n"; require_once "footer.php"; ?>