Esempio n. 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (AuthRequest.IsQueryExists("FileName"))
            {
                _fileName = AuthRequest.GetQueryString("FileName");
                _fileName = PathUtils.RemoveParentPath(_fileName);
            }
            _directoryPath = PathUtility.MapPath(SiteInfo, "@/js");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Template);

            LtlPageTitle.Text = string.IsNullOrEmpty(_fileName) ? "添加脚本文件" : "编辑脚本文件";

            var isCodeMirror = SiteInfo.Additional.ConfigTemplateIsCodeMirror;

            BtnEditorType.Text   = isCodeMirror ? "采用纯文本编辑模式" : "采用代码编辑模式";
            PhCodeMirror.Visible = isCodeMirror;

            ECharsetUtils.AddListItems(DdlCharset);

            if (_fileName != null)
            {
                if (!EFileSystemTypeUtils.IsJs(PathUtils.GetExtension(_fileName)))
                {
                    PageUtils.RedirectToErrorPage("对不起,此文件无法编辑!");
                }
                else
                {
                    TbRelatedFileName.Text = PathUtils.RemoveExtension(_fileName);
                    var fileCharset = FileUtils.GetFileCharset(PathUtils.Combine(_directoryPath, _fileName));
                    ControlUtils.SelectSingleItemIgnoreCase(DdlCharset, ECharsetUtils.GetValue(fileCharset));
                    TbContent.Text = FileUtils.ReadText(PathUtils.Combine(_directoryPath, _fileName), fileCharset);
                }
            }
            else
            {
                ControlUtils.SelectSingleItemIgnoreCase(DdlCharset, SiteInfo.Additional.Charset);
            }
        }
Esempio n. 2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, "站点配置管理", AppManager.Cms.Permission.WebSite.Configration);

                TbPublishmentSystemUrl.Text = PublishmentSystemInfo.PublishmentSystemUrl;
                TbHomeUrl.Text = PublishmentSystemInfo.Additional.HomeUrl;
                EBooleanUtils.AddListItems(DdlIsMultiDeployment, "内外网分离部署", "默认部署");
                ControlUtils.SelectListItems(DdlIsMultiDeployment, PublishmentSystemInfo.Additional.IsMultiDeployment.ToString());

                TbSiteUrl.Text = PublishmentSystemInfo.Additional.SiteUrl;
                TbApiUrl.Text  = PublishmentSystemInfo.Additional.ApiUrl;

                TbOuterSiteUrl.Text = PublishmentSystemInfo.Additional.OuterSiteUrl;
                TbInnerSiteUrl.Text = PublishmentSystemInfo.Additional.InnerSiteUrl;
                TbOuterApiUrl.Text  = PublishmentSystemInfo.Additional.OuterApiUrl;
                TbInnerApiUrl.Text  = PublishmentSystemInfo.Additional.InnerApiUrl;

                DdlIsMultiDeployment_SelectedIndexChanged(null, EventArgs.Empty);

                ECharsetUtils.AddListItems(DdlCharset);
                ControlUtils.SelectListItems(DdlCharset, PublishmentSystemInfo.Additional.Charset);

                TbPageSize.Text = PublishmentSystemInfo.Additional.PageSize.ToString();

                EBooleanUtils.AddListItems(RblIsCountHits, "统计", "不统计");
                ControlUtils.SelectListItemsIgnoreCase(RblIsCountHits, PublishmentSystemInfo.Additional.IsCountHits.ToString());

                EBooleanUtils.AddListItems(RblIsCountHitsByDay, "统计", "不统计");
                ControlUtils.SelectListItemsIgnoreCase(RblIsCountHitsByDay, PublishmentSystemInfo.Additional.IsCountHitsByDay.ToString());

                EBooleanUtils.AddListItems(RblIsCountDownload, "统计", "不统计");
                ControlUtils.SelectListItemsIgnoreCase(RblIsCountDownload, PublishmentSystemInfo.Additional.IsCountDownload.ToString());

                EBooleanUtils.AddListItems(RblIsCreateDoubleClick, "启用双击生成", "不启用");
                ControlUtils.SelectListItemsIgnoreCase(RblIsCreateDoubleClick, PublishmentSystemInfo.Additional.IsCreateDoubleClick.ToString());

                RblIsCountHits_SelectedIndexChanged(null, EventArgs.Empty);
            }
        }
Esempio n. 3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("FileName"))
            {
                fileName = Body.GetQueryString("FileName");
                fileName = PathUtils.RemoveParentPath(fileName);
            }
            directoryPath = PathUtility.MapPath(PublishmentSystemInfo, "@/js");

            if (!IsPostBack)
            {
                var pageTitle = string.IsNullOrEmpty(fileName) ? "添加脚本文件" : "编辑脚本文件";
                BreadCrumb(AppManager.Cms.LeftMenu.IdTemplate, pageTitle, AppManager.Cms.Permission.WebSite.Template);

                ltlPageTitle.Text = pageTitle;

                ECharsetUtils.AddListItems(Charset);

                if (fileName != null)
                {
                    if (!EFileSystemTypeUtils.IsJs(PathUtils.GetExtension(fileName)))
                    {
                        PageUtils.RedirectToErrorPage("对不起,此文件无法编辑!");
                    }
                    else
                    {
                        RelatedFileName.Text       = PathUtils.RemoveExtension(fileName);
                        ltlCreatedFileExtName.Text = PathUtils.GetExtension(fileName);
                        var fileCharset = FileUtils.GetFileCharset(PathUtils.Combine(directoryPath, fileName));
                        ControlUtils.SelectListItemsIgnoreCase(Charset, ECharsetUtils.GetValue(fileCharset));
                        Content.Text = FileUtils.ReadText(PathUtils.Combine(directoryPath, fileName), fileCharset);
                    }
                }
                else
                {
                    ltlCreatedFileExtName.Text = ".js";
                    ControlUtils.SelectListItemsIgnoreCase(Charset, PublishmentSystemInfo.Additional.Charset);
                }
            }
        }
