コード例 #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Configration);

            EBooleanUtils.AddListItems(DdlIsWaterMark);
            ControlUtils.SelectSingleItemIgnoreCase(DdlIsWaterMark, SiteInfo.Additional.IsWaterMark.ToString());

            LoadWaterMarkPosition(SiteInfo.Additional.WaterMarkPosition);

            for (var i = 1; i <= 10; i++)
            {
                DdlWaterMarkTransparency.Items.Add(new ListItem(i + "0%", i.ToString()));
            }
            ControlUtils.SelectSingleItemIgnoreCase(DdlWaterMarkTransparency, SiteInfo.Additional.WaterMarkTransparency.ToString());

            TbWaterMarkMinWidth.Text  = SiteInfo.Additional.WaterMarkMinWidth.ToString();
            TbWaterMarkMinHeight.Text = SiteInfo.Additional.WaterMarkMinHeight.ToString();

            EBooleanUtils.AddListItems(DdlIsImageWaterMark, "图片型", "文字型");
            ControlUtils.SelectSingleItemIgnoreCase(DdlIsImageWaterMark, SiteInfo.Additional.IsImageWaterMark.ToString());

            TbWaterMarkFormatString.Text = SiteInfo.Additional.WaterMarkFormatString;

            LoadSystemFont();
            ControlUtils.SelectSingleItemIgnoreCase(DdlWaterMarkFontName, SiteInfo.Additional.WaterMarkFontName);

            TbWaterMarkFontSize.Text = SiteInfo.Additional.WaterMarkFontSize.ToString();

            TbWaterMarkImagePath.Text = SiteInfo.Additional.WaterMarkImagePath;

            DdlIsWaterMark_SelectedIndexChanged(null, null);
            TbWaterMarkImagePath.Attributes.Add("onchange", GetShowImageScript("preview_WaterMarkImagePath", SiteInfo.Additional.WebUrl));

            var showPopWinString = ModalSelectImage.GetOpenWindowString(SiteInfo, TbWaterMarkImagePath.ClientID);

            BtnImageUrlSelect.Attributes.Add("onclick", showPopWinString);

            showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(SiteId, TbWaterMarkImagePath.ClientID);
            BtnImageUrlUpload.Attributes.Add("onclick", showPopWinString);
        }
コード例 #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);

                EBooleanUtils.AddListItems(IsWaterMark);
                ControlUtils.SelectListItemsIgnoreCase(IsWaterMark, PublishmentSystemInfo.Additional.IsWaterMark.ToString());

                LoadWaterMarkPosition(PublishmentSystemInfo.Additional.WaterMarkPosition);

                for (var i = 1; i <= 10; i++)
                {
                    WaterMarkTransparency.Items.Add(new ListItem(i + "0%", i.ToString()));
                }
                ControlUtils.SelectListItemsIgnoreCase(WaterMarkTransparency, PublishmentSystemInfo.Additional.WaterMarkTransparency.ToString());

                WaterMarkMinWidth.Text  = PublishmentSystemInfo.Additional.WaterMarkMinWidth.ToString();
                WaterMarkMinHeight.Text = PublishmentSystemInfo.Additional.WaterMarkMinHeight.ToString();

                EBooleanUtils.AddListItems(IsImageWaterMark, "图片型", "文字型");
                ControlUtils.SelectListItemsIgnoreCase(IsImageWaterMark, PublishmentSystemInfo.Additional.IsImageWaterMark.ToString());

                WaterMarkFormatString.Text = PublishmentSystemInfo.Additional.WaterMarkFormatString;

                LoadSystemFont();
                ControlUtils.SelectListItemsIgnoreCase(WaterMarkFontName, PublishmentSystemInfo.Additional.WaterMarkFontName);

                WaterMarkFontSize.Text = PublishmentSystemInfo.Additional.WaterMarkFontSize.ToString();

                WaterMarkImagePath.Text = PublishmentSystemInfo.Additional.WaterMarkImagePath;

                IsWaterMark_SelectedIndexChanged(null, null);
                WaterMarkImagePath.Attributes.Add("onchange", GetShowImageScript("preview_WaterMarkImagePath", PublishmentSystemInfo.PublishmentSystemUrl));

                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, WaterMarkImagePath.ClientID);
                ImageUrlSelect.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, WaterMarkImagePath.ClientID);
                ImageUrlUpload.Attributes.Add("onclick", showPopWinString);
            }
        }
