Exemplo n.º 1
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var relatedFieldInfo = (RelatedFieldInfo)e.Item.DataItem;

            var ltlRelatedFieldName = (Literal)e.Item.FindControl("ltlRelatedFieldName");
            var ltlTotalLevel       = (Literal)e.Item.FindControl("ltlTotalLevel");
            var ltlItemsUrl         = (Literal)e.Item.FindControl("ltlItemsUrl");
            var ltlEditUrl          = (Literal)e.Item.FindControl("ltlEditUrl");
            var ltlExportUrl        = (Literal)e.Item.FindControl("ltlExportUrl");
            var ltlDeleteUrl        = (Literal)e.Item.FindControl("ltlDeleteUrl");

            ltlRelatedFieldName.Text = relatedFieldInfo.Title;
            ltlTotalLevel.Text       = relatedFieldInfo.TotalLevel.ToString();
            var urlItems = PageRelatedFieldMain.GetRedirectUrl(SiteId, relatedFieldInfo.Id, relatedFieldInfo.TotalLevel);

            ltlItemsUrl.Text = $@"<a href=""{urlItems}"">管理字段项</a>";

            ltlEditUrl.Text =
                $@"<a href=""javascript:;"" onclick=""{ModalRelatedFieldAdd.GetOpenWindowString(
                    SiteId, relatedFieldInfo.Id)}"">编辑</a>";
            ltlExportUrl.Text =
                $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToRelatedField(SiteId, relatedFieldInfo.Id)}"">导出</a>";
            ltlDeleteUrl.Text =
                $@"<a href=""javascript:;"" onclick=""{PageUtils.GetRedirectStringWithConfirm(
                    PageUtils.GetCmsUrl(SiteId, nameof(PageRelatedField), new NameValueCollection
                    {
                        {"RelatedFieldID", relatedFieldInfo.Id.ToString()},
                        {"Delete", true.ToString()}
                    }), " 确认删除此联动字段吗? ")}" ">删除</a>";
        }
Exemplo n.º 2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ContentID");
            _nodeId    = Body.GetQueryInt("NodeID");
            _contentId = Body.GetQueryInt("ContentID");
            _returnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("returnUrl"));

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "评论管理", string.Empty);

                StlCommentInput.ApiUrl              = PageUtils.GetApiUrl();
                StlCommentInput.IsAnonymous         = true;
                StlCommentInput.PageNum             = 20;
                StlCommentInput.ApiActionsAddUrl    = CMS.Controllers.Comments.ActionsAdd.GetUrl(StlCommentInput.ApiUrl, PublishmentSystemId, _nodeId, _contentId);
                StlCommentInput.ApiActionsDeleteUrl = CMS.Controllers.Comments.ActionsDelete.GetUrl(StlCommentInput.ApiUrl, PublishmentSystemId, _nodeId, _contentId);
                StlCommentInput.ApiActionsGoodUrl   = CMS.Controllers.Comments.ActionsGood.GetUrl(StlCommentInput.ApiUrl, PublishmentSystemId, _nodeId, _contentId);
                StlCommentInput.ApiGetUrl           = CMS.Controllers.Comments.Get.GetUrl(StlCommentInput.ApiUrl, PublishmentSystemId, _nodeId, _contentId);
                StlCommentInput.ApiActionsLogoutUrl = CMS.Controllers.Users.ActionsLogout.GetUrl(StlCommentInput.ApiUrl);
                StlCommentInput.HomeUrl             = PageUtils.GetHomeUrl();
                StlCommentInput.IsDelete            = true;

                BtnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToComment(PublishmentSystemId, _nodeId, _contentId));
            }
        }
Exemplo n.º 3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _tableName         = DataProvider.SiteDao.TableName;
            _itemId            = AuthRequest.GetQueryInt("itemID");
            _relatedIdentities = TableStyleManager.GetRelatedIdentities(SiteId);
            _attributeNames    = TableColumnManager.GetTableColumnNameList(_tableName);
            _returnUrl         = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("ReturnUrl"));

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Configration);

            //删除样式
            if (AuthRequest.IsQueryExists("DeleteStyle"))
            {
                var attributeName = AuthRequest.GetQueryString("AttributeName");
                if (TableStyleManager.IsExists(SiteId, _tableName, attributeName))
                {
                    try
                    {
                        DataProvider.TableStyleDao.Delete(SiteId, _tableName, attributeName);
                        AuthRequest.AddSiteLog(SiteId, "删除数据表单样式", $"表单:{_tableName},字段:{attributeName}");
                        SuccessDeleteMessage();
                    }
                    catch (Exception ex)
                    {
                        FailDeleteMessage(ex);
                    }
                }
            }

            if (!string.IsNullOrEmpty(_returnUrl))
            {
                BtnReturn.Attributes.Add("onclick", $"location.href='{_returnUrl}';return false;");
            }
            else
            {
                BtnReturn.Visible = false;
            }

            RptContents.DataSource     = TableStyleManager.GetSiteStyleInfoList(SiteId);
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();

            var redirectUrl = GetRedirectUrl(SiteId, _itemId, _returnUrl);

            BtnAddStyle.Attributes.Add("onclick", ModalTableStyleAdd.GetOpenWindowString(SiteId, 0, _relatedIdentities, _tableName, string.Empty, redirectUrl));
            BtnAddStyles.Attributes.Add("onclick", ModalTableStylesAdd.GetOpenWindowString(SiteId, _relatedIdentities, _tableName, redirectUrl));

            BtnImport.Attributes.Add("onclick", ModalTableStyleImport.GetOpenWindowString(_tableName, SiteId, SiteId));
            BtnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToSingleTableStyle(_tableName, SiteId, SiteId));
        }