Esempio n. 4
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Configration);

            ECharsetUtils.AddListItems(DdlCharset);
            ControlUtils.SelectSingleItem(DdlCharset, SiteInfo.Additional.Charset);

            TbPageSize.Text = SiteInfo.Additional.PageSize.ToString();

            EBooleanUtils.AddListItems(DdlIsCreateDoubleClick, "启用双击生成", "不启用");
            ControlUtils.SelectSingleItemIgnoreCase(DdlIsCreateDoubleClick, SiteInfo.Additional.IsCreateDoubleClick.ToString());
        }
Esempio n. 5
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId", "type");
            _type = AuthRequest.GetQueryString("type");
            if (_type == PageTemplateAssets.TypeInclude)
            {
                _name      = PageTemplateAssets.NameInclude;
                _ext       = PageTemplateAssets.ExtInclude;
                _assetsDir = SiteInfo.Additional.TemplatesAssetsIncludeDir.Trim('/');
                PhCodeMirrorInclude.Visible = true;
            }
            else if (_type == PageTemplateAssets.TypeJs)
            {
                _name                  = PageTemplateAssets.NameJs;
                _ext                   = PageTemplateAssets.ExtJs;
                _assetsDir             = SiteInfo.Additional.TemplatesAssetsJsDir.Trim('/');
                PhCodeMirrorJs.Visible = true;
            }
            else if (_type == PageTemplateAssets.TypeCss)
            {
                _name      = PageTemplateAssets.NameCss;
                _ext       = PageTemplateAssets.ExtCss;
                _assetsDir = SiteInfo.Additional.TemplatesAssetsCssDir.Trim('/');
                PhCodeMirrorCss.Visible = true;
            }

            if (string.IsNullOrEmpty(_assetsDir))
            {
                return;
            }

            _directoryPath = PathUtility.MapPath(SiteInfo, "@/" + _assetsDir);

            if (AuthRequest.IsQueryExists("fileName"))
            {
                _fileName = AuthRequest.GetQueryString("fileName");
                _fileName = PathUtils.RemoveParentPath(_fileName);
            }

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.SitePermissions.TemplatesIncludes);

            LtlPageTitle.Text = string.IsNullOrEmpty(_fileName) ? $"添加{_name}" : $"编辑{_name}";

            var isCodeMirror = SiteInfo.Additional.ConfigTemplateIsCodeMirror;

            BtnEditorType.Text   = isCodeMirror ? "采用纯文本编辑模式" : "采用代码编辑模式";
            PhCodeMirror.Visible = isCodeMirror;

            ECharsetUtils.AddListItems(DdlCharset);

            if (_fileName != null)
            {
                if (!StringUtils.EqualsIgnoreCase(PathUtils.GetExtension(_fileName), _ext))
                {
                    PageUtils.RedirectToErrorPage("对不起,此文件格式无法编辑!");
                }
                else
                {
                    TbRelatedFileName.Text = _fileName;
                    var fileCharset = FileUtils.GetFileCharset(PathUtils.Combine(_directoryPath, _fileName));
                    ControlUtils.SelectSingleItemIgnoreCase(DdlCharset, ECharsetUtils.GetValue(fileCharset));
                    TbContent.Text = FileUtils.ReadText(PathUtils.Combine(_directoryPath, _fileName), fileCharset);
                }
            }
            else
            {
                ControlUtils.SelectSingleItemIgnoreCase(DdlCharset, SiteInfo.Additional.Charset);
            }
        }