コード例 #3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ReturnUrl");
            _nodeId    = Body.GetQueryInt("NodeID");
            _returnUrl = StringUtils.ValueFromUrl(PageUtils.FilterSqlAndXss(Body.GetQueryString("ReturnUrl")));
            //if (!base.HasChannelPermissions(this.nodeID, AppManager.CMS.Permission.Channel.ChannelAdd))
            //{
            //    PageUtils.RedirectToErrorPage("您没有添加栏目的权限!");
            //    return;
            //}

            var parentNodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _nodeId);

            if (parentNodeInfo.Additional.IsChannelAddable == false)
            {
                PageUtils.RedirectToErrorPage("此栏目不能添加子栏目!");
                return;
            }

            channelControl = (ChannelAuxiliaryControl)FindControl("ControlForAuxiliary");

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "添加栏目", string.Empty);

                NodeManager.AddListItems(ParentNodeID.Items, PublishmentSystemInfo, true, true, true, Body.AdministratorName);
                ControlUtils.SelectListItems(ParentNodeID, _nodeId.ToString());

                var contentModelInfoList = ContentModelManager.GetContentModelInfoList(PublishmentSystemInfo);
                foreach (var modelInfo in contentModelInfoList)
                {
                    ContentModelID.Items.Add(new ListItem(modelInfo.ModelName, modelInfo.ModelId));
                }
                ControlUtils.SelectListItems(ContentModelID, parentNodeInfo.ContentModelId);

                channelControl.SetParameters(null, false, IsPostBack);

                NavigationPicPath.Attributes.Add("onchange", GetShowImageScript("preview_NavigationPicPath", PublishmentSystemInfo.PublishmentSystemUrl));

                var showPopWinString = ModalFilePathRule.GetOpenWindowString(PublishmentSystemId, _nodeId, true, ChannelFilePathRule.ClientID);
                CreateChannelRule.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalFilePathRule.GetOpenWindowString(PublishmentSystemId, _nodeId, false, ContentFilePathRule.ClientID);
                CreateContentRule.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, NavigationPicPath.ClientID);
                SelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImage.GetOpenWindowString(PublishmentSystemId, NavigationPicPath.ClientID);
                UploadImage.Attributes.Add("onclick", showPopWinString);

                IsChannelAddable.Items[0].Value = true.ToString();
                IsChannelAddable.Items[1].Value = false.ToString();
                IsContentAddable.Items[0].Value = true.ToString();
                IsContentAddable.Items[1].Value = false.ToString();

                ELinkTypeUtils.AddListItems(LinkType);

                NodeGroupNameCollection.DataSource = DataProvider.NodeGroupDao.GetDataSource(PublishmentSystemId);
                ChannelTemplateID.DataSource       = DataProvider.TemplateDao.GetDataSourceByType(PublishmentSystemId, ETemplateType.ChannelTemplate);
                ContentTemplateID.DataSource       = DataProvider.TemplateDao.GetDataSourceByType(PublishmentSystemId, ETemplateType.ContentTemplate);

                DataBind();

                ChannelTemplateID.Items.Insert(0, new ListItem("<未设置>", "0"));
                ChannelTemplateID.Items[0].Selected = true;

                ContentTemplateID.Items.Insert(0, new ListItem("<未设置>", "0"));
                ContentTemplateID.Items[0].Selected = true;
                Content.SetParameters(PublishmentSystemInfo, NodeAttribute.Content, null, false, IsPostBack);
            }
            else
            {
                channelControl.SetParameters(Request.Form, false, IsPostBack);
            }
        }