Exemplo n.º 4
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var relatedFieldID   = SqlUtils.EvalInt(e.Item.DataItem, "RelatedFieldID");
                var relatedFieldName = SqlUtils.EvalString(e.Item.DataItem, "RelatedFieldName");
                var totalLevel       = SqlUtils.EvalInt(e.Item.DataItem, "TotalLevel");

                var ltlRelatedFieldName = (Literal)e.Item.FindControl("ltlRelatedFieldName");
                var ltlTotalLevel       = (Literal)e.Item.FindControl("ltlTotalLevel");
                var ltlItemsUrl         = (Literal)e.Item.FindControl("ltlItemsUrl");
                var ltlEditUrl          = (Literal)e.Item.FindControl("ltlEditUrl");
                var ltlExportUrl        = (Literal)e.Item.FindControl("ltlExportUrl");
                var ltlDeleteUrl        = (Literal)e.Item.FindControl("ltlDeleteUrl");

                ltlRelatedFieldName.Text = relatedFieldName;
                ltlTotalLevel.Text       = totalLevel.ToString();
                var urlItems = PageRelatedFieldMain.GetRedirectUrl(PublishmentSystemId, relatedFieldID, totalLevel);
                ltlItemsUrl.Text = $@"<a href=""{urlItems}"">管理字段项</a>";

                ltlEditUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalRelatedFieldAdd.GetOpenWindowString(
                        PublishmentSystemId, relatedFieldID)}"">编辑</a>";
                ltlExportUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToRelatedField(PublishmentSystemId, relatedFieldID)}"">导出</a>";
                ltlDeleteUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{PageUtils.GetRedirectStringWithConfirm(
                        PageUtils.GetCmsUrl(nameof(PageRelatedField), new NameValueCollection
                        {
                            {"PublishmentSystemID", PublishmentSystemId.ToString()},
                            {"RelatedFieldID", relatedFieldID.ToString()},
                            {"Delete", true.ToString()}
                        }), " 确认删除此联动字段吗? ")}" ">删除</a>";
            }
        }
