慧云科技 > 首页 > 文章详情

奥杰cms源码 - ColumnT(二)

本文来源:网站建设-网站制作|网络营销专家慧云科技-

抢滩登陆

2009-7-16 16:02:09

        ///


        /// 输出 树 HTML
        ///

        public string OutputTree()
        {
            string treeText = "";
            nodeNum = 0;
            string cid = "root";
            string cname = csRoot.GetAttr( "dbName" );
            string cHtml = "            oTree = new BYXX_oboutTree.BYTree();
            oTree.AddRootNode( cHtml, true, "Site_Run.gif" );

            // vct // 递归加载子节点
            AddTree( csRoot, cid, cname );

            //得到顶层节点列表
            treeText = oTree.OutPutTree( IconsPath, ScriptPath, StylePath );
            //释放对象
            oTree.Dispose();

            return treeText;
        }

        // 递归加载子节点
        private void AddTree( XmlNode pnode, string pid, string pname )
        {
            string cid = "";
            string cname = "";
            string ctitle = "";
            string cHtml = "";
            string cicon = "";


            XmlNode cnode = pnode.FirstChild;
            while( cnode != null ) {
                // vct // 忽略其他 节点
                if( cnode.Name != "columnSet" && cnode.Name != "column" ) {
                    cnode = cnode.NextSibling;
                    continue;
                }
                // vct // 准备 节点参数
                cid = "node" + (nodeNum++).ToString();
                cname = cnode.Attributes["name"].Value;
                ctitle = cnode.Attributes["title"].Value;
                cHtml = "

                if( cnode.Name == "columnSet" ) {
                    // vct // 准备 栏目集 节点参数
                    cHtml += "style=‘cursor: pointer;‘>" + ctitle + "";
                    cicon = "Folder.gif";
                    // vct // 添加 栏目(集) 节点,递归加载子节点
                    oTree.AddNode( pid, cid, cHtml, true, cicon, null );
                    AddTree( cnode, cid, cname );
                } else {
                    // vct // 准备 栏目 节点参数
                    cHtml += "style=‘cursor: pointer;‘ ondblclick=\"dbClick();\">" + ctitle + "";
                    cicon = "notebook.gif";
                    // vct // 添加 栏目(集) 节点
                    oTree.AddNode( pid, cid, cHtml, true, cicon, null );
                }

                cnode = cnode.NextSibling;
            }
        }
    }
}


RSS订阅| 关于我们| 网站地图| 加入项目| 法律条款| 友情链接| Firefox| Sitemap| 网站统计

全国免费咨询热线:400-600-6495 优惠活动咨询电话:021-62278496 Email:ajaxcms@yahoo.cn

上海慧云信息科技有限公司版权所有 2006-2009 沪ICP备09038165号

本站关键词:网站建设 高品质网站建设