コード例 #4
0
ファイル: PageChannelEdit.cs プロジェクト: skotbenben/cms
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ReturnUrl");

            _nodeId    = Body.GetQueryInt("NodeID");
            _returnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl"));

            if (Body.GetQueryString("CanNotEdit") == null && Body.GetQueryString("UncheckedChannel") == null)
            {
                if (!HasChannelPermissions(_nodeId, AppManager.Cms.Permission.Channel.ChannelEdit))
                {
                    PageUtils.RedirectToErrorPage("您没有修改栏目的权限!");
                    return;
                }
            }
            if (Body.IsQueryExists("CanNotEdit"))
            {
                Submit.Visible = false;
            }

            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _nodeId);

            if (nodeInfo != null)
            {
                channelControl = (ChannelAuxiliaryControl)FindControl("ControlForAuxiliary");
                if (!IsPostBack)
                {
                    BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "编辑栏目", string.Empty);

                    var contentModelInfoList = ContentModelManager.GetContentModelInfoList(PublishmentSystemInfo);
                    foreach (var modelInfo in contentModelInfoList)
                    {
                        ContentModelID.Items.Add(new ListItem(modelInfo.ModelName, modelInfo.ModelId));
                    }
                    ControlUtils.SelectListItems(ContentModelID, nodeInfo.ContentModelId);

                    channelControl.SetParameters(nodeInfo.Additional.Attributes, true, IsPostBack);

                    NavigationPicPath.Attributes.Add("onchange", GetShowImageScript("preview_NavigationPicPath", PublishmentSystemInfo.PublishmentSystemUrl));

                    var showPopWinString = ModalFilePathRule.GetOpenWindowString(PublishmentSystemId, _nodeId, true, ChannelFilePathRule.ClientID);
                    CreateChannelRule.Attributes.Add("onclick", showPopWinString);

                    showPopWinString = ModalFilePathRule.GetOpenWindowString(PublishmentSystemId, _nodeId, false, ContentFilePathRule.ClientID);
                    CreateContentRule.Attributes.Add("onclick", showPopWinString);

                    showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, NavigationPicPath.ClientID);
                    SelectImage.Attributes.Add("onclick", showPopWinString);

                    showPopWinString = ModalUploadImage.GetOpenWindowString(PublishmentSystemId, NavigationPicPath.ClientID);
                    UploadImage.Attributes.Add("onclick", showPopWinString);
                    IsChannelAddable.Items[0].Value = true.ToString();
                    IsChannelAddable.Items[1].Value = false.ToString();
                    IsContentAddable.Items[0].Value = true.ToString();
                    IsContentAddable.Items[1].Value = false.ToString();

                    ELinkTypeUtils.AddListItems(LinkType);

                    NodeGroupNameCollection.DataSource = DataProvider.NodeGroupDao.GetDataSource(PublishmentSystemId);

                    ChannelTemplateID.DataSource = DataProvider.TemplateDao.GetDataSourceByType(PublishmentSystemId, ETemplateType.ChannelTemplate);

                    ContentTemplateID.DataSource = DataProvider.TemplateDao.GetDataSourceByType(PublishmentSystemId, ETemplateType.ContentTemplate);

                    DataBind();

                    ChannelTemplateID.Items.Insert(0, new ListItem("<未设置>", "0"));
                    ControlUtils.SelectListItems(ChannelTemplateID, nodeInfo.ChannelTemplateId.ToString());

                    ContentTemplateID.Items.Insert(0, new ListItem("<未设置>", "0"));
                    ControlUtils.SelectListItems(ContentTemplateID, nodeInfo.ContentTemplateId.ToString());

                    NodeName.Text      = nodeInfo.NodeName;
                    NodeIndexName.Text = nodeInfo.NodeIndexName;
                    LinkUrl.Text       = nodeInfo.LinkUrl;

                    foreach (ListItem item in NodeGroupNameCollection.Items)
                    {
                        if (CompareUtils.Contains(nodeInfo.NodeGroupNameCollection, item.Value))
                        {
                            item.Selected = true;
                        }
                        else
                        {
                            item.Selected = false;
                        }
                    }
                    FilePath.Text            = nodeInfo.FilePath;
                    ChannelFilePathRule.Text = nodeInfo.ChannelFilePathRule;
                    ContentFilePathRule.Text = nodeInfo.ContentFilePathRule;

                    //NodeProperty
                    ControlUtils.SelectListItems(LinkType, ELinkTypeUtils.GetValue(nodeInfo.LinkType));
                    ControlUtils.SelectListItems(IsChannelAddable, nodeInfo.Additional.IsChannelAddable.ToString());
                    ControlUtils.SelectListItems(IsContentAddable, nodeInfo.Additional.IsContentAddable.ToString());

                    NavigationPicPath.Text = nodeInfo.ImageUrl;

                    var formCollection = new NameValueCollection();
                    formCollection[NodeAttribute.Content] = nodeInfo.Content;
                    Content.SetParameters(PublishmentSystemInfo, NodeAttribute.Content, formCollection, true, IsPostBack);

                    Keywords.Text    = nodeInfo.Keywords;
                    Description.Text = nodeInfo.Description;

                    //this.Content.PublishmentSystemID = base.PublishmentSystemID;
                    //this.Content.Text = StringUtility.TextEditorContentDecode(nodeInfo.Content, ConfigUtils.Instance.ApplicationPath, base.PublishmentSystemInfo.PublishmentSystemUrl);

                    if (nodeInfo.NodeType == ENodeType.BackgroundPublishNode)
                    {
                        LinkURLRow.Visible           = false;
                        LinkTypeRow.Visible          = false;
                        ChannelTemplateIDRow.Visible = false;
                        FilePathRow.Visible          = false;
                    }
                }
                else
                {
                    channelControl.SetParameters(Request.Form, true, IsPostBack);
                }
            }
        }