Exemplo n.º 5
0
        private string GetButtonsHtml()
        {
            var builder = new StringBuilder();

            if (HasChannelPermissionsIgnoreChannelId(ConfigManager.ChannelPermissions.ChannelAdd))
            {
                builder.Append($@"
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{ModalChannelsAdd.GetOpenWindowString(SiteId, SiteId, GetRedirectUrl(SiteId, SiteId))}"">快速添加</a>
<a href=""{PageChannelAdd.GetRedirectUrl(SiteId, SiteId, GetRedirectUrl(SiteId, 0))}"" class=""btn btn-light text-secondary"">添加栏目</a>
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{ModalChannelImport.GetOpenWindowString(SiteId, SiteId)}"">导 入</a>
");
            }

            builder.Append($@"
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{ModalExportMessage.GetOpenWindowStringToChannel(SiteId, "ChannelIDCollection", "请选择需要导出的栏目!")}"">导 出</a>
");

            if (HasChannelPermissionsIgnoreChannelId(ConfigManager.ChannelPermissions.ChannelEdit))
            {
                builder.Append($@"
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{ModalAddToGroup.GetOpenWindowStringToChannel(SiteId)}"">设置栏目组</a>
");
            }

            if (HasChannelPermissionsIgnoreChannelId(ConfigManager.ChannelPermissions.ChannelTranslate))
            {
                builder.Append($@"
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{
                        PageUtils.GetRedirectStringWithCheckBoxValue(
                            PageChannelTranslate.GetRedirectUrl(SiteId,
                                GetRedirectUrl(SiteId, _currentChannelId)), "ChannelIDCollection",
                            "ChannelIDCollection", "请选择需要转移的栏目!")
                    }"">转 移</a>
");
            }

            if (HasChannelPermissionsIgnoreChannelId(ConfigManager.ChannelPermissions.ChannelDelete))
            {
                builder.Append($@"
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{
                        PageUtils.GetRedirectStringWithCheckBoxValue(
                            PageChannelDelete.GetRedirectUrl(SiteId, GetRedirectUrl(SiteId, SiteId)), "ChannelIDCollection",
                            "ChannelIDCollection", "请选择需要删除的栏目!")
                    }"">删 除</a>
");
            }

            if (HasSitePermissions(ConfigManager.WebSitePermissions.Create) ||
                HasChannelPermissionsIgnoreChannelId(ConfigManager.ChannelPermissions.CreatePage))
            {
                builder.Append($@"
<a href=""javascript:;"" class=""btn btn-light text-secondary"" onclick=""{ModalCreateChannels.GetOpenWindowString(SiteId)}"">生 成</a>
");
            }

            return(builder.ToString());
        }
Exemplo n.º 6
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            var channelId = AuthRequest.GetQueryInt("channelId", SiteId);

            _channelInfo       = ChannelManager.GetChannelInfo(SiteId, channelId);
            _tableName         = ChannelManager.GetTableName(SiteInfo, _channelInfo);
            _redirectUrl       = GetRedirectUrl(SiteId, channelId);
            _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(SiteId, channelId);

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Configration);

            //删除样式
            if (AuthRequest.IsQueryExists("DeleteStyle"))
            {
                var attributeName = AuthRequest.GetQueryString("AttributeName");
                if (TableStyleManager.IsExists(_channelInfo.Id, _tableName, attributeName))
                {
                    try
                    {
                        TableStyleManager.Delete(_channelInfo.Id, _tableName, attributeName);
                        AuthRequest.AddSiteLog(SiteId, "删除数据表单样式", $"表单:{_tableName},字段:{attributeName}");
                        SuccessDeleteMessage();
                    }
                    catch (Exception ex)
                    {
                        FailDeleteMessage(ex);
                    }
                }
            }

            InfoMessage(
                $"在此编辑内容模型字段,子栏目默认继承父栏目字段设置; 内容表:{DataProvider.TableDao.GetDisplayName(_tableName)}({_tableName})");
            ChannelManager.AddListItems(DdlChannelId.Items, SiteInfo, false, true, AuthRequest.AdminPermissions);
            ControlUtils.SelectSingleItem(DdlChannelId, channelId.ToString());

            RptContents.DataSource     = TableStyleManager.GetTableStyleInfoList(_tableName, _relatedIdentities);
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();

            BtnAddStyle.Attributes.Add("onclick", ModalTableStyleAdd.GetOpenWindowString(SiteId, 0, _relatedIdentities, _tableName, string.Empty, _redirectUrl));
            BtnAddStyles.Attributes.Add("onclick", ModalTableStylesAdd.GetOpenWindowString(SiteId, _relatedIdentities, _tableName, _redirectUrl));
            BtnImport.Attributes.Add("onclick", ModalTableStyleImport.GetOpenWindowString(_tableName, SiteId, channelId));
            BtnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToSingleTableStyle(_tableName, SiteId, channelId));
        }
Exemplo n.º 7
0
        private void ButtonPreLoad()
        {
            var showPopWinString = string.Empty;

            PlaceHolder_AddChannel.Visible = HasChannelPermissionsIgnoreNodeId(AppManager.Cms.Permission.Channel.ChannelAdd);
            if (PlaceHolder_AddChannel.Visible)
            {
                AddChannel1.Attributes.Add("onclick", ModalChannelAdd.GetOpenWindowString(PublishmentSystemId, PublishmentSystemId, GetRedirectUrl(PublishmentSystemId, PublishmentSystemId)));
                AddChannel2.Attributes.Add("onclick",
                                           $"location.href='{PageChannelAdd.GetRedirectUrl(PublishmentSystemId, PublishmentSystemId, GetRedirectUrl(PublishmentSystemId, 0))}';return false;");
            }

            PlaceHolder_ChannelEdit.Visible = HasChannelPermissionsIgnoreNodeId(AppManager.Cms.Permission.Channel.ChannelEdit);
            if (PlaceHolder_ChannelEdit.Visible)
            {
                showPopWinString = ModalAddToGroup.GetOpenWindowStringToChannel(PublishmentSystemId);
                AddToGroup.Attributes.Add("onclick", showPopWinString);

                SelectEditColumns.Attributes.Add("onclick", ModalSelectColumns.GetOpenWindowStringToChannel(PublishmentSystemId, false));
            }

            PlaceHolder_Translate.Visible = HasChannelPermissionsIgnoreNodeId(AppManager.Cms.Permission.Channel.ChannelTranslate);
            if (PlaceHolder_Translate.Visible)
            {
                Translate.Attributes.Add("onclick",
                                         PageUtils.GetRedirectStringWithCheckBoxValue(
                                             PageChannelTranslate.GetRedirectUrl(PublishmentSystemId,
                                                                                 GetRedirectUrl(PublishmentSystemId, _currentNodeId)), "ChannelIDCollection",
                                             "ChannelIDCollection", "请选择需要转移的栏目!"));
            }

            PlaceHolder_Delete.Visible = HasChannelPermissionsIgnoreNodeId(AppManager.Cms.Permission.Channel.ChannelDelete);
            if (PlaceHolder_Delete.Visible)
            {
                Delete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValue(PageChannelDelete.GetRedirectUrl(PublishmentSystemId, GetRedirectUrl(PublishmentSystemId, PublishmentSystemId)), "ChannelIDCollection", "ChannelIDCollection", "请选择需要删除的栏目!"));
            }

            PlaceHolder_Create.Visible = AdminUtility.HasWebsitePermissions(Body.AdministratorName, PublishmentSystemId, AppManager.Cms.Permission.WebSite.Create) ||
                                         HasChannelPermissionsIgnoreNodeId(AppManager.Cms.Permission.Channel.CreatePage);
            if (PlaceHolder_Create.Visible)
            {
                Create.Attributes.Add("onclick", ModalCreateChannels.GetOpenWindowString(PublishmentSystemId));
            }

            PlaceHolder_Import.Visible = PlaceHolder_AddChannel.Visible;
            if (PlaceHolder_Import.Visible)
            {
                Import.Attributes.Add("onclick", ModalChannelImport.GetOpenWindowString(PublishmentSystemId, PublishmentSystemId));
            }
            Export.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToChannel(PublishmentSystemId, "ChannelIDCollection", "请选择需要导出的栏目!"));
        }
Exemplo n.º 8
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var inputID   = SqlUtils.EvalInt(e.Item.DataItem, "InputID");
                var inputName = SqlUtils.EvalString(e.Item.DataItem, "InputName");

                var LtlTitle   = (Literal)e.Item.FindControl("LtlTitle");
                var upLink     = (Literal)e.Item.FindControl("UpLink");
                var downLink   = (Literal)e.Item.FindControl("DownLink");
                var styleUrl   = (Literal)e.Item.FindControl("StyleUrl");
                var previewUrl = (Literal)e.Item.FindControl("PreviewUrl");
                var editUrl    = (Literal)e.Item.FindControl("EditUrl");
                var exportUrl  = (Literal)e.Item.FindControl("ExportUrl");

                LtlTitle.Text = $@"<a href=""{PageInputContent.GetRedirectUrl(PublishmentSystemId, inputName)}"">{inputName}</a>";

                var urlUp = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "InputID", inputID.ToString() },
                    { "Up", true.ToString() }
                });
                upLink.Text = $@"<a href=""{urlUp}""><img src=""../Pic/icon/up.gif"" border=""0"" alt=""上升"" /></a>";

                var urlDown = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "InputID", inputID.ToString() },
                    { "Down", true.ToString() }
                });
                downLink.Text =
                    $@"<a href=""{urlDown}""><img src=""../Pic/icon/down.gif"" border=""0"" alt=""下降"" /></a>";

                styleUrl.Text =
                    $@"<a href=""{PageTableStyle.GetRedirectUrl(PublishmentSystemId, ETableStyle.InputContent,
                        DataProvider.InputContentDao.TableName, inputID)}"">表单字段</a>";

                previewUrl.Text = $@"<a href=""{PageInputPreview.GetRedirectUrl(PublishmentSystemId, inputID, string.Empty)}"">预览</a>";

                editUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalInputAdd.GetOpenWindowStringToEdit(
                        PublishmentSystemId, inputID, false)}"">编辑</a>";

                exportUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToInput(
                        PublishmentSystemId, inputID)}"">导出</a>";
            }
        }