Esempio n. 6
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _publishmentSystemType = EPublishmentSystemTypeUtils.GetEnumType(Body.GetQueryString("publishmentSystemType"));
            _sortedlist            = SiteTemplateManager.Instance.GetSiteTemplateSortedList();
            _permissions           = PermissionsManager.GetPermissions(Body.AdministratorName);

            if (!IsPostBack)
            {
                BaiRongDataProvider.TableCollectionDao.CreateAllAuxiliaryTableIfNotExists();

                SiteTemplateDir.Value = Body.GetQueryString("siteTemplate");

                string pageTitle = $"创建{EPublishmentSystemTypeUtils.GetText(_publishmentSystemType)}";
                ltlPageTitle.Text = pageTitle;
                BreadCrumbSys(AppManager.Sys.LeftMenu.Site, pageTitle, AppManager.Sys.Permission.SysSite);

                var hqSiteId = DataProvider.PublishmentSystemDao.GetPublishmentSystemIdByIsHeadquarters();
                if (hqSiteId == 0)
                {
                    IsHeadquarters.SelectedValue = "True";
                    phNotIsHeadquarters.Visible  = false;
                }
                else
                {
                    IsHeadquarters.Enabled = false;
                }

                ltlPublishmentSystemType.Text = EPublishmentSystemTypeUtils.GetHtml(_publishmentSystemType);

                phWCMTables.Visible = _publishmentSystemType == EPublishmentSystemType.WCM;

                ParentPublishmentSystemID.Items.Add(new ListItem("<无上级站点>", "0"));
                var publishmentSystemIdArrayList = PublishmentSystemManager.GetPublishmentSystemIdList();
                var mySystemInfoArrayList        = new ArrayList();
                var parentWithChildren           = new Hashtable();
                foreach (int publishmentSystemId in publishmentSystemIdArrayList)
                {
                    var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
                    if (publishmentSystemInfo.IsHeadquarters == false)
                    {
                        if (publishmentSystemInfo.ParentPublishmentSystemId == 0)
                        {
                            mySystemInfoArrayList.Add(publishmentSystemInfo);
                        }
                        else
                        {
                            var children = new ArrayList();
                            if (parentWithChildren.Contains(publishmentSystemInfo.ParentPublishmentSystemId))
                            {
                                children = (ArrayList)parentWithChildren[publishmentSystemInfo.ParentPublishmentSystemId];
                            }
                            children.Add(publishmentSystemInfo);
                            parentWithChildren[publishmentSystemInfo.ParentPublishmentSystemId] = children;
                        }
                    }
                }
                foreach (PublishmentSystemInfo publishmentSystemInfo in mySystemInfoArrayList)
                {
                    AddSite(ParentPublishmentSystemID, publishmentSystemInfo, parentWithChildren, 0);
                }
                ControlUtils.SelectListItems(ParentPublishmentSystemID, "0");

                phNodeRelated.Visible = EPublishmentSystemTypeUtils.IsNodeRelated(_publishmentSystemType);

                ECharsetUtils.AddListItems(Charset);
                ControlUtils.SelectListItems(Charset, ECharsetUtils.GetValue(ECharset.utf_8));

                var tableList = BaiRongDataProvider.TableCollectionDao.GetAuxiliaryTableListCreatedInDbByAuxiliaryTableType(EAuxiliaryTableType.BackgroundContent);
                foreach (var tableInfo in tableList)
                {
                    var li = new ListItem($"{tableInfo.TableCnName}({tableInfo.TableEnName})", tableInfo.TableEnName);
                    AuxiliaryTableForContent.Items.Add(li);
                }

                tableList = BaiRongDataProvider.TableCollectionDao.GetAuxiliaryTableListCreatedInDbByAuxiliaryTableType(EAuxiliaryTableType.GovPublicContent);
                foreach (var tableInfo in tableList)
                {
                    var li = new ListItem($"{tableInfo.TableCnName}({tableInfo.TableEnName})", tableInfo.TableEnName);
                    AuxiliaryTableForGovPublic.Items.Add(li);
                }

                tableList = BaiRongDataProvider.TableCollectionDao.GetAuxiliaryTableListCreatedInDbByAuxiliaryTableType(EAuxiliaryTableType.GovInteractContent);
                foreach (var tableInfo in tableList)
                {
                    var li = new ListItem($"{tableInfo.TableCnName}({tableInfo.TableEnName})", tableInfo.TableEnName);
                    AuxiliaryTableForGovInteract.Items.Add(li);
                }

                tableList = BaiRongDataProvider.TableCollectionDao.GetAuxiliaryTableListCreatedInDbByAuxiliaryTableType(EAuxiliaryTableType.VoteContent);
                foreach (var tableInfo in tableList)
                {
                    var li = new ListItem($"{tableInfo.TableCnName}({tableInfo.TableEnName})", tableInfo.TableEnName);
                    AuxiliaryTableForVote.Items.Add(li);
                }

                tableList = BaiRongDataProvider.TableCollectionDao.GetAuxiliaryTableListCreatedInDbByAuxiliaryTableType(EAuxiliaryTableType.JobContent);
                foreach (var tableInfo in tableList)
                {
                    var li = new ListItem($"{tableInfo.TableCnName}({tableInfo.TableEnName})", tableInfo.TableEnName);
                    AuxiliaryTableForJob.Items.Add(li);
                }

                IsCheckContentUseLevel.Items.Add(new ListItem("默认审核机制", false.ToString()));
                IsCheckContentUseLevel.Items.Add(new ListItem("多级审核机制", true.ToString()));
                ControlUtils.SelectListItems(IsCheckContentUseLevel, false.ToString());

                UseSiteTemplate.Attributes.Add("onclick", "displaySiteTemplateDiv(this)");

                BindGrid();

                if (_sortedlist.Count > 0)
                {
                    SetActivePlaceHolder(WizardPlaceHolder.ChooseSiteTemplate, ChooseSiteTemplate);
                }
                else
                {
                    ChooseSiteTemplate.Visible = false;
                    UseSiteTemplate.Checked    = false;
                    SetActivePlaceHolder(WizardPlaceHolder.CreateSiteParameters, CreateSiteParameters);
                    RowSiteTemplateName.Visible = RowIsImportContents.Visible = RowIsImportTableStyles.Visible = RowIsUserSiteTemplateAuxiliaryTables.Visible = false;
                    phAuxiliaryTable.Visible    = true;
                }
            }
        }