コード例 #5
0
ファイル: PageChannelEdit.cs プロジェクト: zhangjingpu/cms-1
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId", "channelId", "ReturnUrl");

            _channelId = Body.GetQueryInt("channelId");
            ReturnUrl  = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl"));

            if (Body.GetQueryString("CanNotEdit") == null && Body.GetQueryString("UncheckedChannel") == null)
            {
                if (!HasChannelPermissions(_channelId, ConfigManager.Permissions.Channel.ChannelEdit))
                {
                    PageUtils.RedirectToErrorPage("您没有修改栏目的权限!");
                    return;
                }
            }
            if (Body.IsQueryExists("CanNotEdit"))
            {
                BtnSubmit.Visible = false;
            }

            var nodeInfo = ChannelManager.GetChannelInfo(SiteId, _channelId);

            if (nodeInfo == null)
            {
                return;
            }

            CacAttributes.SiteInfo  = SiteInfo;
            CacAttributes.ChannelId = _channelId;

            if (!IsPostBack)
            {
                DdlContentModelPluginId.Items.Add(new ListItem("<默认>", string.Empty));
                var contentTables = PluginContentManager.GetContentModelPlugins();
                foreach (var contentTable in contentTables)
                {
                    DdlContentModelPluginId.Items.Add(new ListItem(contentTable.Title, contentTable.Id));
                }
                ControlUtils.SelectSingleItem(DdlContentModelPluginId, nodeInfo.ContentModelPluginId);

                var plugins = PluginContentManager.GetAllContentRelatedPlugins(false);
                if (plugins.Count > 0)
                {
                    var relatedPluginIds =
                        TranslateUtils.StringCollectionToStringList(nodeInfo.ContentRelatedPluginIds);
                    foreach (var pluginMetadata in plugins)
                    {
                        CblContentRelatedPluginIds.Items.Add(new ListItem(pluginMetadata.Title, pluginMetadata.Id)
                        {
                            Selected = relatedPluginIds.Contains(pluginMetadata.Id)
                        });
                    }
                }
                else
                {
                    PhContentRelatedPluginIds.Visible = false;
                }

                CacAttributes.Attributes = nodeInfo.Additional;

                TbImageUrl.Attributes.Add("onchange", GetShowImageScript("preview_NavigationPicPath", SiteInfo.Additional.WebUrl));

                var showPopWinString = ModalFilePathRule.GetOpenWindowString(SiteId, _channelId, true, TbChannelFilePathRule.ClientID);
                BtnCreateChannelRule.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalFilePathRule.GetOpenWindowString(SiteId, _channelId, false, TbContentFilePathRule.ClientID);
                BtnCreateContentRule.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectImage.GetOpenWindowString(SiteInfo, TbImageUrl.ClientID);
                BtnSelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImage.GetOpenWindowString(SiteId, TbImageUrl.ClientID);
                BtnUploadImage.Attributes.Add("onclick", showPopWinString);

                ELinkTypeUtils.AddListItems(DdlLinkType);
                ETaxisTypeUtils.AddListItemsForChannelEdit(DdlTaxisType);

                CblNodeGroupNameCollection.DataSource = DataProvider.ChannelGroupDao.GetDataSource(SiteId);

                DdlChannelTemplateId.DataSource = DataProvider.TemplateDao.GetDataSourceByType(SiteId, TemplateType.ChannelTemplate);

                DdlContentTemplateId.DataSource = DataProvider.TemplateDao.GetDataSourceByType(SiteId, TemplateType.ContentTemplate);

                DataBind();

                DdlChannelTemplateId.Items.Insert(0, new ListItem("<未设置>", "0"));
                ControlUtils.SelectSingleItem(DdlChannelTemplateId, nodeInfo.ChannelTemplateId.ToString());

                DdlContentTemplateId.Items.Insert(0, new ListItem("<未设置>", "0"));
                ControlUtils.SelectSingleItem(DdlContentTemplateId, nodeInfo.ContentTemplateId.ToString());

                TbNodeName.Text      = nodeInfo.ChannelName;
                TbNodeIndexName.Text = nodeInfo.IndexName;
                TbLinkUrl.Text       = nodeInfo.LinkUrl;

                foreach (ListItem item in CblNodeGroupNameCollection.Items)
                {
                    item.Selected = CompareUtils.Contains(nodeInfo.GroupNameCollection, item.Value);
                }
                TbFilePath.Text            = nodeInfo.FilePath;
                TbChannelFilePathRule.Text = nodeInfo.ChannelFilePathRule;
                TbContentFilePathRule.Text = nodeInfo.ContentFilePathRule;

                ControlUtils.SelectSingleItem(DdlLinkType, nodeInfo.LinkType);
                ControlUtils.SelectSingleItem(DdlTaxisType, nodeInfo.Additional.DefaultTaxisType);
                ControlUtils.SelectSingleItem(RblIsChannelAddable, nodeInfo.Additional.IsChannelAddable.ToString());
                ControlUtils.SelectSingleItem(RblIsContentAddable, nodeInfo.Additional.IsContentAddable.ToString());

                TbImageUrl.Text = nodeInfo.ImageUrl;

                TbContent.SetParameters(SiteInfo, ChannelAttribute.Content, nodeInfo.Content);

                TbKeywords.Text    = nodeInfo.Keywords;
                TbDescription.Text = nodeInfo.Description;

                //this.Content.SiteId = base.SiteId;
                //this.Content.Text = StringUtility.TextEditorContentDecode(nodeInfo.Content, ConfigUtils.Instance.ApplicationPath, base.SiteInfo.SiteUrl);
            }
            else
            {
                CacAttributes.Attributes = new ExtendedAttributes(Request.Form);
            }
        }