Exemplo n.º 9
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            var nodeId = Body.GetQueryInt("NodeID", PublishmentSystemId);

            _nodeInfo    = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);
            _modelInfo   = ContentModelManager.GetContentModelInfo(PublishmentSystemInfo, _nodeInfo.ContentModelId);
            _tableStyle  = EAuxiliaryTableTypeUtils.GetTableStyle(_modelInfo.TableType);
            _redirectUrl = GetRedirectUrl(PublishmentSystemId, nodeId);

            _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, nodeId);

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, AppManager.Cms.LeftMenu.Configuration.IdConfigurationContentModel, "内容字段管理", AppManager.Cms.Permission.WebSite.Configration);

                //删除样式
                if (Body.IsQueryExists("DeleteStyle"))
                {
                    DeleteStyle();
                }
                else if (Body.IsQueryExists("SetTaxis"))
                {
                    SetTaxis();
                }

                InfoMessage(
                    $"在此编辑内容模型字段,子栏目默认继承父栏目字段设置; 辅助表:{BaiRongDataProvider.TableCollectionDao.GetTableCnName(_modelInfo.TableName)}({_modelInfo.TableName}); 内容模型:{_modelInfo.ModelName}");
                NodeManager.AddListItems(NodeIDDropDownList.Items, PublishmentSystemInfo, false, true, true, Body.AdministratorName);
                ControlUtils.SelectListItems(NodeIDDropDownList, nodeId.ToString());

                var styleInfoList = TableStyleManager.GetTableStyleInfoList(_tableStyle, _modelInfo.TableName, _relatedIdentities);

                dgContents.DataSource     = styleInfoList;
                dgContents.ItemDataBound += dgContents_ItemDataBound;
                dgContents.DataBind();

                AddStyle.Attributes.Add("onclick", ModalTableStyleAdd.GetOpenWindowString(PublishmentSystemId, 0, _relatedIdentities, _modelInfo.TableName, string.Empty, _tableStyle, _redirectUrl));
                AddStyles.Attributes.Add("onclick", ModalTableStylesAdd.GetOpenWindowString(PublishmentSystemId, _relatedIdentities, _modelInfo.TableName, _tableStyle, _redirectUrl));
                Import.Attributes.Add("onclick", ModalTableStyleImport.GetOpenWindowString(_modelInfo.TableName, _tableStyle, PublishmentSystemId, nodeId));
                Export.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToSingleTableStyle(_tableStyle, _modelInfo.TableName, PublishmentSystemId, nodeId));
            }
        }
Exemplo n.º 10
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdTracking, "24小时统计", AppManager.Cms.Permission.WebSite.Tracking);

                var trackingHourHashtable       = DataProvider.TrackingDao.GetTrackingHourHashtable(PublishmentSystemId);
                var uniqueTrackingHourHashtable = DataProvider.TrackingDao.GetUniqueTrackingHourHashtable(PublishmentSystemId);
                var now = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0);
                for (var i = 0; i < 24; i++)
                {
                    var datetime  = now.AddHours(-i);
                    var accessNum = 0;
                    if (trackingHourHashtable[datetime] != null)
                    {
                        accessNum = (int)trackingHourHashtable[datetime];
                    }
                    accessNumHashtable.Add(24 - i, accessNum);
                    if (accessNum > maxAccessNum)
                    {
                        maxAccessNum = accessNum;
                    }

                    var uniqueAccessNum = 0;
                    if (uniqueTrackingHourHashtable[datetime] != null)
                    {
                        uniqueAccessNum = (int)uniqueTrackingHourHashtable[datetime];
                    }
                    uniqueAccessNumHashtable.Add(24 - i, uniqueAccessNum);
                    if (uniqueAccessNum > uniqueMaxAccessNum)
                    {
                        uniqueMaxAccessNum = uniqueAccessNum;
                    }
                }


                ExportTracking.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToExport(PublishmentSystemId, ModalExportMessage.ExportTypeTrackerHour));
            }
        }
Exemplo n.º 11
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _tableName = DataProvider.NodeDao.TableName;
            var nodeId = Body.GetQueryInt("NodeID", PublishmentSystemId);

            _nodeInfo    = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);
            _redirectUrl = GetRedirectUrl(PublishmentSystemId, nodeId);

            _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, nodeId);

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, AppManager.Cms.LeftMenu.Configuration.IdConfigurationContentModel, "栏目字段管理", AppManager.Cms.Permission.WebSite.Configration);

                //删除样式
                if (Body.IsQueryExists("DeleteStyle"))
                {
                    DeleteStyle();
                }
                else if (Body.IsQueryExists("SetTaxis"))
                {
                    SetTaxis();
                }

                NodeManager.AddListItems(DdlNodeIdDropDownList.Items, PublishmentSystemInfo, false, true, true, Body.AdministratorName);
                ControlUtils.SelectListItems(DdlNodeIdDropDownList, nodeId.ToString());

                var styleInfoList = TableStyleManager.GetTableStyleInfoList(ETableStyle.Channel, _tableName, _relatedIdentities);

                DgContents.DataSource     = styleInfoList;
                DgContents.ItemDataBound += DgContents_ItemDataBound;
                DgContents.DataBind();

                BtnAddStyle.Attributes.Add("onclick", ModalTableStyleAdd.GetOpenWindowString(PublishmentSystemId, 0, _relatedIdentities, _tableName, string.Empty, ETableStyle.Channel, _redirectUrl));
                BtnAddStyles.Attributes.Add("onclick", ModalTableStylesAdd.GetOpenWindowString(PublishmentSystemId, _relatedIdentities, _tableName, ETableStyle.Channel, _redirectUrl));
                BtnImport.Attributes.Add("onclick", ModalTableStyleImport.GetOpenWindowString(_tableName, ETableStyle.Channel, PublishmentSystemId, nodeId));
                BtnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToSingleTableStyle(ETableStyle.Channel, _tableName, PublishmentSystemId, nodeId));
            }
        }