Esempio n. 7
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            TemplateInfo templateInfo = null;

            if (AuthRequest.GetQueryInt("TemplateID") > 0)
            {
                var templateId = AuthRequest.GetQueryInt("TemplateID");
                _isCopy      = AuthRequest.GetQueryBool("IsCopy");
                templateInfo = TemplateManager.GetTemplateInfo(SiteId, templateId);
                if (templateInfo != null)
                {
                    _templateType = templateInfo.TemplateType;
                }
            }
            else
            {
                _templateType = TemplateTypeUtils.GetEnumType(Request.QueryString["TemplateType"]);
            }

            if (_templateType == TemplateType.IndexPageTemplate || _templateType == TemplateType.FileTemplate)
            {
                PhCreatedFileFullName.Visible = true;
            }
            else
            {
                PhCreatedFileFullName.Visible = false;
            }

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.SitePermissions.Templates);

            LtlTemplateType.Text = TemplateTypeUtils.GetText(_templateType);

            LtlPageTitle.Text = AuthRequest.GetQueryInt("TemplateID") > 0 ? "编辑模板" : "添加模板";

            var isCodeMirror = SiteInfo.Additional.ConfigTemplateIsCodeMirror;

            BtnEditorType.Text   = isCodeMirror ? "采用纯文本编辑模式" : "采用代码编辑模式";
            PhCodeMirror.Visible = isCodeMirror;

            EFileSystemTypeUtils.AddWebPageListItems(DdlCreatedFileExtName);

            ECharsetUtils.AddListItems(DdlCharset);

            if (AuthRequest.GetQueryInt("TemplateID") > 0)
            {
                if (templateInfo == null)
                {
                    return;
                }

                TbContent.Text = TemplateManager.GetTemplateContent(SiteInfo, templateInfo);

                if (_isCopy)
                {
                    TbTemplateName.Text        = templateInfo.TemplateName + "_复件";
                    TbRelatedFileName.Text     = PathUtils.RemoveExtension(templateInfo.RelatedFileName) + "_复件";
                    TbCreatedFileFullName.Text = PathUtils.RemoveExtension(templateInfo.CreatedFileFullName) + "_复件";
                }
                else
                {
                    TbTemplateName.Text        = templateInfo.TemplateName;
                    TbRelatedFileName.Text     = PathUtils.RemoveExtension(templateInfo.RelatedFileName);
                    TbCreatedFileFullName.Text = PathUtils.RemoveExtension(templateInfo.CreatedFileFullName);

                    LtlCommands.Text += $@"
<button class=""btn"" onclick=""{ModalProgressBar.GetOpenWindowStringWithCreateByTemplate(SiteId, templateInfo.Id)}"">生成页面</button>
<button class=""btn"" onclick=""{ModalTemplateRestore.GetOpenWindowString(SiteId, templateInfo.Id, string.Empty)}"">还原历史版本</button>";

                    if (AuthRequest.GetQueryInt("TemplateLogID") > 0)
                    {
                        var templateLogId = AuthRequest.GetQueryInt("TemplateLogID");
                        if (templateLogId > 0)
                        {
                            TbContent.Text = DataProvider.TemplateLogDao.GetTemplateContent(templateLogId);
                            SuccessMessage("已导入历史版本的模板内容,点击确定保存模板");
                        }
                    }
                }

                ControlUtils.SelectSingleItemIgnoreCase(DdlCharset, ECharsetUtils.GetValue(templateInfo.Charset));

                ControlUtils.SelectSingleItem(DdlCreatedFileExtName, GetTemplateFileExtension(templateInfo));
                HihTemplateType.Value = templateInfo.TemplateType.Value;
            }
            else
            {
                TbRelatedFileName.Text     = "T_";
                TbCreatedFileFullName.Text = _templateType == TemplateType.ChannelTemplate ? "index" : "@/";
                ControlUtils.SelectSingleItemIgnoreCase(DdlCharset, SiteInfo.Additional.Charset);
                ControlUtils.SelectSingleItem(DdlCreatedFileExtName, EFileSystemTypeUtils.GetValue(EFileSystemType.Html));
                HihTemplateType.Value = AuthRequest.GetQueryString("TemplateType");
            }
        }
Esempio n. 8
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (IsPostBack)
            {
                return;
            }

            VerifySystemPermissions(ConfigManager.SettingsPermissions.SiteAdd);

            DataProvider.TableDao.CreateAllTableCollectionInfoIfNotExists();

            var hqSiteId = DataProvider.SiteDao.GetIdByIsRoot();

            if (hqSiteId == 0)
            {
                ControlUtils.SelectSingleItem(RblIsRoot, true.ToString());
                PhIsNotRoot.Visible = false;
            }
            else
            {
                RblIsRoot.Enabled = false;
            }

            DdlParentId.Items.Add(new ListItem("<无上级站点>", "0"));
            var siteIdArrayList       = SiteManager.GetSiteIdList();
            var mySystemInfoArrayList = new ArrayList();
            var parentWithChildren    = new Hashtable();

            foreach (var siteId in siteIdArrayList)
            {
                var siteInfo = SiteManager.GetSiteInfo(siteId);
                if (siteInfo.IsRoot == false)
                {
                    if (siteInfo.ParentId == 0)
                    {
                        mySystemInfoArrayList.Add(siteInfo);
                    }
                    else
                    {
                        var children = new ArrayList();
                        if (parentWithChildren.Contains(siteInfo.ParentId))
                        {
                            children = (ArrayList)parentWithChildren[siteInfo.ParentId];
                        }
                        children.Add(siteInfo);
                        parentWithChildren[siteInfo.ParentId] = children;
                    }
                }
            }
            foreach (SiteInfo siteInfo in mySystemInfoArrayList)
            {
                AddSite(DdlParentId, siteInfo, parentWithChildren, 0);
            }
            ControlUtils.SelectSingleItem(DdlParentId, "0");

            ECharsetUtils.AddListItems(DdlCharset);
            ControlUtils.SelectSingleItem(DdlCharset, ECharsetUtils.GetValue(ECharset.utf_8));

            var tableList = DataProvider.TableDao.GetTableCollectionInfoListCreatedInDb();

            foreach (var tableInfo in tableList)
            {
                if (tableInfo.DisplayName.StartsWith("插件内容表:"))
                {
                    continue;
                }

                var li = new ListItem($"{tableInfo.DisplayName}({tableInfo.TableName})", tableInfo.TableName);
                DdlTableName.Items.Add(li);
            }

            RblIsCheckContentUseLevel.Items.Add(new ListItem("默认审核机制", false.ToString()));
            RblIsCheckContentUseLevel.Items.Add(new ListItem("多级审核机制", true.ToString()));
            ControlUtils.SelectSingleItem(RblIsCheckContentUseLevel, false.ToString());

            if (SiteTemplateManager.Instance.IsSiteTemplateExists)
            {
                RblSource.Items.Add(new ListItem("创建空站点(不使用站点模板)", ETriStateUtils.GetValue(ETriState.True)));
                RblSource.Items.Add(new ListItem("使用本地站点模板创建站点", ETriStateUtils.GetValue(ETriState.False)));
                RblSource.Items.Add(new ListItem("使用在线站点模板创建站点", ETriStateUtils.GetValue(ETriState.All)));
            }
            else
            {
                RblSource.Items.Add(new ListItem("创建空站点(不使用站点模板)", ETriStateUtils.GetValue(ETriState.True)));
                RblSource.Items.Add(new ListItem("使用在线站点模板创建站点", ETriStateUtils.GetValue(ETriState.All)));
            }
            ControlUtils.SelectSingleItem(RblSource, ETriStateUtils.GetValue(ETriState.True));

            var siteTemplateDir    = AuthRequest.GetQueryString("siteTemplateDir");
            var onlineTemplateName = AuthRequest.GetQueryString("onlineTemplateName");

            if (!string.IsNullOrEmpty(siteTemplateDir))
            {
                HihSiteTemplateDir.Value = siteTemplateDir;
                ControlUtils.SelectSingleItem(RblSource, ETriStateUtils.GetValue(ETriState.False));
                BtnNext_Click(null, EventArgs.Empty);
            }
            else if (!string.IsNullOrEmpty(onlineTemplateName))
            {
                HihOnlineTemplateName.Value = onlineTemplateName;
                ControlUtils.SelectSingleItem(RblSource, ETriStateUtils.GetValue(ETriState.All));
                BtnNext_Click(null, EventArgs.Empty);
            }
        }
