* @return
*/
private String generateBlockTree(){
StringBuffer result=new StringBuffer();
result.append("<ul id='navigation'>");//注意:此ID和页面脚本绑定,不要更改
JSONArray roots=CommonDAO.getList(SqlMgr.getSql("GET_FORUM_CHILD_BLOCK"),0);
if(roots!=null){
for(int i=0;i<roots.size();i++){
JSONObject jsonObj=roots.getJSONObject(i);
String bId=jsonObj.getString("block_id");
String link=jsonObj.getString("link");
if(i==0){
this.blockId=jsonObj.getString("block_id");
}
if(link.equals("1")){
result.append("<li><a id='"+bId+"' href='loadPosts30.action?blockId="+bId+"'>");
}else{
result.append("<li><a id='"+bId+"' href='#'>");
}
result.append(jsonObj.get("block_name"));
result.append("</a>");
String blockId=jsonObj.getString("block_id");
JSONArray children=CommonDAO.getList(SqlMgr.getSql("GET_FORUM_CHILD_BLOCK"), blockId);
if(children!=null&&children.size()!=0){
result.append("<ul>");
for(int j=0;j<children.size();j++){
JSONObject child=children.getJSONObject(j);
bId=child.getString("block_id");
link=child.getString("link");
if(link.equals("1")){
result.append("<li><a id='"+bId+"' href='loadPosts30.action?blockId="+bId+"'>");
}else{