Exemplo n.º 12
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var styleID     = SqlUtils.EvalInt(e.Item.DataItem, "StyleID");
                var styleName   = SqlUtils.EvalString(e.Item.DataItem, "StyleName");
                var settingsXML = SqlUtils.EvalString(e.Item.DataItem, "SettingsXML");

                var ltlStyleName   = (Literal)e.Item.FindControl("ltlStyleName");
                var ltlTemplateUrl = (Literal)e.Item.FindControl("ltlTemplateUrl");
                var ltlPreviewUrl  = (Literal)e.Item.FindControl("ltlPreviewUrl");
                var ltlEditUrl     = (Literal)e.Item.FindControl("ltlEditUrl");
                var ltlExportUrl   = (Literal)e.Item.FindControl("ltlExportUrl");
                var ltlDeleteUrl   = (Literal)e.Item.FindControl("ltlDeleteUrl");

                ltlStyleName.Text = styleName;

                var returnUrl = GetRedirectUrl(PublishmentSystemId, _elementName);

                ltlTemplateUrl.Text = $@"<a href=""{PageTagStyleTemplate.GetRedirectUrl(PublishmentSystemId, styleID, returnUrl)}"">自定义模板</a>";

                ltlPreviewUrl.Text = $@"<a href=""{PageTagStylePreview.GetRedirectUrl(PublishmentSystemId, styleID, returnUrl)}"">预览</a>";

                ltlEditUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{TextUtility.GetTagStyleOpenWindowStringToEdit(_elementName,
                        PublishmentSystemId, styleID)}"">编辑</a>";

                ltlExportUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToTagStyle(
                        PublishmentSystemId, styleID)}"">导出</a>";

                var deleteUrl = PageUtils.GetCmsUrl(nameof(PageTagStyle), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "elementName", _elementName },
                    { "Delete", true.ToString() },
                    { "StyleID", styleID.ToString() }
                });
                ltlDeleteUrl.Text =
                    $@"<a href=""{deleteUrl}"" onClick=""javascript:return confirm('此操作将删除样式“{styleName}”,确认吗?');"">删除</a>";
            }
        }
Exemplo n.º 13
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var displayAttributes = ControlUtils.GetSelectedListControlValueCollection(cblDisplayAttributes);

            if (phDisplayAttributes.Visible && string.IsNullOrEmpty(displayAttributes))
            {
                FailMessage("必须至少选择一项!");
                return;
            }

            ConfigSettings(false);

            var isPeriods = false;
            var startDate = string.Empty;
            var endDate   = string.Empty;

            if (ddlPeriods.SelectedValue != "0")
            {
                isPeriods = true;
                if (ddlPeriods.SelectedValue == "-1")
                {
                    startDate = tbStartDate.Text;
                    endDate   = tbEndDate.Text;
                }
                else
                {
                    var days = int.Parse(ddlPeriods.SelectedValue);
                    startDate = DateUtils.GetDateString(DateTime.Now.AddDays(-days));
                    endDate   = DateUtils.GetDateString(DateTime.Now);
                }
            }
            var checkedState = ETriStateUtils.GetEnumType(ddlPeriods.SelectedValue);
            var redirectUrl  = ModalExportMessage.GetRedirectUrlStringToExportContent(PublishmentSystemId, _nodeId, rblExportType.SelectedValue, Body.GetQueryString("ContentIDCollection"), displayAttributes, isPeriods, startDate, endDate, checkedState);

            PageUtils.Redirect(redirectUrl);
        }
Exemplo n.º 14
0
        public void ExportAndDelete_Click(object sender, EventArgs e)
        {
            var redirectUrl = ModalExportMessage.GetRedirectUrlStringToExportTracker(_startDateString, _endDateString, PublishmentSystemId, _nodeId, _contentId, _totalNum, true);

            PageUtils.Redirect(redirectUrl);
        }