コード例 #6
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId", "channelId", "ReturnUrl");
            _channelId = AuthRequest.GetQueryInt("channelId");
            ReturnUrl  = StringUtils.ValueFromUrl(PageUtils.FilterSqlAndXss(AuthRequest.GetQueryString("ReturnUrl")));
            //if (!base.HasChannelPermissions(this.channelId, AppManager.CMS.Permission.Channel.ChannelAdd))
            //{
            //    PageUtils.RedirectToErrorPage("您没有添加栏目的权限!");
            //    return;
            //}

            var parentNodeInfo = ChannelManager.GetChannelInfo(SiteId, _channelId);

            if (parentNodeInfo.Additional.IsChannelAddable == false)
            {
                PageUtils.RedirectToErrorPage("此栏目不能添加子栏目!");
                return;
            }

            CacAttributes.SiteInfo  = SiteInfo;
            CacAttributes.ChannelId = _channelId;

            if (!IsPostBack)
            {
                ChannelManager.AddListItems(DdlParentChannelId.Items, SiteInfo, true, true, AuthRequest.AdminPermissions);
                ControlUtils.SelectSingleItem(DdlParentChannelId, _channelId.ToString());

                DdlContentModelPluginId.Items.Add(new ListItem("<默认>", string.Empty));
                var contentTables = PluginContentManager.GetContentModelPlugins();
                foreach (var contentTable in contentTables)
                {
                    DdlContentModelPluginId.Items.Add(new ListItem(contentTable.Title, contentTable.Id));
                }
                ControlUtils.SelectSingleItem(DdlContentModelPluginId, parentNodeInfo.ContentModelPluginId);

                var plugins = PluginContentManager.GetAllContentRelatedPlugins(false);
                if (plugins.Count > 0)
                {
                    foreach (var pluginMetadata in plugins)
                    {
                        CblContentRelatedPluginIds.Items.Add(new ListItem(pluginMetadata.Title, pluginMetadata.Id));
                    }
                }
                else
                {
                    PhContentRelatedPluginIds.Visible = false;
                }

                CacAttributes.Attributes = new ExtendedAttributes();

                TbImageUrl.Attributes.Add("onchange", GetShowImageScript("preview_NavigationPicPath", SiteInfo.Additional.WebUrl));

                var showPopWinString = ModalFilePathRule.GetOpenWindowString(SiteId, _channelId, true, TbChannelFilePathRule.ClientID);
                BtnCreateChannelRule.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalFilePathRule.GetOpenWindowString(SiteId, _channelId, false, TbContentFilePathRule.ClientID);
                BtnCreateContentRule.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectImage.GetOpenWindowString(SiteInfo, TbImageUrl.ClientID);
                BtnSelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImage.GetOpenWindowString(SiteId, TbImageUrl.ClientID);
                BtnUploadImage.Attributes.Add("onclick", showPopWinString);

                ELinkTypeUtils.AddListItems(DdlLinkType);

                ETaxisTypeUtils.AddListItemsForChannelEdit(DdlTaxisType);
                ControlUtils.SelectSingleItem(DdlTaxisType, ETaxisTypeUtils.GetValue(ETaxisType.OrderByTaxisDesc));

                CblNodeGroupNameCollection.DataSource = DataProvider.ChannelGroupDao.GetDataSource(SiteId);
                DdlChannelTemplateId.DataSource       = DataProvider.TemplateDao.GetDataSourceByType(SiteId, TemplateType.ChannelTemplate);
                DdlContentTemplateId.DataSource       = DataProvider.TemplateDao.GetDataSourceByType(SiteId, TemplateType.ContentTemplate);

                DataBind();

                DdlChannelTemplateId.Items.Insert(0, new ListItem("<默认>", "0"));
                DdlChannelTemplateId.Items[0].Selected = true;

                DdlContentTemplateId.Items.Insert(0, new ListItem("<默认>", "0"));
                DdlContentTemplateId.Items[0].Selected = true;
                TbContent.SetParameters(SiteInfo, ChannelAttribute.Content, string.Empty);
            }
            else
            {
                CacAttributes.Attributes = new ExtendedAttributes(Request.Form);
            }
        }