Esempio n. 9
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("GatherRuleName"))
            {
                _isEdit            = true;
                _theGatherRuleName = Body.GetQueryString("GatherRuleName");
            }

            if (!Page.IsPostBack)
            {
                var pageTitle = _isEdit ? "编辑Web页面信息采集规则" : "添加Web页面信息采集规则";
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdGather, pageTitle, AppManager.Cms.Permission.WebSite.Gather);

                ltlPageTitle.Text = pageTitle;

                ECharsetUtils.AddListItems(Charset);
                ControlUtils.SelectListItemsIgnoreCase(Charset, ECharsetUtils.GetValue(ECharset.utf_8));
                NodeManager.AddListItemsForAddContent(NodeIDDropDownList.Items, PublishmentSystemInfo, true, Body.AdministratorName);

                SetActivePanel(WizardPanel.GatherRuleBase, GatherRuleBase);

                if (_isEdit)
                {
                    var gatherRuleInfo = DataProvider.GatherRuleDao.GetGatherRuleInfo(_theGatherRuleName, PublishmentSystemId);
                    GatherRuleName.Text = gatherRuleInfo.GatherRuleName;

                    ControlUtils.SelectListItemsIgnoreCase(Charset, ECharsetUtils.GetValue(gatherRuleInfo.Charset));
                    GatherNum.Text = gatherRuleInfo.Additional.GatherNum.ToString();
                    foreach (ListItem item in IsSaveImage.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsSaveImage.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    foreach (ListItem item in IsSetFirstImageAsImageUrl.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsSetFirstImageAsImageUrl.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    foreach (ListItem item in IsEmptyContentAllowed.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsEmptyContentAllowed.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    foreach (ListItem item in IsSameTitleAllowed.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsSameTitleAllowed.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    foreach (ListItem item in IsChecked.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsChecked.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    foreach (ListItem item in IsAutoCreate.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsAutoCreate.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    foreach (ListItem item in IsOrderByDesc.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.Additional.IsOrderByDesc.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }

                    GatherUrlIsCollection.Checked = gatherRuleInfo.GatherUrlIsCollection;
                    GatherUrlCollection.Text      = gatherRuleInfo.GatherUrlCollection;
                    GatherUrlIsSerialize.Checked  = gatherRuleInfo.GatherUrlIsSerialize;
                    GatherUrlSerialize.Text       = gatherRuleInfo.GatherUrlSerialize;
                    SerializeFrom.Text            = gatherRuleInfo.SerializeFrom.ToString();
                    SerializeTo.Text               = gatherRuleInfo.SerializeTo.ToString();
                    SerializeInterval.Text         = gatherRuleInfo.SerializeInterval.ToString();
                    SerializeIsOrderByDesc.Checked = gatherRuleInfo.SerializeIsOrderByDesc;
                    SerializeIsAddZero.Checked     = gatherRuleInfo.SerializeIsAddZero;

                    foreach (ListItem item in NodeIDDropDownList.Items)
                    {
                        if (item.Value.Equals(gatherRuleInfo.NodeId.ToString()))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    UrlInclude.Text     = gatherRuleInfo.UrlInclude;
                    TitleInclude.Text   = gatherRuleInfo.TitleInclude;
                    ContentExclude.Text = gatherRuleInfo.ContentExclude;
                    var htmlClearArrayList = TranslateUtils.StringCollectionToStringList(gatherRuleInfo.ContentHtmlClearCollection);
                    foreach (ListItem item in ContentHtmlClearCollection.Items)
                    {
                        item.Selected = htmlClearArrayList.Contains(item.Value);
                    }
                    var htmlClearTagArrayList = TranslateUtils.StringCollectionToStringList(gatherRuleInfo.ContentHtmlClearTagCollection);
                    foreach (ListItem item in ContentHtmlClearTagCollection.Items)
                    {
                        item.Selected = htmlClearTagArrayList.Contains(item.Value);
                    }
                    ListAreaStart.Text        = gatherRuleInfo.ListAreaStart;
                    ListAreaEnd.Text          = gatherRuleInfo.ListAreaEnd;
                    CookieString.Text         = gatherRuleInfo.CookieString;
                    ContentTitleStart.Text    = gatherRuleInfo.ContentTitleStart;
                    ContentTitleEnd.Text      = gatherRuleInfo.ContentTitleEnd;
                    ContentContentStart.Text  = gatherRuleInfo.ContentContentStart;
                    ContentContentEnd.Text    = gatherRuleInfo.ContentContentEnd;
                    ContentContentStart2.Text = gatherRuleInfo.Additional.ContentContentStart2;
                    ContentContentEnd2.Text   = gatherRuleInfo.Additional.ContentContentEnd2;
                    ContentContentStart3.Text = gatherRuleInfo.Additional.ContentContentStart3;
                    ContentContentEnd3.Text   = gatherRuleInfo.Additional.ContentContentEnd3;
                    ContentReplaceFrom.Text   = gatherRuleInfo.Additional.ContentReplaceFrom;
                    ContentReplaceTo.Text     = gatherRuleInfo.Additional.ContentReplaceTo;
                    ContentChannelStart.Text  = gatherRuleInfo.ContentChannelStart;
                    ContentChannelEnd.Text    = gatherRuleInfo.ContentChannelEnd;
                    ContentNextPageStart.Text = gatherRuleInfo.ContentNextPageStart;
                    ContentNextPageEnd.Text   = gatherRuleInfo.ContentNextPageEnd;

                    var contentAttributeArrayList = TranslateUtils.StringCollectionToStringList(gatherRuleInfo.ContentAttributes);
                    var relatedIdentities         = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, PublishmentSystemId);
                    var styleInfoList             = TableStyleManager.GetTableStyleInfoList(ETableStyle.BackgroundContent, PublishmentSystemInfo.AuxiliaryTableForContent, relatedIdentities);
                    foreach (var styleInfo in styleInfoList)
                    {
                        if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.Title) || StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.Content))
                        {
                            continue;
                        }

                        var listitem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName.ToLower());
                        if (contentAttributeArrayList.Contains(listitem.Value))
                        {
                            listitem.Selected = true;
                        }
                        ContentAttributes.Items.Add(listitem);
                    }

                    var listItem = new ListItem("点击量", ContentAttribute.Hits.ToLower());
                    if (contentAttributeArrayList.Contains(listItem.Value))
                    {
                        listItem.Selected = true;
                    }
                    ContentAttributes.Items.Add(listItem);

                    _contentAttributesXml = TranslateUtils.ToNameValueCollection(gatherRuleInfo.ContentAttributesXml);

                    ContentAttributes_SelectedIndexChanged(null, EventArgs.Empty);
                }
                else
                {
                    var relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, PublishmentSystemId);
                    var styleInfoList     = TableStyleManager.GetTableStyleInfoList(ETableStyle.BackgroundContent, PublishmentSystemInfo.AuxiliaryTableForContent, relatedIdentities);
                    foreach (var styleInfo in styleInfoList)
                    {
                        if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.Title) || StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.Content))
                        {
                            continue;
                        }

                        var listitem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName.ToLower());
                        ContentAttributes.Items.Add(listitem);
                    }

                    var listItem = new ListItem("点击量", ContentAttribute.Hits.ToLower());
                    ContentAttributes.Items.Add(listItem);
                }

                GatherUrl_CheckedChanged(null, null);
            }

            SuccessMessage(string.Empty);
        }