Exemplo n.º 15
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID", "InputName");
            var theInputName = Body.GetQueryString("InputName");

            _inputInfo = DataProvider.InputDao.GetInputInfo(theInputName, PublishmentSystemId);
            if (_inputInfo == null)
            {
                return;
            }

            if (Body.IsQueryExists("Delete") && Body.IsQueryExists("ContentIDCollection"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("ContentIDCollection"));
                try
                {
                    DataProvider.InputContentDao.Delete(arraylist);
                    Body.AddSiteLog(PublishmentSystemId, "删除提交表单内容", $"提交表单:{_inputInfo.InputName}");
                    SuccessMessage("删除成功!");
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "删除失败!");
                }
            }

            _relatedIdentities = RelatedIdentities.GetRelatedIdentities(ETableStyle.InputContent, PublishmentSystemId, _inputInfo.InputId);

            _styleInfoList = TableStyleManager.GetTableStyleInfoList(ETableStyle.InputContent, DataProvider.InputContentDao.TableName, _relatedIdentities);

            var isAnythingVisible = false;

            foreach (var styleInfo in _styleInfoList)
            {
                if (styleInfo.IsVisibleInList)
                {
                    isAnythingVisible = true;
                    break;
                }
            }
            if (!isAnythingVisible && _styleInfoList != null && _styleInfoList.Count > 0)
            {
                _styleInfoList[0].IsVisibleInList = true;
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = PublishmentSystemInfo.Additional.PageSize;
            spContents.SelectCommand     = DataProvider.InputContentDao.GetSelectStringOfContentId(_inputInfo.InputId, string.Empty);
            spContents.SortField         = DataProvider.InputContentDao.GetSortFieldName();
            spContents.SortMode          = SortMode.DESC;
            rptContents.ItemDataBound   += rptContents_ItemDataBound;

            if (!IsPostBack)
            {
                spContents.DataBind();

                BreadCrumbWithItemTitle(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdInput, "提交表单内容管理",
                                        $"{_inputInfo.InputName}({spContents.TotalCount})", AppManager.Cms.Permission.WebSite.Input);

                var showPopWinString = string.Empty;

                showPopWinString = ModalInputContentAdd.GetOpenWindowStringToAdd(PublishmentSystemId, _inputInfo.InputId, PageUrl);
                AddButton.Attributes.Add("onclick", showPopWinString);


                //this.Delete.Attributes.Add("onclick", "return confirm(\"此操作将删除所选内容,确定吗?\");");
                Delete.Attributes.Add("onclick",
                                      PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(
                                          PageUtils.GetCmsUrl(nameof(PageInputContent), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "InputName", _inputInfo.InputName },
                    { "Delete", true.ToString() }
                }), "ContentIDCollection", "ContentIDCollection", "请选择需要删除的表单内容!", "此操作将删除所选内容,确定删除吗?"));

                Check.Attributes.Add("onclick", "return confirm(\"此操作将把所选内容设为审核通过,确定吗?\");");


                showPopWinString = ModalInputContentTaxis.GetOpenWindowString(PublishmentSystemId, _inputInfo.InputId, PageUrl);
                TaxisButton.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectColumns.GetOpenWindowStringToInputContent(PublishmentSystemId, _inputInfo.InputId, true);
                SelectListButton.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectColumns.GetOpenWindowStringToInputContent(PublishmentSystemId, _inputInfo.InputId, false);
                SelectFormButton.Attributes.Add("onclick", showPopWinString);

                ImportExcel.Attributes.Add("onclick", ModalInputContentImport.GetOpenWindowString(PublishmentSystemId, _inputInfo.InputId));

                ExportExcel.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToInputContent(PublishmentSystemId, _inputInfo.InputId));

                var urlReturn = PageInput.GetRedirectUrl(PublishmentSystemId);
                btnReturn.Attributes.Add("onclick", $"location.href='{urlReturn}';return false;");


                if (_styleInfoList != null)
                {
                    foreach (var styleInfo in _styleInfoList)
                    {
                        if (styleInfo.IsVisibleInList)
                        {
                            ltlColumnHeadRows.Text += $@"<td class=""center"">{styleInfo.DisplayName}</td>";
                        }
                    }
                }

                if (_inputInfo.IsReply)
                {
                    ltlHeadRowReply.Text = @"
<td class=""center"" style=""width:60px;"">是否回复</td>
<td class=""center"" style=""width:60px;"">&nbsp;</td>
";
                }
            }
        }
Exemplo n.º 16
0
        private void DgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var inputId   = SqlUtils.EvalInt(e.Item.DataItem, "InputID");
            var inputName = SqlUtils.EvalString(e.Item.DataItem, "InputName");
            var isChecked = SqlUtils.EvalBool(e.Item.DataItem, "IsChecked");
            var isIsReply = SqlUtils.EvalBool(e.Item.DataItem, "IsReply");

            var ltlTitle      = (Literal)e.Item.FindControl("ltlTitle");
            var ltlIsCheck    = (Literal)e.Item.FindControl("ltlIsCheck");
            var ltlIsReply    = (Literal)e.Item.FindControl("ltlIsReply");
            var ltlUpLink     = (Literal)e.Item.FindControl("ltlUpLink");
            var ltlDownLink   = (Literal)e.Item.FindControl("ltlDownLink");
            var ltlStyleUrl   = (Literal)e.Item.FindControl("ltlStyleUrl");
            var ltlPreviewUrl = (Literal)e.Item.FindControl("ltlPreviewUrl");
            var ltlEditUrl    = (Literal)e.Item.FindControl("ltlEditUrl");
            var ltlExportUrl  = (Literal)e.Item.FindControl("ltlExportUrl");
            var ltlDeleteUrl  = (Literal)e.Item.FindControl("ltlDeleteUrl");

            ltlTitle.Text   = $@"<a href=""{PageInputContent.GetRedirectUrl(PublishmentSystemId, inputName)}"">{inputName}</a>";
            ltlIsCheck.Text = StringUtils.GetTrueImageHtml(!isChecked);
            ltlIsReply.Text = StringUtils.GetTrueImageHtml(isIsReply);

            var urlUp = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() },
                { "InputID", inputId.ToString() },
                { "Up", true.ToString() }
            });

            ltlUpLink.Text = $@"<a href=""{urlUp}""><img src=""../Pic/icon/up.gif"" border=""0"" alt=""上升"" /></a>";

            var urlDown = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() },
                { "InputID", inputId.ToString() },
                { "Down", true.ToString() }
            });

            ltlDownLink.Text =
                $@"<a href=""{urlDown}""><img src=""../Pic/icon/down.gif"" border=""0"" alt=""下降"" /></a>";

            ltlStyleUrl.Text =
                $@"<a href=""{PageTableStyle.GetRedirectUrl(PublishmentSystemId, ETableStyle.InputContent,
                    DataProvider.InputContentDao.TableName, inputId)}"">表单字段</a>";

            ltlPreviewUrl.Text = $@"<a href=""{PageInputPreview.GetRedirectUrl(PublishmentSystemId, inputId, string.Empty)}"">预览</a>";

            ltlEditUrl.Text =
                $@"<a href=""javascript:;"" onclick=""{ModalInputAdd.GetOpenWindowStringToEdit(
                    PublishmentSystemId, inputId, false)}"">编辑</a>";

            ltlExportUrl.Text =
                $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToInput(
                    PublishmentSystemId, inputId)}"">导出</a>";

            var urlDelete = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() },
                { "InputID", inputId.ToString() },
                { "Delete", true.ToString() }
            });

            ltlDeleteUrl.Text = $@"<a href=""{urlDelete}"" onClick=""javascript:return confirm('此操作将删除提交表单“{inputName}”及相关数据,确认吗?');"">删除</a> </ItemTemplate>";
        }