コード例 #7
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");
            if (Body.IsQueryExists("AdvertisementName"))
            {
                isEdit = true;
                editAdvertisementName = Body.GetQueryString("AdvertisementName");
                if (DataProvider.AdvertisementDao.IsExists(editAdvertisementName, PublishmentSystemId))
                {
                    editAdvertisementType = DataProvider.AdvertisementDao.GetAdvertisementType(editAdvertisementName, PublishmentSystemId);
                }
                else
                {
                    ErrorLabel.Text = $"不存在名称为“{editAdvertisementName}”的广告!";
                    SetActivePanel(WizardPanel.OperatingError, OperatingError);
                    return;
                }
            }

            if (!Page.IsPostBack)
            {
                var pageTitle = isEdit ? "编辑漂浮广告" : "添加漂浮广告";
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdAdvertisement, pageTitle, AppManager.Cms.Permission.WebSite.Advertisement);

                ltlPageTitle.Text = pageTitle;

                StartDate.Text = DateUtils.GetDateAndTimeString(DateTime.Now);
                EndDate.Text   = DateUtils.GetDateAndTimeString(DateTime.Now.AddMonths(1));

                EAdvertisementTypeUtils.AddListItems(AdvertisementType);
                ControlUtils.SelectListItems(AdvertisementType, EAdvertisementTypeUtils.GetValue(EAdvertisementType.FloatImage));

                var nodeIdList = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(PublishmentSystemId);
                var nodeCount  = nodeIdList.Count;
                isLastNodeArray = new bool[nodeCount];
                foreach (int theNodeID in nodeIdList)
                {
                    var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, theNodeID);

                    var title    = WebUtils.GetChannelListBoxTitle(PublishmentSystemId, nodeInfo.NodeId, nodeInfo.NodeName, nodeInfo.NodeType, nodeInfo.ParentsCount, nodeInfo.IsLastNode, isLastNodeArray);
                    var listitem = new ListItem(title, nodeInfo.NodeId.ToString());
                    NodeIDCollectionToChannel.Items.Add(listitem);
                    title = title + $"({nodeInfo.ContentNum})";
                    var listitem2 = new ListItem(title, nodeInfo.NodeId.ToString());
                    NodeIDCollectionToContent.Items.Add(listitem2);
                }

                var fileTemplateInfoList = DataProvider.TemplateDao.GetTemplateInfoListByType(PublishmentSystemId, ETemplateType.FileTemplate);
                if (fileTemplateInfoList.Count > 0)
                {
                    foreach (var fileTemplateInfo in fileTemplateInfoList)
                    {
                        var listitem = new ListItem(fileTemplateInfo.CreatedFileFullName, fileTemplateInfo.TemplateId.ToString());
                        FileTemplateIDCollection.Items.Add(listitem);
                    }
                }
                else
                {
                    FileTemplateIDCollectionRow.Visible = false;
                }

                EPositionTypeUtils.AddListItems(PositionType, ERollingType.Static);

                ERollingTypeUtils.AddListItems(RollingType);
                ControlUtils.SelectListItems(RollingType, ERollingTypeUtils.GetValue(ERollingType.FollowingScreen));

                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ImageUrl.ClientID);
                SelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, ImageUrl.ClientID);
                UploadImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ScreenDownImageUrl.ClientID);
                ScreenDownSelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, ScreenDownImageUrl.ClientID);
                ScreenDownUploadImage.Attributes.Add("onclick", showPopWinString);

                SetActivePanel(WizardPanel.AdvertisementBase, AdvertisementBase);

                if (isEdit)
                {
                    var adInfo = DataProvider.AdvertisementDao.GetAdvertisementInfo(editAdvertisementName, PublishmentSystemId);
                    AdvertisementName.Text          = adInfo.AdvertisementName;
                    AdvertisementName.Enabled       = false;
                    AdvertisementType.SelectedValue = EAdvertisementTypeUtils.GetValue(editAdvertisementType);

                    IsDateLimited.Checked = adInfo.IsDateLimited;
                    StartDate.Text        = DateUtils.GetDateAndTimeString(adInfo.StartDate);
                    EndDate.Text          = DateUtils.GetDateAndTimeString(adInfo.EndDate);
                    ControlUtils.SelectListItems(NodeIDCollectionToChannel, TranslateUtils.StringCollectionToStringList(adInfo.NodeIDCollectionToChannel));
                    ControlUtils.SelectListItems(NodeIDCollectionToContent, TranslateUtils.StringCollectionToStringList(adInfo.NodeIDCollectionToContent));
                    ControlUtils.SelectListItems(FileTemplateIDCollection, TranslateUtils.StringCollectionToStringList(adInfo.FileTemplateIDCollection));

                    if (adInfo.AdvertisementType == EAdvertisementType.FloatImage)
                    {
                        var adFloatImageInfo = new AdvertisementFloatImageInfo(adInfo.Settings);
                        IsCloseable.Checked       = adFloatImageInfo.IsCloseable;
                        ePositionType             = adFloatImageInfo.PositionType;
                        PositionX.Text            = adFloatImageInfo.PositionX.ToString();
                        PositionY.Text            = adFloatImageInfo.PositionY.ToString();
                        RollingType.SelectedValue = ERollingTypeUtils.GetValue(adFloatImageInfo.RollingType);

                        NavigationUrl.Text = adFloatImageInfo.NavigationUrl;
                        ImageUrl.Text      = adFloatImageInfo.ImageUrl;
                        Height.Text        = adFloatImageInfo.Height.ToString();
                        Width.Text         = adFloatImageInfo.Width.ToString();
                    }
                    else if (adInfo.AdvertisementType == EAdvertisementType.ScreenDown)
                    {
                        var adScreenDownInfo = new AdvertisementScreenDownInfo(adInfo.Settings);
                        ScreenDownNavigationUrl.Text = adScreenDownInfo.NavigationUrl;
                        ScreenDownImageUrl.Text      = adScreenDownInfo.ImageUrl;
                        ScreenDownDelay.Text         = adScreenDownInfo.Delay.ToString();
                        ScreenDownWidth.Text         = adScreenDownInfo.Width.ToString();
                        ScreenDownHeight.Text        = adScreenDownInfo.Height.ToString();
                    }
                    else if (adInfo.AdvertisementType == EAdvertisementType.OpenWindow)
                    {
                        var adOpenWindowInfo = new AdvertisementOpenWindowInfo(adInfo.Settings);
                        OpenWindowFileUrl.Text = adOpenWindowInfo.FileUrl;
                        OpenWindowWidth.Text   = adOpenWindowInfo.Width.ToString();
                        OpenWindowHeight.Text  = adOpenWindowInfo.Height.ToString();
                    }
                }
                ReFresh(null, EventArgs.Empty);
            }

            SuccessMessage(string.Empty);
        }
