public string getData() { TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = JpColumns.GetFirstlevcolumns_online(); StringBuilder strShow = new StringBuilder(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级文章目录 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //如果需要显示这个栏目(当前栏目有权限要显示,如果当前栏目没权限但是下级栏目有权限也要显示但是不加载链接) if (JpRoles.ifhaveEditorRoleBycidanduid_containsubcid("admin", dt.Rows[i]["cid"].ToString()) == true) { strShow.Append("<li class=\"mui-table-view-cell mui-collapse\"><a class=\"mui-navigate-right\" href=\"javascript:void(0)\">" + dt.Rows[i]["cname"].ToString() + "</a>"); strShow.Append("<ul class=\"mui-table-view mui-table-view-chevron\">"); strShow.Append(GetNextColumn(dt.Rows[i]["cid"].ToString())); strShow.Append("</ul>"); strShow.Append("</li>"); } } else { if (JpRoles.ifhaveEditorRoleBycidanduid("admin", dt.Rows[i]["cid"].ToString()) == true) { strShow.Append("<li class=\"mui-table-view-cell mui-collapse\"><a class=\"mui-navigate-right\" href=\"javascript:void(0)\">" + dt.Rows[i]["cname"].ToString() + "</a></li>"); } } } } return strShow.ToString(); }
//显示栏目管理 public string ls_lmgl() { string ls_return = ""; if (Session["uid"].ToString() == "") { } else { DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { ls_return += "<li url=\"column/list_columns.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } return ls_return; }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); if (Request.QueryString["uid"] != null) ls_uid = Request.QueryString["uid"].ToString(); if (!this.IsPostBack) { Response.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); Response.Write("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"zh-cn\">"); Response.Write("<Head><Title>选择栏目</Title>"); Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">"); Response.Write("<meta name=\"generator\" content=\"editplus\" />"); Response.Write("<link type=\"text/css\" rel=\"stylesheet\" href=\"hyhtml/ltree/resources/css/lTREE.default.css\" />"); Response.Write("<style type=\"text/css\">"); Response.Write("#lTREEMenuDEMO {border:0px solid #ccc;margin:3px;padding:3px;}"); Response.Write("#infoBox {position:absolute;left:450px;top:40px;border:1px solid #ccc;width:400px;padding:0 10px;font-family:\"宋体\",Geneva,Arial,sans-serif;line-height:150%;}"); Response.Write("#debugMSG strong {color:#f00;}"); Response.Write("</style>"); Response.Write("<!--[if IE 6]>"); Response.Write("<script>"); Response.Write("document.execCommand(\"BackgroundImageCache\", false, true);"); Response.Write("</script>"); Response.Write("<![endif]-->"); Response.Write("</Head>"); Response.Write("<body style=\"width: 100%; height:100%;line-height:23px;\">"); //Response.Write("<form>"); Response.Write("<div style=\"font-size:14px; text-align:center;width:80%; border-bottom:1px dashed #cccccc;color: #bbbbbb;\" valign=\"top\"><b>栏目列表</b></div>"); Response.Write("<div class=\"lTREEMenu lTREENormal\" id=\"lTREEMenuDEMO\">"); Response.Write("<dl>"); Response.Write("<dl>"); Response.Write("<dd> <a href=\"../settings/main_columnrole.aspx?cid=&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">所有栏目列表</a>"); Response.Write("<dl>"); //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //输出一级部门头部 Response.Write("<dd class=\"folderClose\">"); Response.Write("<a href=\"../settings/main_columnrole.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("</a>"); Response.Write("<dl>"); GetNextColumn(dt.Rows[i]["cid"].ToString()); //输出一级部门尾部 Response.Write("</dl>"); Response.Write("</dd>"); } else { Response.Write("<dt>"); Response.Write("<a href=\"../settings/main_columnrole.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("</a>"); Response.Write("</dt>"); } } } Response.Write("</dl>"); Response.Write("</dd>"); Response.Write("</dl>"); Response.Write("</div>"); Response.Write("<script type=\"text/javascript\" src=\"hyhtml/ltree/js/lTREE.js\"></script>"); Response.Write("<script class=\"lJSFDemo\" type=\"text/javascript\"> "); Response.Write(" var lTree = new lTREE();"); Response.Write(" lTree.config({"); Response.Write(" path : \"dl dd\""); Response.Write(" });"); Response.Write(" lTree.tagName({"); Response.Write(" folder : \"DD\","); Response.Write(" file : \"DT\""); Response.Write(" });"); Response.Write(" lTree.className({"); Response.Write(" folderClose : \"folderClose\","); Response.Write(" lastChild : \"lastChild\""); Response.Write(" });"); Response.Write("var t=new Date(),timer=[];"); Response.Write("lTree.build(\"lTREEMenuDEMO\");"); Response.Write("timer.push(new Date()-t);"); /************************************** * 给树内所有复选框添加相应事件 * * Start */ Response.Write(" </script>"); //Response.Write("</form>"); Response.Write("</Body></HTML>"); } }
//显示文章投稿栏目 public string ls_wztg() { string ls_return = ""; if (Session["uid"].ToString() == "") { } else { DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false) { ls_return += "<li isexpand=\"false\" url=\"article/list_article_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetNextColumn_author(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false) { ls_return += "<li url=\"article/list_article_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } } return ls_return; }
//显示文章发布栏目 public string ls_wzfb() { string ls_return = ""; if (Session["uid"].ToString() == "") { } else { DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //如果需要显示这个栏目(当前栏目有权限要显示,如果当前栏目没权限但是下级栏目有权限也要显示但是不加载链接) if (JpRoles.ifhaveEditorRoleBycidanduid_containsubcid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li isexpand=\"false\" >"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetNextColumn(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li url=\"article/list_article_fb.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&rnd=" + System.Guid.NewGuid().ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } } return ls_return; }
private void RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); string uid = txtuid.Text; string cid = txtcid.Text; TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = new DataTable(); if (this.txtcid.Text == "") dt = JpColumns.GetFirstlevcolumns_online(); else dt = JpColumns.GetSubColumnsOrderbysort_online(this.txtcid.Text); this.totalCount = dt.Rows.Count; DataTable tempTable = dt.Clone(); tempTable.Columns.Add(new DataColumn("authorchecked", typeof(string))); tempTable.Columns.Add(new DataColumn("editorchecked", typeof(string))); for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } if (JpRoles.ifhaveAuthorRoleBycidanduid(this.txtuid.Text, dt.Rows[i]["cid"].ToString()) == true) dr["authorchecked"] = "checked"; else dr["authorchecked"] = ""; if (JpRoles.ifhaveEditorRoleBycidanduid(this.txtuid.Text, dt.Rows[i]["cid"].ToString()) == true) dr["editorchecked"] = "checked"; else dr["editorchecked"] = ""; tempTable.Rows.Add(dr); } this.rptList.DataSource = tempTable; this.rptList.DataBind(); //翻页 //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", // this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__"); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("main_columnrole.aspx", "page={0}&rnd={1}&cid={2}&uid={3}", "__id__", System.Guid.NewGuid().ToString(), cid, uid); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); if (!this.IsPostBack) { TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); Response.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); Response.Write("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"zh-cn\">"); Response.Write("<Head><Title>栏目列表</Title>"); Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">"); Response.Write("<meta name=\"generator\" content=\"editplus\" />"); Response.Write("<link type=\"text/css\" rel=\"stylesheet\" href=\"hyhtml/ltree/resources/css/lTREE.checkbox.css\" />"); Response.Write("<style type=\"text/css\">"); Response.Write("#lTREEMenuDEMO {border:1px solid #ccc;margin:3px;padding:3px;}"); Response.Write("#infoBox {position:absolute;left:450px;top:40px;border:1px solid #ccc;width:400px;padding:0 10px;font-family:\"宋体\",Geneva,Arial,sans-serif;line-height:150%;}"); Response.Write("#debugMSG strong {color:#f00;}"); Response.Write("</style>"); Response.Write("<!--[if IE 6]>"); Response.Write("<script>"); Response.Write("document.execCommand(\"BackgroundImageCache\", false, true);"); Response.Write("</script>"); Response.Write("<![endif]-->"); Response.Write("</Head>"); Response.Write("<body style=\"padding:2px;\">"); //Response.Write("<form>"); Response.Write("<div class=\"lTREEMenu lTREENormal\" id=\"lTREEMenuDEMO\">"); Response.Write("<dl>"); Response.Write("<dl>"); //Response.Write("<dd><input type=\"checkbox\" name=\"SelAll\" value=\"全选\" onclick=\"SelectAll();\" style=\"width:13;\"> <b>栏目列表</b>"); Response.Write("<dd> <b>栏目列表</b>"); Response.Write("<dl>"); //得到一级栏目 DataTable dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //如果需要显示这个栏目(当前栏目有权限要显示,如果当前栏目没权限但是下级栏目有权限也要显示但是不加载链接) if (JpRoles.ifhaveEditorRoleBycidanduid_containsubcid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { //输出一级部门头部 Response.Write("<dd class=\"folderClose\">"); //Response.Write("<input type=\"checkbox\" name=\"Dept" + dt.Rows[i]["cid"].ToString() + "\" value=\"" + dt.Rows[i]["cid"].ToString() + "\" id=\"" + dt.Rows[i]["cname"].ToString() + "\">"); Response.Write("<input type=\"checkbox\" name=\"Dept" + dt.Rows[i]["cid"].ToString() + "\" value=\"\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("<dl>"); GetNextColumn(dt.Rows[i]["cid"].ToString()); //输出一级部门尾部 Response.Write("</dl>"); Response.Write("</dd>"); } } else { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { //输出一级部门头部 Response.Write("<dt>"); Response.Write("<input type=\"checkbox\" name=\"Dept" + dt.Rows[i]["cid"].ToString() + "\" value=\"" + dt.Rows[i]["cid"].ToString() + "\" id=\"" + dt.Rows[i]["cname"].ToString() + "\">"); Response.Write(dt.Rows[i]["cname"].ToString()); //输出一级部门尾部 Response.Write("</dt>"); } } } } Response.Write("</dl>"); Response.Write("</dd>"); Response.Write("</dl>"); Response.Write("</div>"); Response.Write("<script type=\"text/javascript\" src=\"hyhtml/ltree/js/lTREE.js\"></script>"); Response.Write("<script class=\"lJSFDemo\" type=\"text/javascript\"> "); Response.Write(" var lTree = new lTREE();"); Response.Write(" lTree.config({"); Response.Write(" path : \"dl dd\""); Response.Write(" });"); Response.Write(" lTree.tagName({"); Response.Write(" folder : \"DD\","); Response.Write(" file : \"DT\""); Response.Write(" });"); Response.Write(" lTree.className({"); Response.Write(" folderClose : \"folderClose\","); Response.Write(" lastChild : \"lastChild\""); Response.Write(" });"); Response.Write("var t=new Date(),timer=[];"); Response.Write("lTree.build(\"lTREEMenuDEMO\");"); Response.Write("timer.push(new Date()-t);"); /************************************** * 给树内所有复选框添加相应事件 * * Start */ Response.Write("function chkAll(){"); Response.Write("var a=this.parentNode.getElementsByTagName(\"input\"),b=this.checked;"); Response.Write("for(var i=0,l=a.length; i<l;i++) {"); Response.Write("a[i].checked=b;"); Response.Write("}"); Response.Write("}"); Response.Write("function chkOne(){"); Response.Write("var a=this,b=this.checked,p=lDOM.$(\"lTREEMenuDEMO\"),pn=null;"); Response.Write("while(a.tagName!=\"DD\" && a!=p) a=a.parentNode;"); Response.Write("pn=a.getElementsByTagName(\"input\");"); Response.Write("if(b){"); Response.Write("for(var i=1,l=pn.length; i<l;i++) {"); Response.Write("if(!pn[i].checked){"); Response.Write("b=false;"); Response.Write("break;"); Response.Write("}"); Response.Write("}"); Response.Write("}"); Response.Write("pn[0].checked=b;"); Response.Write("}"); Response.Write("var arrCHK=lDOM.find(\"dl dd input\",lDOM.$(\"lTREEMenuDEMO\"),{type:\"checkbox\"});"); Response.Write("arrCHK.each(function(s){"); Response.Write("if(s.parentNode.tagName==\"DT\"){"); Response.Write("s.onclick=chkOne;"); Response.Write("} else {"); Response.Write("s.onclick=chkAll;"); Response.Write("}"); Response.Write("});"); Response.Write(" </script>"); //Response.Write("</form>"); Response.Write("</Body></HTML>"); } }