$filename) { if (is_array($filename)) { // $filename is either a filename or an array of filenames, if so, it represents a directory $useableName = str_replace("/", "_", $path); echo "#input_$useableName:checked + .submenu_$useableName, .submenu_$useableName:hover { display: block; }\n"; generateCSSCode($filename); } } } function generateSubmenusHTML($directory, $indentation) { foreach ($directory as $path => $filename) { $useableName = str_replace("/", "_", $path); // CSS classes cant contain slashes if (is_array($filename)) { $folderName = end(explode("/", $path)); echo " $indentation $indentation $indentation $indentation
\n"; } else { echo " $indentation$filename\n"; } echo " $indentation
\n"; } } ?>