コード例 #1
0
        protected override void Initialize()
        {
            string rawurl = Request.RawUrl;
            rawurl = We7Helper.RemoveParamFromUrl(rawurl, "keyword");
            string  qString = @"<label class=""hidden"" for=""user-search-input"">ËÑË÷{0}:</label>
                <input type=""text"" class=""search-input"" id=""KeyWord"" name=""KeyWord"" value=""""  onKeyPress=""javascript:KeyPressSearch('{1}',event);""  />
                <input type=""button"" value=""ËÑË÷"" class=""button"" id=""SearchButton""  onclick=""javascript:doSearch('{1}');""  />";
            qString = string.Format(qString, "À¸Ä¿", rawurl);
            SearchSimpleLiteral.Text = qString;

            MyChannelList = new ArrayList();
            List<Channel> allChannel = null;
            if (!string.IsNullOrEmpty(ChannelType) && ChannelType.ToString() == "link")
            {
                allChannel = ChannelHelper.GetAllLinkChannels();
            }
            else if (!string.IsNullOrEmpty(ChannelType) && ChannelType.ToString() == "article")
            {
                allChannel = ChannelHelper.GetChannelByModelName("");
            }
            else
            {
                Channel ch = ChannelHelper.GetChannel(ColumnID, null);
                string enumState = "";
                if (ch != null) enumState = ch.EnumState;
                allChannel = ChannelHelper.GetChannelsByType(enumState);
            }
            if (allChannel != null)
            {
                GetSubChannels(We7Helper.EmptyGUID, "", allChannel);
            }
            MyChannelList = FilterByKeyword();
            DetailGridView.DataSource = MyChannelList;
            DetailGridView.DataBind();
        }
コード例 #2
0
        /// <summary>
        /// 构建标签项,完全可以通过控制每步骤的display属性
        /// 进行功能项的控制,此属性完全可以进行如同模块式的管理
        /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件
        /// 三者以控制其相应的显示
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            Role r = AccountHelper.GetRole(RoleID);

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "回复统计", dispay);
                Control ctl = this.LoadControl("../Advice/controls/AdviceReplyStatisticsControl.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "回复统计", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }
            return(tabString);
        }
コード例 #3
0
        /// <summary>
        /// 构建标签项,完全可以通过控制每步骤的display属性
        /// 进行功能项的控制,此属性完全可以进行如同模块式的管理
        /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件
        /// 三者以控制其相应的显示
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            string strActive = @"<li class='TabIn' id='tab{0}' style='display:{2}'><a>{1}</a> </li>";
            string strLink   = @"<li class='TabOut' id='tab{0}'  style='display:{2}'><a  href='{3}'>{1}</a> </li>";

            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "站点关联", dispay);
                Control ctl = this.LoadControl("Config_SiteSetting.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "站点关联", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }


            return(tabString);
        }
コード例 #4
0
ファイル: HtmlField.cs プロジェクト: jiaping/JPCMS
        /// <summary>
        /// 获取链接地址
        /// </summary>
        /// <param name="dataitem"></param>
        /// <returns></returns>
        private string GetLinkUrl(object dataitem)
        {
            if (ModelInfo == null)
            {
                ModelInfo = ModelHelper.GetModelInfo(We7Helper.GetParamValueFromUrl(HttpContext.Current.Request.RawUrl, "model"));
            }
            string result = string.Empty;

            foreach (We7DataColumn d in ModelInfo.DataSet.Tables[0].Columns)
            {
                if (d.Name.Contains("_Count"))
                {
                    string model = string.Format("{0}.{1}", ModelInfo.GroupName, d.Name.Remove(d.Name.Length - 6));
                    string url   = We7Helper.AddParamToUrl(HttpContext.Current.Request.RawUrl, "model", model);
                    url    = We7Helper.RemoveParamFromUrl(url, "mode");
                    url    = We7Helper.AddParamToUrl(url, d.Mapping.Split('|')[0], GetValue(dataitem, d.Mapping.Split('|')[1]));
                    result = url;
                    break;
                }
            }
            if (string.IsNullOrEmpty(result))
            {
                result = string.Format("/admin/AddIns/ModelViewer.aspx?notiframe=1&model={0}&ID={1}", ModelInfo.ModelName, GetValue(dataitem, "ID"));
            }
            return(result);
        }
コード例 #5
0
ファイル: content.Master.cs プロジェクト: jiaping/JPCMS
 protected void Page_Init(object sender, EventArgs e)
 {
     if (Request["reboot"] != null)
     {
         ApplicationHelper.ResetApplication();
         string url = We7Helper.RemoveParamFromUrl(this.Request.RawUrl, "reboot");
         Response.Redirect(url, true);
     }
 }
コード例 #6
0
ファイル: Advice_option.ascx.cs プロジェクト: jiaping/JPCMS
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            AdviceType adviceType = new AdviceType();

            adviceType.CreateDate = DateTime.Now;
            int index;

            if (int.TryParse(SortNumber.Text, out index))
            {
                adviceType.Index = index;
            }
            adviceType.Title       = AdviceNameText.Text.Trim();
            adviceType.Description = RemarkText.Text.Trim();

            if (string.IsNullOrEmpty(adviceType.Title))
            {
                Messages.ShowError("模型名称不能为空");
                return;
            }

            if (AdviceTypeID == null || AdviceTypeID == "")             // 新建
            {
                adviceType.AccountID = AccountID;
                string adviceTypeID = We7Helper.CreateNewID();
                adviceType.ID = adviceTypeID;
                AdviceTypeHelper.AddAdviceType(adviceType);
            }
            else                // 修改
            {
                adviceType.ID = AdviceTypeID;
                AdviceTypeHelper.UpdateAdviceType(adviceType);
                Messages.ShowMessage("" + AdviceNameText.Text + " 模型修改成功!!");
            }
            //记录日志
            string content = string.Format("编辑了模型“{0}”的信息", adviceType.Title);

            AddLog("编辑反馈模型", content);

            if (AdviceTypeID == null || AdviceTypeID == "")
            {
                string rawurl = We7Helper.AddParamToUrl(Request.RawUrl, "saved", "1");
                rawurl = We7Helper.RemoveParamFromUrl(rawurl, "adviceTypeID");
                rawurl = We7Helper.AddParamToUrl(rawurl, "adviceTypeID", We7Helper.GUIDToFormatString(adviceType.ID));
                Response.Redirect(rawurl);
            }
        }
コード例 #7
0
        protected override void Initialize()
        {
            string rawurl = Request.RawUrl;

            rawurl = We7Helper.RemoveParamFromUrl(rawurl, "keyword");
            string qString = @"<label class=""hidden"" for=""user-search-input"">ËÑË÷{0}:</label>
                <input type=""text"" class=""search-input"" id=""KeyWord"" name=""KeyWord"" value=""""  onKeyPress=""javascript:KeyPressSearch('{1}',event);""  />
                <input type=""button"" value=""ËÑË÷"" class=""button"" id=""SearchButton""  onclick=""javascript:doSearch('{1}');""  />";

            qString = string.Format(qString, "Àà±ð", rawurl);
            SearchSimpleLiteral.Text = qString;
            rawurl       = We7Helper.GetParamValueFromUrl(rawurl, "type");
            CategoryList = new ArrayList();
            if (rawurl == "dep")
            {
                NameLabel.Text = "Ñ¡ÔñÒ»¸ö²¿ÃÅ";
                List <Common.PF.Department> allDepartments = null;
                allDepartments = AccountHelper.GetDepartments(siteID, We7Helper.EmptyGUID, "", new string[] { "ID", "Title", "Description", "State" });
                foreach (Common.PF.Department d in allDepartments)
                {
                    DrawTreeMenu(d, "");
                }
                CategoryList = FilterByKeyword();
                DetailGridView.DataSource         = CategoryList;
                DetailGridView.Columns[2].Visible = false;
            }
            else
            {
                NameLabel.Text = "Ñ¡ÔñÒ»¸öÀà±ð";
                List <Category> allCategory = null;
                allCategory = CategoryHelper.GetCategoryByParentID(We7Helper.EmptyGUID);
                foreach (Category c in allCategory)
                {
                    DrawTreeMenu(c, "");
                }
                CategoryList = FilterByKeyword();
                DetailGridView.DataSource = CategoryList;
            }
            DetailGridView.DataBind();
        }