Esempio n. 10
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("GatherRuleName"))
            {
                _isEdit            = true;
                _theGatherRuleName = Body.GetQueryString("GatherRuleName");
            }

            if (!Page.IsPostBack)
            {
                var pageTitle = _isEdit ? "编辑单文件页采集规则" : "添加单文件页采集规则";
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdGather, pageTitle, AppManager.Cms.Permission.WebSite.Gather);

                ltlPageTitle.Text = pageTitle;

                ECharsetUtils.AddListItems(Charset);
                ControlUtils.SelectListItemsIgnoreCase(Charset, ECharsetUtils.GetValue(ECharset.utf_8));
                NodeManager.AddListItemsForAddContent(NodeIDDropDownList.Items, PublishmentSystemInfo, true, Body.AdministratorName);

                SetActivePanel(WizardPanel.GatherRuleBase, GatherRuleBase);

                if (_isEdit)
                {
                    var gatherFileRuleInfo = DataProvider.GatherFileRuleDao.GetGatherFileRuleInfo(_theGatherRuleName, PublishmentSystemId);
                    GatherRuleName.Text = gatherFileRuleInfo.GatherRuleName;
                    GatherUrl.Text      = gatherFileRuleInfo.GatherUrl;
                    ControlUtils.SelectListItemsIgnoreCase(Charset, ECharsetUtils.GetValue(gatherFileRuleInfo.Charset));

                    ControlUtils.SelectListItems(IsToFile, gatherFileRuleInfo.IsToFile.ToString());
                    FilePath.Text = gatherFileRuleInfo.FilePath;
                    ControlUtils.SelectListItems(IsSaveRelatedFiles, gatherFileRuleInfo.IsSaveRelatedFiles.ToString());
                    ControlUtils.SelectListItems(IsRemoveScripts, gatherFileRuleInfo.IsRemoveScripts.ToString());
                    StyleDirectoryPath.Text  = gatherFileRuleInfo.StyleDirectoryPath;
                    ScriptDirectoryPath.Text = gatherFileRuleInfo.ScriptDirectoryPath;
                    ImageDirectoryPath.Text  = gatherFileRuleInfo.ImageDirectoryPath;

                    ControlUtils.SelectListItems(NodeIDDropDownList, gatherFileRuleInfo.NodeId.ToString());
                    ControlUtils.SelectListItems(IsSaveImage, gatherFileRuleInfo.IsSaveImage.ToString());
                    ControlUtils.SelectListItems(IsChecked, gatherFileRuleInfo.IsChecked.ToString());
                    ControlUtils.SelectListItems(IsAutoCreate, gatherFileRuleInfo.IsAutoCreate.ToString());

                    ContentExclude.Text = gatherFileRuleInfo.ContentExclude;
                    var htmlClearArrayList = TranslateUtils.StringCollectionToStringList(gatherFileRuleInfo.ContentHtmlClearCollection);
                    foreach (ListItem item in ContentHtmlClearCollection.Items)
                    {
                        if (htmlClearArrayList.Contains(item.Value))
                        {
                            item.Selected = true;
                        }
                    }
                    var htmlClearTagArrayList = TranslateUtils.StringCollectionToStringList(gatherFileRuleInfo.ContentHtmlClearTagCollection);
                    foreach (ListItem item in ContentHtmlClearTagCollection.Items)
                    {
                        if (htmlClearTagArrayList.Contains(item.Value))
                        {
                            item.Selected = true;
                        }
                    }
                    ContentTitleStart.Text   = gatherFileRuleInfo.ContentTitleStart;
                    ContentTitleEnd.Text     = gatherFileRuleInfo.ContentTitleEnd;
                    ContentContentStart.Text = gatherFileRuleInfo.ContentContentStart;
                    ContentContentEnd.Text   = gatherFileRuleInfo.ContentContentEnd;

                    var contentAttributeArrayList = TranslateUtils.StringCollectionToStringList(gatherFileRuleInfo.ContentAttributes);
                    var styleInfoList             = TableStyleManager.GetTableStyleInfoList(ETableStyle.BackgroundContent, PublishmentSystemInfo.AuxiliaryTableForContent, null);
                    foreach (var styleInfo in styleInfoList)
                    {
                        if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.Title) || StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.Content))
                        {
                            continue;
                        }

                        var listitem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName.ToLower());
                        if (contentAttributeArrayList.Contains(listitem.Value))
                        {
                            listitem.Selected = true;
                        }
                        ContentAttributes.Items.Add(listitem);
                    }

                    _contentAttributesXml = TranslateUtils.ToNameValueCollection(gatherFileRuleInfo.ContentAttributesXml);

                    ContentAttributes_SelectedIndexChanged(null, EventArgs.Empty);
                }

                DropDownList_SelectedIndexChanged(null, EventArgs.Empty);
            }

            SuccessMessage(string.Empty);
        }