コード例 #8
0
        public void Page_Load(object sender, EventArgs e)
        {
            _advId = Body.GetQueryInt("AdvID");

            if (Body.IsQueryExists("AdMaterialID"))
            {
                _theAdMaterialId = Body.GetQueryInt("AdMaterialID");
                if (_theAdMaterialId > 0)
                {
                    _isEdit = true;
                }
            }

            if (!Page.IsPostBack)
            {
                EAdvTypeUtils.AddListItems(AdMaterialType);
                ControlUtils.SelectListItems(AdMaterialType, EAdvTypeUtils.GetValue(EAdvType.HtmlCode));

                EBooleanUtils.AddListItems(IsEnabled);
                ControlUtils.SelectListItems(IsEnabled, true.ToString());

                EAdvWeightUtils.AddListItems(Weight);
                ControlUtils.SelectListItems(Weight, EAdvWeightUtils.GetValue(EAdvWeight.Level1));

                var advInfo = DataProvider.AdvDao.GetAdvInfo(_advId, PublishmentSystemId);
                if (advInfo != null)
                {
                    if (advInfo.RotateType == EAdvRotateType.HandWeight)
                    {
                        phWeight.Visible = true;
                    }
                    else
                    {
                        phWeight.Visible = false;
                    }
                }
                ImageUrl.Attributes.Add("onchange", GetShowImageScript("preview_ImageUrl", PublishmentSystemInfo.PublishmentSystemUrl));

                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ImageUrl.ClientID);
                ImageUrlSelect.Attributes.Add("onclick", showPopWinString);

                //false -- 不添加水印
                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, ImageUrl.ClientID, false);
                ImageUrlUpload.Attributes.Add("onclick", showPopWinString);

                FlashUrl.Attributes.Add("onchange", GetShowImageScript("preview_FlashUrl", PublishmentSystemInfo.PublishmentSystemUrl));

                showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, FlashUrl.ClientID);
                FlashUrlSelect.Attributes.Add("onclick", showPopWinString);

                //false -- 不添加水印
                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, FlashUrl.ClientID, false);
                FlashUrlUpload.Attributes.Add("onclick", showPopWinString);

                if (_isEdit)
                {
                    var adMaterialInfo = DataProvider.AdMaterialDao.GetAdMaterialInfo(_theAdMaterialId, PublishmentSystemId);
                    AdMaterialName.Text          = adMaterialInfo.AdMaterialName;
                    AdMaterialType.SelectedValue = EAdvTypeUtils.GetValue(adMaterialInfo.AdMaterialType);
                    IsEnabled.SelectedValue      = adMaterialInfo.IsEnabled.ToString();

                    Code.Text            = adMaterialInfo.Code;
                    TextWord.Text        = adMaterialInfo.TextWord;
                    TextLink.Text        = adMaterialInfo.TextLink;
                    TextColor.Text       = adMaterialInfo.TextColor;
                    TextFontSize.Text    = adMaterialInfo.TextFontSize.ToString();
                    Weight.SelectedValue = adMaterialInfo.Weight.ToString();
                    if (adMaterialInfo.AdMaterialType == EAdvType.Image)
                    {
                        ImageUrl.Text    = adMaterialInfo.ImageUrl;
                        ImageLink.Text   = adMaterialInfo.ImageLink;
                        ImageWidth.Text  = adMaterialInfo.ImageWidth.ToString();
                        ImageHeight.Text = adMaterialInfo.ImageHeight.ToString();
                        ImageAlt.Text    = adMaterialInfo.ImageAlt;
                    }
                    else if (adMaterialInfo.AdMaterialType == EAdvType.Flash)
                    {
                        FlashUrl.Text    = adMaterialInfo.ImageUrl;
                        FlashWidth.Text  = adMaterialInfo.ImageWidth.ToString();
                        FlashHeight.Text = adMaterialInfo.ImageHeight.ToString();
                    }
                }

                ReFresh(null, EventArgs.Empty);
            }

            SuccessMessage(string.Empty);
        }
