/** * outputs html list of folders * * @param array $folders */ function folderList($folders) { // do the folders $foldersret = ""; for ($i = 0; $i < count($folders); $i++) { $file = $folders[$i][0]; $path = $folders[$i][1]; $isOpen = $folders[$i][2]; if (substr($path, 0, 3) == ".//") { $hPath = substr($path, 3); } else { $hPath = $path; } if (!in_array($hPath, $this->ignoreFolders)) { if ($isOpen) { $class1 = "open"; $class2 = "contents_open"; } else { $class1 = "closed"; $class2 = "contents"; } $path = str_replace("//", "/", $path); $path = str_replace(" ", "%20", $path); $comment = "<span class=\"folder_comment\"> <a href=\"{$PHP_SELF}?dir={$hPath}\"> ></a>"; if (file_exists("{$path}/fComments.txt")) { $comment .= " - " . file_get_contents("{$path}/fComments.txt") . "</span>"; } else { $comment .= "</span>"; } $foldersret .= "\n\t\t\t\t\n\t\t\t\t<!-- START FOLDER -->\n\t<li class=\"{$class1}\" id=\"" . $this->stripID("li_{$path}/{$file}") . "\">\n\t\t<!-- FOLDER TITLE -->\n\t\t<a href=\"?dir={$path}\" class=\"" . $this->stripID("{$path}/{$file}") . " {$path}\" title=\"click to open this folder\">{$file}</a> <span>{$comment}</span>\n\t\t<!-- START CONTENTS -->\n\t\t<ul class=\"{$class2}\" id=\"" . $this->stripID("F_{$path}/{$file}") . "\" >"; if ($isOpen) { $list = new FNFileList(); $rec_folders = $list->getFolderArray($path); $rec_files = $list->getFilesArray($path); $foldersret .= $this->folderList($rec_folders); $foldersret .= $this->fileList($rec_files); } else { $foldersret .= "<li>Empty</li>"; } $foldersret .= "</ul>\n\t\t<!-- END CONTENTS -->\n\t</li>\n\t<!-- END FOLDER -->"; } } return $foldersret; }