Esempio n. 11
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId", "RelatedPath", "FileName", "IsCreate");
            _relatedPath = AuthRequest.GetQueryString("RelatedPath").Trim('/');
            if (!_relatedPath.StartsWith("@"))
            {
                _relatedPath = "@/" + _relatedPath;
            }
            _theFileName = AuthRequest.GetQueryString("FileName");
            _isCreate    = AuthRequest.GetQueryBool("IsCreate");
            _fileCharset = ECharset.utf_8;
            if (SiteInfo != null)
            {
                _fileCharset = ECharsetUtils.GetEnumType(SiteInfo.Additional.Charset);
            }

            if (_isCreate == false)
            {
                var filePath = SiteInfo != null
                    ? PathUtility.MapPath(SiteInfo, PathUtils.Combine(_relatedPath, _theFileName))
                    : PathUtils.MapPath(PathUtils.Combine(_relatedPath, _theFileName));

                if (!FileUtils.IsFileExists(filePath))
                {
                    PageUtils.RedirectToErrorPage("此文件不存在!");
                    return;
                }
            }

            if (IsPostBack)
            {
                return;
            }

            DdlCharset.Items.Add(new ListItem("默认", string.Empty));
            ECharsetUtils.AddListItems(DdlCharset);

            if (_isCreate == false)
            {
                var filePath = SiteInfo != null?PathUtility.MapPath(SiteInfo, PathUtils.Combine(_relatedPath, _theFileName)) : PathUtils.MapPath(PathUtils.Combine(_relatedPath, _theFileName));

                TbFileName.Text    = _theFileName;
                TbFileName.Enabled = false;
                TbFileContent.Text = FileUtils.ReadText(filePath, _fileCharset);
            }

            if (_isCreate)
            {
                return;
            }

            if (SiteInfo != null)
            {
                LtlOpen.Text =
                    $@"<a class=""btn btn-default m-l-10"" href=""{PageUtility.ParseNavigationUrl(SiteInfo,
                        PageUtils.Combine(_relatedPath, _theFileName), true)}"" target=""_blank"">浏 览</a>";
            }
            else
            {
                LtlOpen.Text =
                    $@"<a class=""btn btn-default m-l-10"" href=""{PageUtils.ParseConfigRootUrl(PageUtils.Combine(_relatedPath, _theFileName))}"" target=""_blank"">浏 览</a>";
            }
            LtlView.Text = $@"<a class=""btn btn-default m-l-10"" href=""{ModalFileView.GetRedirectUrl(SiteId, _relatedPath, _theFileName)}"">查 看</a>";
        }
Esempio n. 12
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID", "RelatedPath", "FileName", "IsCreate");
            _relatedPath = Body.GetQueryString("RelatedPath").Trim('/');
            if (!_relatedPath.StartsWith("@"))
            {
                _relatedPath = "@/" + _relatedPath;
            }
            _theFileName = Body.GetQueryString("FileName");
            _isCreate    = Body.GetQueryBool("IsCreate");
            _fileCharset = ECharset.utf_8;
            if (PublishmentSystemInfo != null)
            {
                _fileCharset = ECharsetUtils.GetEnumType(PublishmentSystemInfo.Additional.Charset);
            }

            if (_isCreate == false)
            {
                string filePath;
                if (PublishmentSystemInfo != null)
                {
                    filePath = PathUtility.MapPath(PublishmentSystemInfo, PathUtils.Combine(_relatedPath, _theFileName));
                }
                else
                {
                    filePath = PathUtils.MapPath(PathUtils.Combine(_relatedPath, _theFileName));
                }
                if (!FileUtils.IsFileExists(filePath))
                {
                    PageUtils.RedirectToErrorPage("此文件不存在!");
                    return;
                }
            }

            if (!IsPostBack)
            {
                Charset.Items.Add(new ListItem("默认", string.Empty));
                ECharsetUtils.AddListItems(Charset);

                if (_isCreate == false)
                {
                    var filePath = string.Empty;
                    if (PublishmentSystemInfo != null)
                    {
                        filePath = PathUtility.MapPath(PublishmentSystemInfo, PathUtils.Combine(_relatedPath, _theFileName));
                    }
                    else
                    {
                        filePath = PathUtils.MapPath(PathUtils.Combine(_relatedPath, _theFileName));
                    }
                    FileName.Text           = _theFileName;
                    FileName.Enabled        = false;
                    FileContentTextBox.Text = FileUtils.ReadText(filePath, _fileCharset);
                }

                if (!_isCreate)
                {
                    if (PublishmentSystemInfo != null)
                    {
                        ltlOpen.Text =
                            $@"<a href=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo,
                                PageUtils.Combine(_relatedPath, _theFileName))}"" target=""_blank"">浏 览</a>&nbsp;&nbsp;";
                    }
                    else
                    {
                        ltlOpen.Text =
                            $@"<a href=""{PageUtils.ParseConfigRootUrl(PageUtils.Combine(_relatedPath, _theFileName))}"" target=""_blank"">浏 览</a>&nbsp;&nbsp;";
                    }
                    ltlView.Text = $@"<a href=""{ModalFileView.GetRedirectUrl(PublishmentSystemId, _relatedPath, _theFileName)}"">属 性</a>";
                }
            }
        }