Exemplo n.º 17
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("Delete"))
            {
                var gatherRuleName = Body.GetQueryString("GatherRuleName");
                try
                {
                    DataProvider.GatherRuleDao.Delete(gatherRuleName, PublishmentSystemId);
                    Body.AddSiteLog(PublishmentSystemId, "删除Web页面采集规则", $"采集规则:{gatherRuleName}");
                    SuccessDeleteMessage();
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }

            if (Body.IsQueryExists("Copy"))
            {
                var gatherRuleName = Body.GetQueryString("GatherRuleName");
                try
                {
                    var gatherRuleInfo = DataProvider.GatherRuleDao.GetGatherRuleInfo(gatherRuleName, PublishmentSystemId);
                    gatherRuleInfo.GatherRuleName = gatherRuleInfo.GatherRuleName + "_复件";
                    gatherRuleInfo.LastGatherDate = DateUtils.SqlMinValue;

                    DataProvider.GatherRuleDao.Insert(gatherRuleInfo);
                    Body.AddSiteLog(PublishmentSystemId, "复制Web页面采集规则", $"采集规则:{gatherRuleName}");
                    SuccessMessage("采集规则复制成功!");
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "采集规则复制失败!");
                }
            }

            if (Body.IsQueryExists("Auto") && Body.IsQueryExists("GatherRuleNameCollection"))
            {
                var gatherRuleNameCollection = TranslateUtils.StringCollectionToStringList(Body.GetQueryString("GatherRuleNameCollection"));
                try
                {
                    foreach (string item in gatherRuleNameCollection)
                    {
                        var gatherRuleInfoTmp = DataProvider.GatherRuleDao.GetGatherRuleInfo(item, PublishmentSystemId);
                        gatherRuleInfoTmp.Additional.IsAutoCreate = true;
                        DataProvider.GatherRuleDao.Update(gatherRuleInfoTmp);
                    }

                    Body.AddSiteLog(PublishmentSystemId, "开启采集规则自动生成成功", $"采集规则:{gatherRuleNameCollection}");
                    SuccessMessage("开启采集规则自动生成成功!");
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "开启采集规则自动生成失败!");
                }
            }

            if (Body.IsQueryExists("NoAuto") && Body.IsQueryExists("GatherRuleNameCollection"))
            {
                var gatherRuleNameCollection = TranslateUtils.StringCollectionToStringList(Body.GetQueryString("GatherRuleNameCollection"));
                try
                {
                    foreach (string item in gatherRuleNameCollection)
                    {
                        var gatherRuleInfoTmp = DataProvider.GatherRuleDao.GetGatherRuleInfo(item, PublishmentSystemId);
                        gatherRuleInfoTmp.Additional.IsAutoCreate = false;
                        DataProvider.GatherRuleDao.Update(gatherRuleInfoTmp);
                    }
                    Body.AddSiteLog(PublishmentSystemId, "关闭采集规则自动生成成功", $"采集规则:{gatherRuleNameCollection}");
                    SuccessMessage("关闭采集规则自动生成成功!");
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "关闭采集规则自动生成失败!");
                }
            }

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdGather, "Web页面信息采集", AppManager.Cms.Permission.WebSite.Gather);

                var showPopWinString = ModalProgressBar.GetOpenWindowStringWithGather(PublishmentSystemId);
                Start.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalExportMessage.GetOpenWindowStringToGatherRule(PublishmentSystemId, "GatherRuleNameCollection", "请选择需要导出的规则!");
                Export.Attributes.Add("onclick", showPopWinString);

                dgContents.DataSource     = DataProvider.GatherRuleDao.GetGatherRuleInfoArrayList(PublishmentSystemId);
                dgContents.ItemDataBound += dgContents_ItemDataBound;
                dgContents.DataBind();
            }
        }