コード例 #9
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            menuDisplayID = Body.GetQueryInt("MenuDisplayID");

            if (!IsPostBack)
            {
                var pageTitle = (menuDisplayID == 0) ? "添加菜单样式" : "编辑菜单样式";
                BreadCrumb(AppManager.Cms.LeftMenu.IdTemplate, AppManager.Cms.LeftMenu.Template.IdTagStyle, pageTitle, AppManager.Cms.Permission.WebSite.Template);

                ltlPageTitle.Text = pageTitle;

                IsDefault.Items[0].Value = true.ToString();
                IsDefault.Items[1].Value = false.ToString();

                Vertical.Items.Add(new ListItem("垂直", "true"));
                Vertical.Items.Add(new ListItem("水平", "false"));

                FontFamily.Items.Add(new ListItem("<未设置>", ""));
                FontFamily.Items.Add(new ListItem("Arial, Helvetica, sans-serif", "Arial, Helvetica, sans-serif"));
                FontFamily.Items.Add(new ListItem("Times New Roman, Times, serif", "Times New Roman, Times, serif"));
                FontFamily.Items.Add(new ListItem("Courier New, Courier, mono", "Courier New, Courier, mono"));
                FontFamily.Items.Add(new ListItem("Georgia, Times New Roman, Times, serif", "Georgia, Times New Roman, Times, serif"));
                FontFamily.Items.Add(new ListItem("Verdana, Arial, Helvetica, sans-serif", "Verdana, Arial, Helvetica, sans-serif"));
                FontFamily.Items.Add(new ListItem("Geneva, Arial, Helvetica, sans-serif", "Geneva, Arial, Helvetica, sans-serif"));
                FontFamily.Items.Add(new ListItem("宋体", "宋体"));
                FontFamily.Items.Add(new ListItem("仿宋", "仿宋"));
                FontFamily.Items.Add(new ListItem("黑体", "黑体"));
                FontFamily.Items.Add(new ListItem("楷体", "楷体"));
                FontFamily.Items.Add(new ListItem("新宋体", "新宋体"));
                FontFamily.Items.Add(new ListItem("幼圆", "幼圆"));

                FontWeight.Items.Add(new ListItem("普通", "plain"));
                FontWeight.Items.Add(new ListItem("粗体", "bold"));

                FontStyle.Items.Add(new ListItem("普通", "normal"));
                FontStyle.Items.Add(new ListItem("斜体", "italic"));

                MenuItemHAlign.Items.Add(new ListItem("居中", "center"));
                MenuItemHAlign.Items.Add(new ListItem("对齐", "justify"));
                MenuItemHAlign.Items.Add(new ListItem("左", "left"));
                MenuItemHAlign.Items.Add(new ListItem("右", "right"));

                MenuItemVAlign.Items.Add(new ListItem("居中", "middle"));
                MenuItemVAlign.Items.Add(new ListItem("底端", "bottom"));
                MenuItemVAlign.Items.Add(new ListItem("顶端", "top"));

                HideOnMouseOut.Items.Add(new ListItem("隐藏", "true"));
                HideOnMouseOut.Items.Add(new ListItem("不隐藏", "false"));

                MenuBgOpaque.Items.Add(new ListItem("显示边框", "true"));
                MenuBgOpaque.Items.Add(new ListItem("不显示边框", "false"));
                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ChildMenuIcon.ClientID);
                SelectImage.Attributes.Add("onclick", showPopWinString);
                if (menuDisplayID > 0)
                {
                    var menuDisplayInfo = DataProvider.MenuDisplayDao.GetMenuDisplayInfo(menuDisplayID);
                    if (menuDisplayInfo != null)
                    {
                        MenuDisplayName.Text    = menuDisplayInfo.MenuDisplayName;
                        MenuDisplayName.Enabled = false;
                        foreach (ListItem item in Vertical.Items)
                        {
                            item.Selected = ((menuDisplayInfo.Vertical.Equals(item.Value))) ? true : false;
                        }
                        foreach (ListItem item in FontFamily.Items)
                        {
                            item.Selected = ((menuDisplayInfo.FontFamily.Equals(item.Value))) ? true : false;
                        }
                        FontSize.Text = menuDisplayInfo.FontSize.ToString();
                        foreach (ListItem item in FontWeight.Items)
                        {
                            item.Selected = ((menuDisplayInfo.FontWeight.Equals(item.Value))) ? true : false;
                        }
                        foreach (ListItem item in FontStyle.Items)
                        {
                            item.Selected = ((menuDisplayInfo.FontStyle.Equals(item.Value))) ? true : false;
                        }
                        foreach (ListItem item in MenuItemHAlign.Items)
                        {
                            item.Selected = ((menuDisplayInfo.MenuItemHAlign.Equals(item.Value))) ? true : false;
                        }
                        foreach (ListItem item in MenuItemVAlign.Items)
                        {
                            item.Selected = ((menuDisplayInfo.MenuItemVAlign.Equals(item.Value))) ? true : false;
                        }
                        FontColor.Text         = menuDisplayInfo.FontColor;
                        MenuItemBgColor.Text   = menuDisplayInfo.MenuItemBgColor;
                        FontColorHilite.Text   = menuDisplayInfo.FontColorHilite;
                        MenuHiliteBgColor.Text = menuDisplayInfo.MenuHiliteBgColor;
                        XPosition.Text         = menuDisplayInfo.XPosition;
                        YPosition.Text         = menuDisplayInfo.YPosition;
                        foreach (ListItem item in HideOnMouseOut.Items)
                        {
                            item.Selected = ((menuDisplayInfo.HideOnMouseOut.Equals(item.Value))) ? true : false;
                        }
                        MenuWidth.Text       = menuDisplayInfo.MenuWidth.ToString();
                        MenuItemHeight.Text  = menuDisplayInfo.MenuItemHeight.ToString();
                        MenuItemPadding.Text = menuDisplayInfo.MenuItemPadding.ToString();
                        MenuItemSpacing.Text = menuDisplayInfo.MenuItemSpacing.ToString();
                        MenuItemIndent.Text  = menuDisplayInfo.MenuItemIndent.ToString();
                        HideTimeout.Text     = menuDisplayInfo.HideTimeout.ToString();
                        foreach (ListItem item in MenuBgOpaque.Items)
                        {
                            item.Selected = ((menuDisplayInfo.MenuBgOpaque.Equals(item.Value))) ? true : false;
                        }
                        MenuBorder.Text        = menuDisplayInfo.MenuBorder.ToString();
                        BGColor.Text           = menuDisplayInfo.BgColor;
                        MenuBorderBgColor.Text = menuDisplayInfo.MenuBorderBgColor;
                        MenuLiteBgColor.Text   = menuDisplayInfo.MenuLiteBgColor;
                        ChildMenuIcon.Text     = menuDisplayInfo.ChildMenuIcon;

                        Description.Text = menuDisplayInfo.Description;
                        ControlUtils.SelectListItems(IsDefault, menuDisplayInfo.IsDefault.ToString());
                    }
                }
            }
        }