<select class="span6 disabled" style="padding-left: 0px;" id="val-select2" name="path" style="width: 100%;" data-placeholder="选择页面" tabindex="-1" aria-hidden="true" aria-describedby="val-select2-error" aria-invalid="false">
<option value="<?php echo $setting['path']; ?>"><?php echo $setting['path']; ?>(请勿选择此项)</option>
<?php
function traverseDir($dir){
if($dir_handle = @opendir($dir)){
while($filename = readdir($dir_handle)){
if($filename != "." && $filename != ".."){
$subFile = $dir.DIRECTORY_SEPARATOR.$filename; //要将源目录及子文件相连
if(is_dir($subFile)){ //若子文件是个目录
echo '<option value="theme/'.$filename.'">'.$filename.'</option>';
traverseDir($subFile); //递归找出下级目录名称
}
}
}
closedir($dir_handle);
}
}
echo traverseDir(ROOT.'../theme/');
?>
</select>