Esempio n. 13
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            TemplateInfo templateInfo = null;

            if (Body.GetQueryInt("TemplateID") > 0)
            {
                var templateId = Body.GetQueryInt("TemplateID");
                _isCopy      = Body.GetQueryBool("IsCopy");
                templateInfo = TemplateManager.GetTemplateInfo(PublishmentSystemId, templateId);
                if (templateInfo != null)
                {
                    _theTemplateType = templateInfo.TemplateType;
                }
            }
            else
            {
                _theTemplateType = ETemplateTypeUtils.GetEnumType(Request.QueryString["TemplateType"]);
            }
            TemplateTypeString = ETemplateTypeUtils.GetText(_theTemplateType);

            if (_theTemplateType == ETemplateType.IndexPageTemplate || _theTemplateType == ETemplateType.FileTemplate)
            {
                CreatedFileFullNameRow.Visible = true;
            }
            else
            {
                CreatedFileFullNameRow.Visible = false;
            }

            if (!IsPostBack)
            {
                var pageTitle = Body.GetQueryInt("TemplateID") > 0 ? "编辑模板" : "添加模板";
                BreadCrumb(AppManager.Cms.LeftMenu.IdTemplate, pageTitle, AppManager.Cms.Permission.WebSite.Template);

                ltlPageTitle.Text = pageTitle;

                var isCodeMirror = PublishmentSystemInfo.Additional.ConfigTemplateIsCodeMirror;
                btnEditorType.Text   = isCodeMirror ? "采用纯文本编辑模式" : "采用代码编辑模式";
                phCodeMirror.Visible = isCodeMirror;

                EFileSystemTypeUtils.AddWebPageListItems(CreatedFileExtNameDropDownList);

                ECharsetUtils.AddListItems(Charset);

                if (Body.GetQueryInt("TemplateID") > 0)
                {
                    if (templateInfo != null)
                    {
                        Content.Text = StlCacheManager.FileContent.GetTemplateContent(PublishmentSystemInfo, templateInfo);

                        if (_isCopy)
                        {
                            TemplateName.Text        = templateInfo.TemplateName + "_复件";
                            RelatedFileName.Text     = PathUtils.RemoveExtension(templateInfo.RelatedFileName) + "_复件";
                            CreatedFileFullName.Text = PathUtils.RemoveExtension(templateInfo.CreatedFileFullName) + "_复件";
                        }
                        else
                        {
                            TemplateName.Text        = templateInfo.TemplateName;
                            RelatedFileName.Text     = PathUtils.RemoveExtension(templateInfo.RelatedFileName);
                            CreatedFileFullName.Text = PathUtils.RemoveExtension(templateInfo.CreatedFileFullName);

                            LtlCommands.Text +=
                                $@"<a href=""javascript:;"" class=""btn btn-info"" onclick=""{ModalProgressBar.GetOpenWindowStringWithCreateByTemplate(PublishmentSystemId, templateInfo.TemplateId)}"">生成页面</a><a href=""javascript:;"" class=""btn btn-info"" onclick=""{ModalTemplateRestore.GetOpenLayerString(PublishmentSystemId, templateInfo.TemplateId, string.Empty)}"">还原历史版本</a>";

                            if (Body.GetQueryInt("TemplateLogID") > 0)
                            {
                                var templateLogId = Body.GetQueryInt("TemplateLogID");
                                if (templateLogId > 0)
                                {
                                    Content.Text = DataProvider.TemplateLogDao.GetTemplateContent(templateLogId);
                                    SuccessMessage("已导入历史版本的模板内容,点击确定保存模板");
                                }
                            }
                        }

                        ControlUtils.SelectListItemsIgnoreCase(Charset, ECharsetUtils.GetValue(templateInfo.Charset));

                        ControlUtils.SelectListItems(CreatedFileExtNameDropDownList, GetTemplateFileExtension(templateInfo));
                        TemplateType.Value = ETemplateTypeUtils.GetValue(templateInfo.TemplateType);
                    }
                }
                else
                {
                    RelatedFileName.Text = "T_";
                    if (_theTemplateType == ETemplateType.ChannelTemplate)
                    {
                        CreatedFileFullName.Text = "index";
                    }
                    else
                    {
                        CreatedFileFullName.Text = "@/";
                    }
                    ControlUtils.SelectListItemsIgnoreCase(Charset, PublishmentSystemInfo.Additional.Charset);
                    ControlUtils.SelectListItems(CreatedFileExtNameDropDownList, EFileSystemTypeUtils.GetValue(EFileSystemType.Html));
                    TemplateType.Value = Body.GetQueryString("TemplateType");
                }
            }
        }