コード例 #8
0
        /// <summary>
        /// 构建按类型/状态过滤的超级链接字符串
        /// </summary>
        /// <returns></returns>
        void BuildStateLinks()
        {
            string rawUrl = We7Helper.RemoveParamFromUrl(Request.RawUrl, Keys.QRYSTR_PAGEINDEX);

            rawUrl = rawUrl.Replace("{", "{{").Replace("}", "}}");
            string links = "<li> <a href='" + We7Helper.RemoveParamFromUrl(rawUrl, "state") + "'   {0} >全部<span class=\"count\">({1})</span></a> |</li>" +
                           "<li><a href='" + We7Helper.AddParamToUrl(rawUrl, "state", Convert.ToString((int)AdviceState.WaitAccept)) + "'{2}>待受理<span class=\"count\">({3})</span></a>|</li>" +
                           "<li><a href='" + We7Helper.AddParamToUrl(rawUrl, "state", Convert.ToString((int)AdviceState.WaitHandle)) + "'{4}>待办理<span class=\"count\">({5})</span></a>|</li>" +
                           "<li><a href='" + We7Helper.AddParamToUrl(rawUrl, "state", Convert.ToString((int)AdviceState.Checking)) + "'{6}>审核中<span class=\"count\">({7})</span></a>|</li>" +
                           "<li><a href='" + We7Helper.AddParamToUrl(rawUrl, "state", Convert.ToString((int)AdviceState.Finished)) + "'{8}> 已办结<span class=\"count\">({9})</span></a></li>";

            string css99, css0, css1, css2, css3;

            css99 = css0 = css1 = css2 = css3 = "";
            if (CurrentState == AdviceState.All)
            {
                css99 = " class=\"current\"";
            }
            if (CurrentState == AdviceState.WaitAccept)
            {
                css0 = " class=\"current\"";
            }
            if (CurrentState == AdviceState.WaitHandle)
            {
                css1 = " class=\"current\"";
            }
            if (CurrentState == AdviceState.Checking)
            {
                css2 = " class=\"current\"";
            }
            if (CurrentState == AdviceState.Finished)
            {
                css3 = " class=\"current\"";
            }
            links = string.Format(links, css99, _GetAdviceCountByState(AdviceState.All),
                                  css0, _GetAdviceCountByState(AdviceState.WaitAccept), css1, _GetAdviceCountByState(AdviceState.WaitHandle),
                                  css2, _GetAdviceCountByState(AdviceState.Checking), css3, _GetAdviceCountByState(AdviceState.Finished));

            StateLiteral.Text = links;
        }