Exemplo n.º 18
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (Body.IsQueryExists("channelId") && (Body.IsQueryExists("Subtract") || Body.IsQueryExists("Add")))
            {
                var channelId = Body.GetQueryInt("channelId");
                if (SiteId != channelId)
                {
                    var isSubtract = Body.IsQueryExists("Subtract");
                    DataProvider.ChannelDao.UpdateTaxis(SiteId, channelId, isSubtract);

                    Body.AddSiteLog(SiteId, channelId, 0, "栏目排序" + (isSubtract ? "上升" : "下降"),
                                    $"栏目:{ChannelManager.GetChannelName(SiteId, channelId)}");

                    PageUtils.Redirect(GetRedirectUrl(SiteId, channelId));
                    return;
                }
            }

            if (IsPostBack)
            {
                return;
            }

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, ELoadingType.Channel, null));

            if (Body.IsQueryExists("CurrentChannelId"))
            {
                _currentChannelId = Body.GetQueryInt("CurrentChannelId");
                var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId);
                if (!string.IsNullOrEmpty(onLoadScript))
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                }
            }

            PhAddChannel.Visible = HasChannelPermissionsIgnoreChannelId(ConfigManager.Permissions.Channel.ChannelAdd);
            if (PhAddChannel.Visible)
            {
                BtnAddChannel1.Attributes.Add("onclick", ModalChannelsAdd.GetOpenWindowString(SiteId, SiteId, GetRedirectUrl(SiteId, SiteId)));
                BtnAddChannel2.Attributes.Add("onclick",
                                              $"location.href='{PageChannelAdd.GetRedirectUrl(SiteId, SiteId, GetRedirectUrl(SiteId, 0))}';return false;");
            }

            PhChannelEdit.Visible = HasChannelPermissionsIgnoreChannelId(ConfigManager.Permissions.Channel.ChannelEdit);
            if (PhChannelEdit.Visible)
            {
                var showPopWinString = ModalAddToGroup.GetOpenWindowStringToChannel(SiteId);
                BtnAddToGroup.Attributes.Add("onclick", showPopWinString);

                BtnSelectEditColumns.Attributes.Add("onclick", ModalSelectColumns.GetOpenWindowStringToChannel(SiteId, false));
            }

            PhTranslate.Visible = HasChannelPermissionsIgnoreChannelId(ConfigManager.Permissions.Channel.ChannelTranslate);
            if (PhTranslate.Visible)
            {
                BtnTranslate.Attributes.Add("onclick",
                                            PageUtils.GetRedirectStringWithCheckBoxValue(
                                                PageChannelTranslate.GetRedirectUrl(SiteId,
                                                                                    GetRedirectUrl(SiteId, _currentChannelId)), "ChannelIDCollection",
                                                "ChannelIDCollection", "请选择需要转移的栏目!"));
            }

            PhDelete.Visible = HasChannelPermissionsIgnoreChannelId(ConfigManager.Permissions.Channel.ChannelDelete);
            if (PhDelete.Visible)
            {
                BtnDelete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValue(PageChannelDelete.GetRedirectUrl(SiteId, GetRedirectUrl(SiteId, SiteId)), "ChannelIDCollection", "ChannelIDCollection", "请选择需要删除的栏目!"));
            }

            PhCreate.Visible = HasSitePermissions(ConfigManager.Permissions.WebSite.Create) || HasChannelPermissionsIgnoreChannelId(ConfigManager.Permissions.Channel.CreatePage);
            if (PhCreate.Visible)
            {
                BtnCreate.Attributes.Add("onclick", ModalCreateChannels.GetOpenWindowString(SiteId));
            }

            PhImport.Visible = PhAddChannel.Visible;
            if (PhImport.Visible)
            {
                BtnImport.Attributes.Add("onclick", ModalChannelImport.GetOpenWindowString(SiteId, SiteId));
            }
            BtnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToChannel(SiteId, "ChannelIDCollection", "请选择需要导出的栏目!"));

            RptContents.DataSource     = DataProvider.ChannelDao.GetIdListByParentId(SiteId, 0);
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();
        }
Exemplo n.º 19
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _relatedIdentity   = string.IsNullOrEmpty(Body.GetQueryString("RelatedIdentity")) ? PublishmentSystemId : Body.GetQueryInt("RelatedIdentity");
            _tableStyle        = ETableStyleUtils.GetEnumType(Body.GetQueryString("TableStyle"));
            _tableName         = Body.GetQueryString("TableName");
            _itemId            = Body.GetQueryInt("itemID");
            _relatedIdentities = RelatedIdentities.GetRelatedIdentities(_tableStyle, PublishmentSystemId, _relatedIdentity);
            _attributeNames    = TableManager.GetAttributeNameList(_tableStyle, _tableName);

            if (IsPostBack)
            {
                return;
            }

            if (_tableStyle == ETableStyle.InputContent)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdInput, "提交表单管理", AppManager.Cms.Permission.WebSite.Input);
            }
            else if (_tableStyle == ETableStyle.Site)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, "站点属性设置",
                           AppManager.Cms.Permission.WebSite.Configration);
            }
            else
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, AppManager.Cms.LeftMenu.Configuration.IdConfigurationContentModel, "虚拟字段管理",
                           AppManager.Cms.Permission.WebSite.Configration);
            }

            //删除样式
            if (Body.IsQueryExists("DeleteStyle"))
            {
                DeleteStyle();
            }
            else if (Body.IsQueryExists("SetTaxis"))
            {
                SetTaxis();
            }

            if (_tableStyle == ETableStyle.BackgroundContent)
            {
                var urlModel = PageContentModel.GetRedirectUrl(PublishmentSystemId);
                btnReturn.Attributes.Add("onclick", $"location.href='{urlModel}';return false;");
            }
            else if (_tableStyle == ETableStyle.InputContent)
            {
                btnReturn.Attributes.Add("onclick", $"location.href='{PageInput.GetRedirectUrl(PublishmentSystemId)}';return false;");
            }
            else if (_tableStyle == ETableStyle.GovInteractContent)
            {
                var urlReturn = PageGovInteractListAll.GetRedirectUrl(PublishmentSystemId, 0);
                btnReturn.Attributes.Add("onclick", $"location.href='{urlReturn}';return false;");
            }
            else if (_tableStyle == ETableStyle.Site)
            {
                btnReturn.Attributes.Add("onclick", $"location.href='{PageConfigurationSiteAttributes.GetRedirectUrl(PublishmentSystemId)}';return false;");
            }
            else
            {
                btnReturn.Visible = false;
            }

            var styleInfoList = TableStyleManager.GetTableStyleInfoList(_tableStyle, _tableName, _relatedIdentities);

            dgContents.DataSource     = styleInfoList;
            dgContents.ItemDataBound += dgContents_ItemDataBound;
            dgContents.DataBind();

            var redirectUrl = GetRedirectUrl(PublishmentSystemId, _tableStyle, _tableName, _relatedIdentity, _itemId);

            btnAddStyle.Attributes.Add("onclick", ModalTableStyleAdd.GetOpenWindowString(PublishmentSystemId, 0, _relatedIdentities, _tableName, string.Empty, _tableStyle, redirectUrl));
            btnAddStyles.Attributes.Add("onclick", ModalTableStylesAdd.GetOpenWindowString(PublishmentSystemId, _relatedIdentities, _tableName, _tableStyle, redirectUrl));

            btnImport.Attributes.Add("onclick", ModalTableStyleImport.GetOpenWindowString(_tableName, _tableStyle, PublishmentSystemId, _relatedIdentity));
            btnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToSingleTableStyle(_tableStyle, _tableName, PublishmentSystemId, _relatedIdentity));
        }