function get_document_type_newinherited($fatherid = 0, $selid = 0, $layer = 0, $type) { $str = ""; global $db; $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "document_type where father='{$fatherid}' and type='" . $type . "' ORDER BY id Asc"); if (count($query) > 0) { for ($i = 0; $i < $layer; $i++) { $str .= "├"; } while ($row = $db->fetch_array($query)) { $selstr = $row['id'] == $selid ? 'selected="selected"' : ''; $htmlstr = '<option value="' . $row['id'] . '" ' . $selstr . '>' . $str . $row['title'] . '</option>'; echo $htmlstr; get_document_type_newinherited($row['id'], $selid, $layer + 1, $type); } } return; }
<meta http-equiv="x-ua-compatible" content="ie=7" /> <link href="template/default/tree/images/admincp.css?SES" rel="stylesheet" type="text/css" /> </head> <body> <script src="template/default/tree/js/common.js?SES" type="text/javascript"></script> <script src="template/default/tree/js/admincp.js?SES" type="text/javascript"></script> <div id="append_parent"></div> <div class="container" id="cpcontainer"><div class="itemtitle"><h3><?php echo $_title['title']; ?> 文件夹设置</h3></div> <table class="tb tb2 " id="tips"> <tr><th class="partition"><a href="javascript:;" onclick="show_all()">全部展开</a> | <a href="javascript:;" onclick="hide_all()">全部折叠</a> </th></tr></table> <script type="text/JavaScript"> var forumselect = '<?php echo get_document_type_newinherited(0, 0, 0, $type); ?> '; var rowtypedata = [ [[1, ''], [1,'', 'td25'], [5, '<div><input name="newname[]" value="顶级文件夹名称" style="width:160px;" size="30" type="text" class="txt" /><input type="hidden" name="newid[]" value="1" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)">删除</a></div>']], [[1, ''], [1,'', 'td25'], [5, '<div class="board"><input name="newname[]" style="width:160px;" value="文件夹名称" size="30" type="text" class="txt" /><input type="hidden" name="newids[]" value="2" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)">删除</a><select name="newinherited[]"><option value="">指定上级文件夹</option>' + forumselect + '</select></div>']], [[1, ''], [1,'', 'td25'], [5, '<div class="board"><input name="newname[]" style="width:160px;" value="文件夹名称" size="30" type="text" class="txt" /><input type="hidden" name="newids[]" value="2" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)">删除</a><select name="newinherited[]"><option value="">指定上级文件夹</option>' + forumselect + '</select></div>']], ]; </script> <form name="cpform" method="post" autocomplete="off" action="admin.php?ac=<?php echo $ac; ?> &fileurl=<?php echo $fileurl; ?> &do=documenttype&type=<?php