コード例 #9
0
 /// <summary>
 /// 获取链接地址
 /// </summary>
 /// <param name="dr"></param>
 /// <param name="a"></param>
 private void GetLinkUrl(DataRow dr, HtmlAnchor a)
 {
     a.HRef = string.Empty;
     foreach (We7DataColumn d in PanelContext.Model.DataSet.Tables[0].Columns)
     {
         if (d.Name.Contains("_Count"))
         {
             string model = string.Format("{0}.{1}", PanelContext.Model.GroupName, d.Name.Remove(d.Name.Length - 6));
             string url   = We7Helper.AddParamToUrl(Request.RawUrl, "model", model);
             url         = We7Helper.RemoveParamFromUrl(url, "mode");
             url         = We7Helper.AddParamToUrl(url, d.Mapping.Split('|')[0], dr[d.Mapping.Split('|')[1]].ToString());
             a.HRef      = url;
             countEnable = true;
             columnCount = d.Name;
             break;
         }
     }
     if (string.IsNullOrEmpty(a.HRef))
     {
         a.HRef   = string.Format("/admin/AddIns/ModelViewer.aspx?notiframe=1&model={0}&ID={1}", PanelContext.ModelName, dr["ID"]);
         a.Target = "_blank";
     }
 }
コード例 #10
0
        void ArticleAttachmentFileUpload()
        {
            if (AttachmentFileUpload.FileName.Length < 1)
            {
                Messages.ShowError("附件不能为空!");
                return;
            }
            if (CDHelper.CanUploadAttachment(AttachmentFileUpload.FileName))
            {
                Messages.ShowError("不支持上传该类型的文件。");
                return;
            }
            string ap = GenerateFileName(Path.GetFileName(AttachmentFileUpload.FileName));

            try
            {
                AttachmentFileUpload.SaveAs(ap);
            }
            catch (IOException ex)
            {
                Messages.ShowError("附件上传失败!" + ex.Message);
                return;
            }

            Attachment a = new Attachment();

            a.FileName  = Path.GetFileName(ap);
            a.FilePath  = GetAttachmentPath();
            a.FileSize  = AttachmentFileUpload.PostedFile.ContentLength;
            a.FileType  = Path.GetExtension(ap);
            a.ArticleID = ArticleID;
            AttachmentHelper.AddAttachment(a);
            string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            rawurl = We7Helper.AddParamToUrl(rawurl, "saved", "1");
            Response.Redirect(rawurl);
        }
コード例 #11
0
ファイル: AdviceTypeEdit.aspx.cs プロジェクト: jiaping/JPCMS
        /// <summary>
        /// 构建标签项,完全可以通过控制每步骤的display属性
        /// 进行功能项的控制,此属性完全可以进行如同模块式的管理
        /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件
        /// 三者以控制其相应的显示
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            Role r = AccountHelper.GetRole(RoleID);

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "基本属性", dispay);
                Control ctl = this.LoadControl("../Advice/controls/Advice_Option.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "基本属性", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }

            if (AdviceTypeID == null || AdviceTypeID == "")
            {
                return(tabString);
            }
            else
            {
                if (tab == 2)
                {
                    tabString += string.Format(strActive, 2, "办理流程", dispay);
                    Control ctl = this.LoadControl("../Advice/controls/Advice_Config.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 2, "办理流程", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
                }


                if (tab == 3)
                {
                    tabString += string.Format(strActive, 3, "反馈表单", dispay);
                    Control ctl = this.LoadControl("../Advice/controls/Advice_File.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 3, "反馈表单", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
                }


                if (tab == 4)
                {
                    tabString += string.Format(strActive, 4, "办理权限", dispay);
                    Control ctl = this.LoadControl("../Advice/controls/Advice_Authorize.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 4, "办理权限", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
                }

                return(tabString);
            }
        }
コード例 #12
0
ファイル: PluginAdd.aspx.cs プロジェクト: jiaping/JPCMS
        internal string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            ContentHolder.Controls.Clear();

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "起始页", dispay);
                Control      ctl  = this.LoadControl("~/Admin/Plugin/controls/Plugin_Start.ascx");
                Plugin_Start pctr = ctl as Plugin_Start;
                if (pctr != null)
                {
                    pctr.PluginType = PluginType;
                }
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "起始页", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }


            if (IsQuery)
            {
                if (tab == 0)
                {
                    tabString += string.Format(strActive, 0, "搜索结果", dispay);
                    //AddListControl(PluginQueryType.USERDEFINED);
                    AddListCtr(9);
                }
            }

            if (tab == 2)
            {
                tabString += string.Format(strActive, 2, "待授权插件", dispay);
                LoadMyPluginsCtr();
            }
            else
            {
                tabString += string.Format(strLink, 2, "待授权插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
            }

            if (tab == 7)
            {
                tabString += string.Format(strActive, 7, "注册到本站的插件", dispay);
                LoadRegistedCtr();
            }
            else
            {
                tabString += string.Format(strLink, 7, "注册到本站的插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "7"));
            }


            if (tab == 3)
            {
                tabString += string.Format(strActive, 3, "精选插件", dispay);
                //AddListControl(PluginQueryType.HOT);
                AddListCtr(1);
            }
            else
            {
                tabString += string.Format(strLink, 3, "精选插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
            }


            if (tab == 4)
            {
                tabString += string.Format(strActive, 4, "热门插件", dispay);
                //AddListControl(PluginQueryType.LATEST);
                AddListCtr(2);
            }
            else
            {
                tabString += string.Format(strLink, 4, "热门插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
            }


            if (tab == 5)
            {
                tabString += string.Format(strActive, 5, "最新添加", dispay);
                //AddListControl(PluginQueryType.UPDATED);
                AddListCtr(3);
            }
            else
            {
                tabString += string.Format(strLink, 5, "最新添加", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5"));
            }

            if (tab == 6)
            {
                tabString += string.Format(strActive, 6, "最新更新", dispay);
                //AddListControl(PluginQueryType.UPDATED);
                AddListCtr(4);
            }
            else
            {
                tabString += string.Format(strLink, 6, "最新更新", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "6"));
            }
            return(tabString);
        }
コード例 #13
0
        /// <summary>
        /// 构建标签项,完全可以通过控制每步骤的display属性
        /// 进行功能项的控制,此属性完全可以进行如同模块式的管理
        /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件
        /// 三者以控制其相应的显示
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "基本信息", dispay);
                Control ctl = this.LoadControl("~/User/Controls/Account_Basic.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }

            if (ActID != null)
            {
                Account acc     = AccountHelper.GetAccount(ActID, new string[] { "LoginName", "UserType" });
                string  actName = acc.LoginName;

                if (acc != null)
                {
                    dispay = "";
                }
                else
                {
                    dispay = "none";
                }

                if (tab == 4)
                {
                    tabString += string.Format(strActive, 4, "选项", dispay);
                    Control ctl = this.LoadControl("~/User/Controls/Account_Extent.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 4, "选项", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
                }
                if (tab == 5)
                {
                    tabString += string.Format(strActive, 5, "密码设置", dispay);
                    Control ctl = this.LoadControl("~/User/Controls/Account_Password.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 5, "密码设置", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5"));
                }
            }

            return(tabString);
        }
コード例 #14
0
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            //记录操作历史,按照操作历史延续
            if (!We7Helper.IsEmptyID(ChannelID) && Session["$We7_Channel_Tab"] != null)
            {
                tab = (int)Session["$We7_Channel_Tab"];
            }

            if (TabID != null && We7Helper.IsNumber(TabID) && int.Parse(TabID) > 0)
            {
                tab = int.Parse(TabID);
            }

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "基本信息", dispay);
                Control ctl = this.LoadControl("controls/Channel_basic.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }

            if (!We7Helper.IsEmptyID(ChannelID))
            {
                if (tab == 2)
                {
                    tabString += string.Format(strActive, 2, "选项", dispay);
                    Control ctl = this.LoadControl("controls/Channel_option.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 2, "选项", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
                }


                if (tab == 3)
                {
                    tabString += string.Format(strActive, 3, "模板", dispay);
                    Control ctl = this.LoadControl("controls/Channel_template.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 3, "模板", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
                }


                if (tab == 4)
                {
                    tabString += string.Format(strActive, 4, "标签", dispay);
                    Control ctl = this.LoadControl("controls/Channel_tag.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 4, "标签", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
                }


                if (tab == 5)
                {
                    tabString += string.Format(strActive, 5, "权限", dispay);
                    Control ctl = this.LoadControl("controls/Channel_authorize.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 5, "权限", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5"));
                }

                if (SiteConfigs.GetConfig().SiteGroupEnabled)
                {
                    MoreEventArgs evenArgs = new MoreEventArgs();
                    //ShareEvent shareEvent =  new ShareEvent();
                    //shareEvent
                    ShareEventFactory.Instance.OnLoadChannelShareConfig(tab, evenArgs);
                    tabString += evenArgs.ReturnValue;
                    Control c = evenArgs.ReturnObject as Control;
                    if (c != null)
                    {
                        ContentHolder.Controls.Add(c);
                    }
                }
                if (System.IO.File.Exists(Server.MapPath("/Plugins/IPStrategyPlugin/Plugin.xml")))
                {
                    if (tab == 7)
                    {
                        tabString += string.Format(strActive, 7, "IP过滤", dispay);
                        Control ctl = this.LoadControl("controls/StrategySet.ascx");
                        if (ctl is StrategySet)
                        {
                            ((StrategySet)ctl).Mode = StrategyMode.CHANNEL;
                        }
                        ContentHolder.Controls.Add(ctl);
                    }
                    else
                    {
                        tabString += string.Format(strLink, 7, "IP过滤", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "7"));
                    }
                }


                //if (tab == 8)
                //{
                //    tabString += string.Format(strActive, 8, "附加模块", dispay);
                //    Control ctl = this.LoadControl("controls/Channel_Module.ascx");
                //    ContentHolder.Controls.Add(ctl);
                //}
                //else
                //    tabString += string.Format(strLink, 8, "附加模块", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "8"));
            }

            Session["$We7_Channel_Tab"] = tab;
            return(tabString);
        }
コード例 #15
0
ファイル: AccountEdit.aspx.cs プロジェクト: jiaping/JPCMS
        /// <summary>
        /// 构建标签项,完全可以通过控制每步骤的display属性
        /// 进行功能项的控制,此属性完全可以进行如同模块式的管理
        /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件
        /// 三者以控制其相应的显示
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "基本信息", dispay);
                Control ctl = this.LoadControl("../Permissions/Account_Basic.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }

            if (ActID != null)
            {
                Account acc     = AccountHelper.GetAccount(ActID, new string[] { "LoginName", "UserType" });
                string  actName = acc.LoginName;

                if (acc != null)
                {
                    dispay = "";
                }
                else
                {
                    dispay = "none";
                }

                if (tab == 4)
                {
                    tabString += string.Format(strActive, 4, "选项", dispay);
                    Control ctl = this.LoadControl("../Permissions/Account_Extend.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 4, "选项", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
                }

                if (tab == 2)
                {
                    tabString += string.Format(strActive, 2, "角色设置", dispay);
                    Account_Roles ctl = this.LoadControl("../Permissions/Account_Roles.ascx") as Account_Roles;
                    if (acc.UserType == (int)OwnerRank.Admin)
                    {
                        ctl.RoleType = OwnerRank.All;
                    }
                    else
                    {
                        ctl.RoleType = (OwnerRank)acc.UserType;
                    }
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 2, "角色设置", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
                }

                if (tab == 3)
                {
                    tabString += string.Format(strActive, 3, "会员菜单", dispay);
                    //向动态控件传参
                    Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func;
                    ctl.OwnerType = "account";
                    ctl.OwnerID   = ActID;
                    ctl.ObjectID  = "System.User";
                    ctl.EntityID  = "System.User";
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 3, "会员菜单", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
                }

                //if (acc.UserType == (int)OwnerRank.Admin)
                if (Security.CurrentAccountID.Equals(We7Helper.EmptyGUID))//这儿修改后的意思是只有超级管理员才能设置管理员
                {
                    if (tab == 6)
                    {
                        tabString += string.Format(strActive, 6, "后台菜单", dispay);
                        //向动态控件传参
                        Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func;
                        ctl.OwnerType = "account";
                        ctl.OwnerID   = ActID;
                        ctl.ObjectID  = "System.Administration";
                        ctl.EntityID  = "System.Administration";
                        ContentHolder.Controls.Add(ctl);
                    }
                    else
                    {
                        tabString += string.Format(strLink, 6, "后台菜单", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "6"));
                    }
                }

                if (tab == 5)
                {
                    tabString += string.Format(strActive, 5, "积分", dispay);
                    Account_Points ctl = this.LoadControl("../Permissions/Account_Points.ascx") as Account_Points;
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 5, "积分", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5"));
                }
            }

            return(tabString);
        }
コード例 #16
0
ファイル: AdviceListEx.aspx.cs プロジェクト: jiaping/JPCMS
        private string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 0;
            bool   hasFirst  = false;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab      = int.Parse(TabID);
                hasFirst = true;
            }

            if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin"))
            {
                if (tab == 1 || !hasFirst)
                {
                    tabString += string.Format(strActive, 1, "全部", dispay);
                    AddControl(10);
                    hasFirst = true;
                }
                else
                {
                    tabString += string.Format(strLink, 1, "全部", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
                }
            }

            if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept"))
            {
                if (tab == 2 || !hasFirst)
                {
                    tabString += string.Format(strActive, 2, "待受理", dispay);
                    AddControl(0);
                    hasFirst = true;
                }
                else
                {
                    tabString += string.Format(strLink, 2, "待受理", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
                }
            }

            if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Handle"))
            {
                if (tab == 3 || !hasFirst)
                {
                    tabString += string.Format(strActive, 3, "待办中", dispay);
                    AddControl(2);
                    hasFirst = true;
                }
                else
                {
                    tabString += string.Format(strLink, 3, "待办中", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
                }
            }

            if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept") || Permisstions.Contains("Advice.Handle"))
            {
                if (tab == 6 || !hasFirst)
                {
                    tabString += string.Format(strActive, 6, "不受理", dispay);
                    AddControl(1);
                    hasFirst = true;
                }
                else
                {
                    tabString += string.Format(strLink, 6, "不受理", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "6"));
                }
            }

            if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept") || Permisstions.Contains("Advice.Handle"))
            {
                if (tab == 5 || !hasFirst)
                {
                    tabString += string.Format(strActive, 5, "已办结", dispay);
                    AddControl(9);
                    hasFirst = true;
                }
                else
                {
                    tabString += string.Format(strLink, 5, "已办结", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5"));
                }
            }

            if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept") || Permisstions.Contains("Advice.Handle"))
            {
                if (tab == 4 || !hasFirst)
                {
                    tabString += string.Format(strActive, 4, "转办记录", dispay);
                    AddControl(3);
                    hasFirst = true;
                }
                else
                {
                    tabString += string.Format(strLink, 4, "转办记录", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
                }
            }

            return(tabString);
        }
コード例 #17
0
ファイル: ArticleEdit.aspx.cs プロジェクト: jiaping/JPCMS
        /// <summary>
        /// 构建标签项
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            XmlDocument docType = new XmlDocument();

            if (Application["We7.docType"] == null)
            {
                //加载内容信息类型
                string fileName = Server.MapPath("Config/tab-index.xml");
                if (File.Exists(fileName))
                {
                    docType.Load(fileName);
                    Application.Add("We7.docType", docType);
                }
            }

            docType = Application["We7.docType"] as XmlDocument;
            string tab = "", basictag = "";
            string loadControl = "../controls/Article_option.ascx";
            string loadName    = "基本信息";
            string tabString   = "";
            string dispay      = "";

            string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");
            if (TabID != null && TabID != "")
            {
                tab = TabID;
            }

            int         menuCount = 0;
            XmlNodeList itemNodes = docType.SelectNodes("/configuration/item");

            foreach (XmlNode node in itemNodes)
            {
                string value = node.Attributes["value"].Value;
                if (ChannelContentType == Int32.Parse(value))
                {
                    if (node.Attributes["basictag"] != null)
                    {
                        basictag = node.Attributes["basictag"].Value;
                    }

                    if (string.IsNullOrEmpty(tab) && node.ChildNodes.Count > 0)
                    {
                        basictag = node.ChildNodes[0].Attributes["name"].Value;                         //默认第一个tab为基础tab
                    }
                    if (string.IsNullOrEmpty(tab))
                    {
                        tab = basictag;
                    }

                    foreach (XmlNode tagNode in node.ChildNodes)
                    {
                        if (tagNode.Attributes != null && !tagNode.HasChildNodes)
                        {
                            menuCount++;
                            string tagValue = tagNode.Attributes["name"].Value;
                            if (tagValue == "Article_ipStrategy" && !System.IO.File.Exists(Server.MapPath("/Plugins/IPStrategyPlugin/Plugin.xml")))
                            {
                                break;
                            }
                            loadControl = tagNode.Attributes["control"].Value;
                            loadName    = tagNode.Attributes["value"].Value;
                            if (ArticleID != null && ArticleID != "")
                            {
                                dispay = TabVisble(tagValue);
                            }
                            if (tab == tagValue)
                            {
                                tabString += LoadActiveTabString(basictag, tagValue, loadName, loadControl, dispay);
                            }
                            else
                            {
                                tabString += LoadLinkTabString(basictag, tagValue, loadName, loadControl, rawurl, dispay);
                            }
                        }
                    }
                }
            }

            List <ChannelModuleMapping> mappings = HelperFactory.GetHelper <ChannelModuleHelper>().GetMappingByChannelID(OwnerID);

            foreach (ChannelModuleMapping m in mappings)
            {
                ColumnModule module = HelperFactory.GetHelper <ChannelModuleHelper>().GetModule(m.ModuleID);
                if (tab == menuCount.ToString())
                {
                    tabString += LoadActiveTabString(basictag, menuCount.ToString(), module.Title, module.Path, String.Empty);
                }
                else
                {
                    tabString += LoadLinkTabString(basictag, menuCount.ToString(), module.Title, module.Path, rawurl, String.Empty);
                }
                menuCount++;
            }

            return(tabString);
        }
コード例 #18
0
ファイル: Article_option.ascx.cs プロジェクト: jiaping/JPCMS
        void SaveArticle()
        {
            try
            {
                if (CDHelper.Config.EnableLoginAuhenCode == "true" && this.ValidateTextBox.Text != Request.Cookies["AreYouHuman"].Value)
                {
                    Messages.ShowError("错误:您输入的验证码不正确,请重新输入!");
                    // Clear the input and create a new random code.
                    this.ValidateTextBox.Text             = "";
                    Response.Cookies["AreYouHuman"].Value = CaptchaImage.GenerateRandomCode();
                    return;
                }

                string ownerId = OwnerID;
                if (ownerId == null)
                {
                    ownerId = ChannelDropDownList.SelectedValue;
                }

                if (String.IsNullOrEmpty(ownerId))
                {
                    Messages.ShowError("文章栏目不能为空!");
                    return;
                }

                Article a = ThisArticle;
                a.Description = DescriptionTextBox.Value;
                a.Title       = TitleTextBox.Value;
                a.SubTitle    = SubTitleTextBox.Value;
                a.Color       = ddlColor.SelectedValue;
                a.FontStyle   = chkItalic.Checked ? "Italic" : "";
                a.FontWeight  = chkBold.Checked ? "Bold" : "";
                //a.ID = ArticleID;
                if (IndexTextBox.Value.Trim() == "")
                {
                    a.Index = 0;
                }
                else
                {
                    a.Index = Convert.ToInt32(IndexTextBox.Value);
                }
                a.Source        = SourceTextBox.Value;
                a.AllowComments = AllowCommentsCheckBox.Checked ? 1 : 0;
                //if (IsShowCheckBox.Checked)
                //{
                //    a.EnumState = StateMgr.StateInitialize();
                //    a.EnumState = StateMgr.StateProcess(a.EnumState, EnumLibrary.Business.HomeRecommend, 1);
                //}
                //a.IsShow = IsShowCheckBox.Checked ? 1 : 0;
                a.Author      = AuthorTextBox.Value;
                a.State       = Convert.ToInt32(StateDropDownList.SelectedValue);
                a.ContentType = Convert.ToInt32(ActicleTypeDropDownList.SelectedValue);
                //a.IsImage = (TypeOfArticle)a.ContentType == TypeOfArticle.QuoteArticle || (TypeOfArticle)a.ContentType == TypeOfArticle.ShareArticle ? 1 : 0;
                a.ContentUrl     = ContentUrlTextBox.Value;
                a.Content        = We7Helper.ConvertPageBreakFromVisualToChar(ContentTextBox.Value);
                a.KeyWord        = KeywordTextBox.Value;
                a.DescriptionKey = DescriptionKeyTextBox.Value;

                if (GeneralConfigs.GetConfig().AllowParentArticle&& !string.IsNullOrEmpty(ParentArticleID.Value))
                {
                    a.ParentID = ParentArticleID.Value;
                }
                else
                {
                    a.ParentID = We7Helper.EmptyGUID;
                }

                if (UpdatedTextBox.Value.Trim() == "")
                {
                    a.Updated = DateTime.Now;
                }
                else
                {
                    a.Updated = Convert.ToDateTime(UpdatedTextBox.Value);
                }
                if (txtInvalidDate.Value != "")
                {
                    a.Overdue = Convert.ToDateTime(txtInvalidDate.Value.Trim());
                }
                else
                {
                    GeneralConfigInfo si = GeneralConfigs.GetConfig();
                    int OverdueDateTime  = si.OverdueDateTime;
                    a.Overdue = a.Updated.AddDays(OverdueDateTime);
                }
                if (ArticleID == null)
                {
                    a.AccountID = AccountID;
                    a.OwnerID   = ownerId;
                    Channel ch = ChannelHelper.GetChannel(ownerId, null);
                    if (ch.FullUrl != null && ch.FullUrl != "")
                    {
                        a.ChannelFullUrl = ch.FullUrl;
                    }
                    if (ch.Process != null && ch.Process == "1")
                    {
                        a.State = 2;
                    }
                    //a.ChannelName = ch.ChannelName;
                    /*这儿把上面一句注了,改成了下面的。上面一句与老系统不兼容*/
                    a.ChannelName     = ch.Name;
                    a.FullChannelPath = ch.FullPath;
                    //int type = StateMgr.GetStateValue(ch.EnumState, EnumLibrary.Business.ChannelContentType);
                    //a.EnumState = StateMgr.StateProcess(a.EnumState, EnumLibrary.Business.ArticleType, type);
                    // a.State = 0;

                    //如果禁用
                    if (StateDropDownList.SelectedValue == "0")
                    {
                        a.state = 0;
                    }
                    Article article = ArticleHelper.AddArticles(a);
                    // 往全文检索里插入数据

                    ArticleIndexHelper.InsertData(article.ID, 0);

                    #region 自动提交一审(mxy2011-10-18)
                    if (ch.Process != null && ch.Process == "1" && StateDropDownList.SelectedValue != "0")
                    {
                        Processing ap = ArticleProcessHelper.GetArticleProcess(article);
                        if (ap.ArticleState != ArticleStates.Checking)
                        {
                            string accName = AccountHelper.GetAccount(AccountID, new string[] { "LastName" }).LastName;
                            ap.ProcessState     = ProcessStates.FirstAudit;
                            ap.ProcessDirection = ((int)ProcessAction.Next).ToString();
                            ap.ProcessAccountID = AccountID;
                            ap.ApproveName      = accName;
                            ArticleProcessHelper.SaveFlowInfoToDB(article, ap);
                        }
                    }
                    #endregion

                    //记录日志
                    string content = string.Format("新建文章:“{0}”", a.Title);
                    AddLog("新建文章", content);
                }
                else
                {
                    Channel  ch     = ChannelHelper.GetChannel(ownerId, null);
                    string[] fields = new string[] { "Description", "Title", "Content", "Updated", "Index", "Source", "AllowComments", "Author", "State", "IsShow", "IsImage", "SubTitle", "ContentUrl", "ContentType", "IsDeleted", "Overdue", "KeyWord", "DescriptionKey", "ParentID", "FullChannelPath", "ChannelFullUrl", "Color", "FontWeight", "FontStyle" };

                    ArticleHelper.UpdateArticle(a, fields);

                    // 往全文检索里更新数据
                    ArticleIndexHelper.InsertData(a.ID, 0);

                    if (ch.Process != null && ch.Process == "1" && StateDropDownList.SelectedValue != "0")
                    {
                        Processing ap = ArticleProcessHelper.GetArticleProcess(a);
                        if (ap.ArticleState != ArticleStates.Checking && ap.ProcessState != ProcessStates.EndAudit)
                        {
                            //编辑审核启用
                            if (ch.Process != null && ch.Process == "1" && StateDropDownList.SelectedValue != "0")
                            {
                                a.State = 2;
                                ArticleHelper.UpdateArticle(a, new string[] { "State" });
                            }

                            string accName = AccountHelper.GetAccount(AccountID, new string[] { "LastName" }).LastName;
                            ap.ProcessState     = ProcessStates.FirstAudit;
                            ap.ProcessDirection = ((int)ProcessAction.Next).ToString();
                            ap.ProcessAccountID = AccountID;
                            ap.ApproveName      = accName;
                            ArticleProcessHelper.SaveFlowInfoToDB(a, ap);
                        }
                    }
                    //记录日志
                    string content = string.Format("修改了文章“{0}”", a.Title);
                    AddLog("编辑文章", content);
                }

                string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");
                if (!String.IsNullOrEmpty(ArticleID))
                {
                    rawurl = We7Helper.AddParamToUrl(rawurl, "saved", "1");
                    rawurl = We7Helper.AddParamToUrl(rawurl, "Submit", "1");
                }
                else
                {
                    rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "oid");
                    rawurl = We7Helper.RemoveParamFromUrl(rawurl, "ParentID");
                    rawurl = We7Helper.AddParamToUrl(rawurl, "id", a.ID);
                    rawurl = We7Helper.AddParamToUrl(rawurl, "Submit", "0");
                }

                Response.Redirect(rawurl);
            }
            catch (FormatException)
            {
                Messages.ShowError("无法保存文章信息:可能是文章排序或修改日期格式不正确。");
                return;
            }
            catch (Exception ex)
            {
                Messages.ShowError("无法保存文章信息:" + ex.Message);
            }
        }
コード例 #19
0
ファイル: PluginDetails.aspx.cs プロジェクト: jiaping/JPCMS
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            //Article a = ArticleHelper.GetArticle(ChannelID);
            PluginInfo info = null, infoLocale = null;
            string     isRemote = Request.QueryString["remote"];

            if (!String.IsNullOrEmpty(isRemote) && isRemote.Trim() == "1")
            {
                info = GetRemotePluginInfo();
            }
            else
            {
                info = PluginInfoCollection.CreateInstance(PluginType)[Request.QueryString["key"]];
            }

            InitLeftDiv(info);
            ContentLiteral.Text = "";

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "简介", dispay);

                ContentLiteral.Text = info != null ? info.Description : "";
            }
            else
            {
                tabString += string.Format(strLink, 1, "简介", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }

            if (tab == 2)
            {
                tabString          += string.Format(strActive, 2, "安装", dispay);
                ContentLiteral.Text = info != null ? info.Deployment.Introduction : "";
            }
            else
            {
                tabString += string.Format(strLink, 2, "安装", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
            }


            if (tab == 3)
            {
                tabString += string.Format(strActive, 3, "截图", dispay);

                if (info != null)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (string src in info.Snapshot)
                    {
                        sb.Append(String.Format("<img src='{2}/Temp/{0}/{1}' ></img>", Request.QueryString["key"], src, GeneralConfigs.GetConfig().PluginServer));
                    }
                    ContentLiteral.Text = sb.ToString();
                }
            }
            else
            {
                tabString += string.Format(strLink, 3, "截图", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
            }


            if (tab == 4)
            {
                tabString          += string.Format(strActive, 4, "其它", dispay);
                ContentLiteral.Text = info != null ? info.Others : "";
            }
            else
            {
                tabString += string.Format(strLink, 4, "其它", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4"));
            }

            return(tabString);
        }
コード例 #20
0
        void SaveInformation()
        {
            if (DemoSiteMessage)
            {
                return;
            }

            Channel ch          = new Channel();
            string  channelname = "";
            string  oldpath     = "";

            if (!We7Helper.IsEmptyID(ChannelID))
            {
                ch          = ChannelHelper.GetChannel(ChannelID, null);
                channelname = ch.Name;
                oldpath     = ch.FullPath;
            }


            ch.Name        = NameTextBox.Text;
            ch.Description = DescriptionTextBox.Text;
            ch.State       = Convert.ToInt32(StateDropDownList.SelectedValue);

            //TODO::这一句在新的版本中请删去。
            //ch.EnumState = StateMgr.StateProcess(ch.EnumState,
            //    EnumLibrary.Business.ChannelContentType, ModelHelper.GetModelValue(ContentTypeDropDownList.SelectedValue));

            ch.ParentID    = ParentID;
            ch.Type        = TypeDropDownList.SelectedValue;
            ch.ChannelName = ChannelNameHidden.Text;
            ch.ReturnUrl   = ReturnUrlTextBox.Text;
            //ch.ChannelFolder = CreateFolder(ChannelNameHidden.Text);
            ch.ModelName = ContentTypeDropDownList.SelectedValue;

            if (We7Helper.IsEmptyID(ch.ID))
            {
                Channel channel = ChannelHelper.AddChanel(ch);
                //IDLabel.Text = ch.ID.ToString();
                //CreatedLabel.Text = ch.Created.ToString();

                //记录日志
                string content = string.Format("新建栏目“{0}”", NameTextBox.Text);
                AddLog("新建栏目", content);

                string rawurl = We7Helper.AddParamToUrl(Request.RawUrl, "saved", "1");
                rawurl = We7Helper.RemoveParamFromUrl(rawurl, "pid");
                rawurl = We7Helper.AddParamToUrl(rawurl, "id", ch.ID);
                Response.Redirect(rawurl);
            }
            else
            {
                //ch.FullPath = ch.FullPath.Replace(channelname, NameTextBox.Text.Trim());
                ChannelHelper.UpdateChannel(ch);
                if (channelname != NameTextBox.Text.Trim())
                {
                    ChannelHelper.UpdateChannelPathBatch(ch, oldpath);
                }

                Messages.ShowMessage("栏目信息已经成功更新。");
                ShowInfomation();

                Response.Write("<script language=javascript>window.parent.freshNodeText('" + ch.Name + "');</script>");
                //记录日志
                string content = string.Format("修改了栏目“{0}”的信息", NameTextBox.Text);
                AddLog("编辑栏目", content);
            }
        }
コード例 #21
0
        /// <summary>
        /// 构建标签项,完全可以通过控制每步骤的display属性
        /// 进行功能项的控制,此属性完全可以进行如同模块式的管理
        /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件
        /// 三者以控制其相应的显示
        /// </summary>
        /// <returns></returns>
        string BuildNavString()
        {
            string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>";
            string strLink   = @"<LI class=TabOut id=tab{0}  style='display:{2}'><A  href={3}>{1}</A> </LI>";
            int    tab       = 1;
            string tabString = "";
            string dispay    = "";
            string rawurl    = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab");

            rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved");

            if (TabID != null && We7Helper.IsNumber(TabID))
            {
                tab = int.Parse(TabID);
            }

            Role r = AccountHelper.GetRole(RoleID);

            if (tab == 1)
            {
                tabString += string.Format(strActive, 1, "基本信息", dispay);
                Control ctl = this.LoadControl("../Permissions/Role_Basic.ascx");
                ContentHolder.Controls.Add(ctl);
            }
            else
            {
                tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1"));
            }

            if (RoleID != null)
            {
                if (r != null)
                {
                    dispay = "";
                }
                else
                {
                    dispay = "none";
                }

                if (tab == 2)
                {
                    tabString += string.Format(strActive, 2, "所属用户", dispay);
                    Control ctl = this.LoadControl("../Permissions/Role_Accounts.ascx");
                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 2, "所属用户", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2"));
                }

                if (tab == 3)
                {
                    tabString += string.Format(strActive, 3, "模块权限", dispay);

                    //向动态控件传参
                    Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func;
                    ctl.OwnerType = "role";
                    ctl.OwnerID   = r.ID;

                    if ((OwnerRank)r.RoleType == OwnerRank.Admin)
                    {
                        ctl.ObjectID = "System.Administration";
                        ctl.EntityID = "System.Administration";
                    }
                    else
                    {
                        ctl.ObjectID = "System.User";
                        ctl.EntityID = "System.User";
                    }

                    ContentHolder.Controls.Add(ctl);
                }
                else
                {
                    tabString += string.Format(strLink, 3, "模块权限", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3"));
                }


                //    dispay = "";

                //if (tab == 4)
                //{
                //    tabString += string.Format(strActive, 4, "功能权限", dispay);

                //    //向动态控件传参
                //    Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func;
                //    ctl.OwnerType = "role";
                //    ctl.OwnerID = r.ID;
                //    ctl.ObjectID = Helper.EmptyGUID;
                //    ctl.EntityID = "System.Function";
                //    ContentHolder.Controls.Add(ctl);
                //}
                //else
                //    tabString += string.Format(strLink, 4, "功能权限", dispay, Helper.AddParamToUrl(rawurl, "tab", "4"));
            }

            return(tabString);
        }