public void Main(int siteId) { var request = new AuthRequest(); var callback = request.GetQueryString("callback"); var relatedFieldId = request.GetQueryInt("relatedFieldId"); var parentId = request.GetQueryInt("parentId"); var jsonString = GetRelatedField(relatedFieldId, parentId); var call = callback + "(" + jsonString + ")"; HttpContext.Current.Response.Write(call); HttpContext.Current.Response.End(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (AuthRequest.IsQueryExists("SiteId") && (AuthRequest.IsQueryExists("Up") || AuthRequest.IsQueryExists("Down"))) { var siteId = AuthRequest.GetQueryInt("SiteId"); if (AuthRequest.IsQueryExists("Up") && AuthRequest.GetQueryBool("Up")) { DataProvider.SiteDao.UpdateTaxisToUp(siteId); } else { DataProvider.SiteDao.UpdateTaxisToDown(siteId); } } if (IsPostBack) { return; } VerifyAdministratorPermissions(ConfigManager.SettingsPermissions.Site); _hqSiteId = DataProvider.SiteDao.GetIdByIsRoot(); RptContents.DataSource = SiteManager.GetSiteIdList(); RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); }
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)); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (IsPostBack) { return; } VerifyAdministratorPermissions(ConfigManager.SettingsPermissions.Utility); if (AuthRequest.IsQueryExists("delete") && AuthRequest.IsQueryExists("id")) { DataProvider.AccessTokenDao.Delete(AuthRequest.GetQueryInt("id")); AuthRequest.AddAdminLog("删除API密钥"); SuccessMessage("API密钥删除成功!"); } RptContents.DataSource = DataProvider.AccessTokenDao.GetAccessTokenInfoList(); RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.WebSitePermissions.Configration); ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ConfigurationCrossSiteTrans, null)); if (AuthRequest.IsQueryExists("CurrentChannelId")) { _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId"); var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId); if (!string.IsNullOrEmpty(onLoadScript)) { ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript); } } EBooleanUtils.AddListItems(RblIsCrossSiteTransChecked, "无需审核", "需要审核"); ControlUtils.SelectSingleItem(RblIsCrossSiteTransChecked, SiteInfo.Additional.IsCrossSiteTransChecked.ToString()); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _keywordId = AuthRequest.GetQueryInt("KeywordID"); if (IsPostBack) { return; } EKeywordGradeUtils.AddListItems(DdlGrade); if (_keywordId <= 0) { return; } var keywordInfo = DataProvider.KeywordDao.GetKeywordInfo(_keywordId); TbKeyword.Text = keywordInfo.Keyword; TbAlternative.Text = keywordInfo.Alternative; ControlUtils.SelectSingleItem(DdlGrade, EKeywordGradeUtils.GetValue(keywordInfo.Grade)); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (AuthRequest.IsQueryExists("Delete")) { var relatedFieldId = AuthRequest.GetQueryInt("RelatedFieldID"); var relatedFieldName = DataProvider.RelatedFieldDao.GetTitle(relatedFieldId); DataProvider.RelatedFieldDao.Delete(relatedFieldId); AuthRequest.AddSiteLog(SiteId, "删除联动字段", $"联动字段:{relatedFieldName}"); SuccessDeleteMessage(); } if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.SitePermissions.ConfigTableStyles); RptContents.DataSource = DataProvider.RelatedFieldDao.GetRelatedFieldInfoList(SiteId); RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); BtnAdd.Attributes.Add("onclick", ModalRelatedFieldAdd.GetOpenWindowString(SiteId)); BtnImport.Attributes.Add("onclick", ModalImport.GetOpenWindowString(SiteId, ModalImport.TypeRelatedField)); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); if (!IsPostBack) { VerifySitePermissions(ConfigManager.WebSitePermissions.Create); ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ConfigurationCreateDetails, null)); if (AuthRequest.IsQueryExists("CurrentChannelId")) { _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId"); var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId); if (!string.IsNullOrEmpty(onLoadScript)) { ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript); } } BindGrid(); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _channelId = AuthRequest.GetQueryInt("channelId"); _isChannel = AuthRequest.GetQueryBool("IsChannel"); _textBoxClientId = AuthRequest.GetQueryString("TextBoxClientID"); if (IsPostBack) { return; } LtlRules.Text = GetRulesString(); if (!string.IsNullOrEmpty(_textBoxClientId)) { TbRule.Text = AuthRequest.GetQueryString(_textBoxClientId); } InfoMessage(_isChannel ? "系统生成栏目页时采取的文件名规则,建议保留{@ChannelId}栏目Id项,否则可能出现重复的文件名称" : "系统生成内容页时采取的文件名规则,建议保留{@ContentId}内容Id项,否则可能出现重复的文件名称"); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _id = AuthRequest.GetQueryInt("id"); if (IsPostBack) { return; } VerifyAdministratorPermissions(ConfigManager.SettingsPermissions.Utility); LtlPageTitle.Text = _id > 0 ? "修改API密钥" : "新增API密钥"; foreach (var scope in AccessTokenManager.ScopeList) { CblScopes.Items.Add(new ListItem(scope, scope)); } if (_id > 0) { var tokenInfo = DataProvider.AccessTokenDao.GetAccessTokenInfo(_id); TbTitle.Text = tokenInfo.Title; var scopes = TranslateUtils.StringCollectionToStringList(tokenInfo.Scopes); ControlUtils.SelectMultiItemsIgnoreCase(CblScopes, scopes); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId", "channelId", "contentID", "returnUrl"); _channelId = AuthRequest.GetQueryInt("channelId"); _tableName = ChannelManager.GetTableName(SiteInfo, _channelId); _contentId = AuthRequest.GetQueryInt("contentID"); _returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("returnUrl")); var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelId, _contentId); int checkedLevel; var isChecked = CheckManager.GetUserCheckLevel(AuthRequest.AdminPermissionsImpl, SiteInfo, SiteId, out checkedLevel); BtnCheck.Visible = CheckManager.IsCheckable(contentInfo.IsChecked, contentInfo.CheckedLevel, isChecked, checkedLevel); LtlTitle.Text = contentInfo.Title; LtlState.Text = CheckManager.GetCheckState(SiteInfo, contentInfo); var checkInfoList = DataProvider.ContentCheckDao.GetCheckInfoList(_tableName, _contentId); if (checkInfoList.Count > 0) { PhCheckReasons.Visible = true; RptContents.DataSource = checkInfoList; RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); var specialId = AuthRequest.GetQueryInt("specialId"); if (specialId > 0) { _specialInfo = SpecialManager.GetSpecialInfo(SiteId, specialId); } if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.WebSitePermissions.Template); if (_specialInfo != null) { TbTitle.Text = _specialInfo.Title; TbUrl.Text = _specialInfo.Url; PhUpload.Visible = false; } else { TbUrl.Text = $"@/special/{DateTime.Now:yyyy/MM/dd}/"; } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.SitePermissions.ConfigCrossSiteTrans); ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ConfigurationCrossSiteTrans, null)); if (AuthRequest.IsQueryExists("CurrentChannelId")) { _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId"); var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId); if (!string.IsNullOrEmpty(onLoadScript)) { ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript); } } var channelIdList = ChannelManager.GetChannelIdList(ChannelManager.GetChannelInfo(SiteId, SiteId), EScopeType.SelfAndChildren, string.Empty, string.Empty, string.Empty); RptContents.DataSource = channelIdList; RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("TableName"); _tableName = AuthRequest.GetQueryString("TableName"); if (IsPostBack) { return; } DataTypeUtils.AddListItems(DdlDataType); if (AuthRequest.IsQueryExists("TableMetadataID")) { var tableMetadataId = AuthRequest.GetQueryInt("TableMetadataID"); var info = DataProvider.TableMetadataDao.GetTableMetadataInfo(tableMetadataId); if (info != null) { TbAttributeName.Text = info.AttributeName; TbAttributeName.Enabled = false; ControlUtils.SelectSingleItemIgnoreCase(DdlDataType, info.DataType.ToString()); TbDataLength.Text = info.DataLength.ToString(); } } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _isProtocol = AuthRequest.GetQueryBool("isProtocol"); _jsMethod = AuthRequest.GetQueryString("jsMethod"); _itemIndex = AuthRequest.GetQueryInt("itemIndex"); _additional.Add("isProtocol", _isProtocol.ToString()); _additional.Add("jsMethod", _jsMethod); _additional.Add("itemIndex", _itemIndex.ToString()); if (!IsPostBack) { if (AuthRequest.IsQueryExists("channelId")) { var channelId = AuthRequest.GetQueryInt("channelId"); var nodeNames = ChannelManager.GetChannelNameNavigation(SiteId, channelId); if (!string.IsNullOrEmpty(_jsMethod)) { string scripts = $"window.parent.{_jsMethod}({_itemIndex}, '{nodeNames}', {channelId});"; LayerUtils.CloseWithoutRefresh(Page, scripts); } else { var pageUrl = PageUtility.GetChannelUrl(SiteInfo, ChannelManager.GetChannelInfo(SiteId, channelId), false); if (_isProtocol) { pageUrl = PageUtils.AddProtocolToUrl(pageUrl); } string scripts = $"window.parent.selectChannel('{nodeNames}', '{channelId}', '{pageUrl}');"; LayerUtils.CloseWithoutRefresh(Page, scripts); } } else { var nodeInfo = ChannelManager.GetChannelInfo(SiteId, SiteId); var linkUrl = PageUtils.GetCmsUrl(SiteId, nameof(ModalChannelSelect), new NameValueCollection { { "channelId", nodeInfo.Id.ToString() }, { "isProtocol", _isProtocol.ToString() }, { "jsMethod", _jsMethod }, { "itemIndex", _itemIndex.ToString() } }); LtlSite.Text = $"<a href='{linkUrl}'>{nodeInfo.ChannelName}</a>"; ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ChannelSelect, null)); BindGrid(); } } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (AuthRequest.IsQueryExists("Delete") && AuthRequest.IsQueryExists("AreaIDCollection")) { var areaIdArrayList = TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("AreaIDCollection")); foreach (var areaId in areaIdArrayList) { DataProvider.AreaDao.Delete(areaId); } SuccessMessage("成功删除所选区域"); } else if (AuthRequest.IsQueryExists("AreaID") && (AuthRequest.IsQueryExists("Subtract") || AuthRequest.IsQueryExists("Add"))) { var areaId = int.Parse(AuthRequest.GetQueryString("AreaID")); var isSubtract = AuthRequest.IsQueryExists("Subtract"); DataProvider.AreaDao.UpdateTaxis(areaId, isSubtract); PageUtils.Redirect(GetRedirectUrl(areaId)); return; } if (IsPostBack) { return; } VerifySystemPermissions(ConfigManager.SettingsPermissions.Admin); ClientScriptRegisterClientScriptBlock("NodeTreeScript", AreaTreeItem.GetScript(EAreaLoadingType.Management, null)); if (AuthRequest.IsQueryExists("CurrentAreaID")) { _currentAreaId = AuthRequest.GetQueryInt("CurrentAreaID"); var onLoadScript = GetScriptOnLoad(_currentAreaId); if (!string.IsNullOrEmpty(onLoadScript)) { ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript); } } BtnAdd.Attributes.Add("onclick", ModalAreaAdd.GetOpenWindowStringToAdd(GetRedirectUrl(0))); var urlDelete = PageUtils.GetSettingsUrl(nameof(PageAdminArea), new NameValueCollection { { "Delete", "True" } }); BtnDelete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(urlDelete, "AreaIDCollection", "AreaIDCollection", "请选择需要删除的区域!", "此操作将删除对应区域以及所有下级区域,确认删除吗?")); BindGrid(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (AuthRequest.IsQueryExists("Delete") && AuthRequest.IsQueryExists("DepartmentIDCollection")) { var departmentIdArrayList = TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("DepartmentIDCollection")); foreach (var departmentId in departmentIdArrayList) { DataProvider.DepartmentDao.Delete(departmentId); } SuccessMessage("成功删除所选部门"); } else if (AuthRequest.IsQueryExists("DepartmentID") && (AuthRequest.IsQueryExists("Subtract") || AuthRequest.IsQueryExists("Add"))) { var departmentId = AuthRequest.GetQueryInt("DepartmentID"); var isSubtract = AuthRequest.IsQueryExists("Subtract"); DataProvider.DepartmentDao.UpdateTaxis(departmentId, isSubtract); PageUtils.Redirect(GetRedirectUrl(departmentId)); return; } if (IsPostBack) { return; } VerifySystemPermissions(ConfigManager.SettingsPermissions.Admin); ClientScriptRegisterClientScriptBlock("NodeTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.ContentList, null)); if (AuthRequest.IsQueryExists("CurrentDepartmentID")) { _currentDepartmentId = AuthRequest.GetQueryInt("CurrentDepartmentID"); var onLoadScript = GetScriptOnLoad(_currentDepartmentId); if (!string.IsNullOrEmpty(onLoadScript)) { ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript); } } BtnAdd.Attributes.Add("onclick", ModalDepartmentAdd.GetOpenWindowStringToAdd(GetRedirectUrl(0))); BtnDelete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUtils.GetSettingsUrl(nameof(PageAdminDepartment), new NameValueCollection { { "Delete", "True" } }), "DepartmentIDCollection", "DepartmentIDCollection", "请选择需要删除的部门!", "此操作将删除对应部门以及所有下级部门,确认删除吗?")); RptContents.DataSource = DataProvider.DepartmentDao.GetIdListByParentId(0); RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); _relatedIdentity = AuthRequest.GetQueryInt("RelatedIdentity"); _isList = AuthRequest.GetQueryBool("IsList"); var nodeInfo = ChannelManager.GetChannelInfo(SiteId, _relatedIdentity); var tableName = ChannelManager.GetTableName(SiteInfo, nodeInfo); _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(SiteId, _relatedIdentity); var attributesOfDisplay = TranslateUtils.StringCollectionToStringCollection(nodeInfo.Additional.ContentAttributesOfDisplay); if (IsPostBack) { return; } var styleInfoList = ContentUtility.GetAllTableStyleInfoList(TableStyleManager.GetTableStyleInfoList(tableName, _relatedIdentities)); foreach (var styleInfo in styleInfoList) { if (styleInfo.InputType == InputType.TextEditor) { continue; } var listitem = new ListItem($"{styleInfo.DisplayName}({styleInfo.AttributeName})", styleInfo.AttributeName); if (styleInfo.AttributeName == ContentAttribute.Title) { listitem.Selected = true; } else { if (_isList) { if (attributesOfDisplay.Contains(styleInfo.AttributeName)) { listitem.Selected = true; } } else { listitem.Selected = true; } } CblDisplayAttributes.Items.Add(listitem); } }
public override void Submit_OnClick(object sender, EventArgs e) { var channelId = AuthRequest.GetQueryInt("channelId"); var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId); _tableName = ChannelManager.GetTableName(SiteInfo, channelInfo); DataProvider.ContentDao.UpdateArrangeTaxis(SiteId, _tableName, channelId, DdlAttributeName.SelectedValue, TranslateUtils.ToBool(DdlIsDesc.SelectedValue)); LayerUtils.CloseAndRedirect(Page, _returnUrl); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId", "channelId", "ReturnUrl"); var channelId = AuthRequest.GetQueryInt("channelId"); _returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("ReturnUrl")); if (IsPostBack) { return; } 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)); } 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; } DdlChannelTemplateId.DataSource = DataProvider.TemplateDao.GetDataSourceByType(SiteId, TemplateType.ChannelTemplate); DdlContentTemplateId.DataSource = DataProvider.TemplateDao.GetDataSourceByType(SiteId, TemplateType.ContentTemplate); DdlChannelTemplateId.DataBind(); DdlChannelTemplateId.Items.Insert(0, new ListItem("<默认>", "0")); DdlChannelTemplateId.Items[0].Selected = true; DdlContentTemplateId.DataBind(); DdlContentTemplateId.Items.Insert(0, new ListItem("<默认>", "0")); DdlContentTemplateId.Items[0].Selected = true; HlSelectChannel.Attributes.Add("onclick", ModalChannelSelect.GetOpenWindowString(SiteId)); LtlSelectChannelScript.Text = $@"<script>selectChannel('{ChannelManager.GetChannelNameNavigation(SiteId, channelId)}', '{channelId}');</script>"; }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _relatedFieldId = AuthRequest.GetQueryInt("RelatedFieldID"); _parentId = AuthRequest.GetQueryInt("ParentID"); _level = AuthRequest.GetQueryInt("Level"); }
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)); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); _returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("ReturnUrl")); if (string.IsNullOrEmpty(_returnUrl)) { _returnUrl = CmsPages.GetContentsUrl(SiteId, AuthRequest.GetQueryInt("channelId")); } //if (!base.HasChannelPermissions(this.channelId, AppManager.CMS.Permission.Channel.ContentTranslate)) //{ // PageUtils.RedirectToErrorPage("您没有此栏目的内容转移权限!"); // return; //} //bool isCut = base.HasChannelPermissions(this.channelId, AppManager.CMS.Permission.Channel.ContentDelete); const bool isCut = true; _idsDictionary = ContentUtility.GetIDsDictionary(Request.QueryString); if (IsPostBack) { return; } var builder = new StringBuilder(); foreach (var channelId in _idsDictionary.Keys) { var contentIdList = _idsDictionary[channelId]; if (contentIdList != null) { foreach (var contentId in contentIdList) { var contentInfo = ContentManager.GetContentInfo(SiteInfo, channelId, contentId); if (contentInfo != null) { builder.Append( $@"{WebUtils.GetContentTitle(SiteInfo, contentInfo, _returnUrl)}<br />"); } } } } LtlContents.Text = builder.ToString(); BtnTranslateAdd.Attributes.Add("onclick", ModalChannelMultipleSelect.GetOpenWindowString(SiteId, true)); ETranslateContentTypeUtils.AddListItems(RblTranslateType, isCut); ControlUtils.SelectSingleItem(RblTranslateType, ETranslateContentTypeUtils.GetValue(ETranslateContentType.Copy)); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _userId = AuthRequest.GetQueryInt("userID"); _returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("returnUrl")); if (IsPostBack) { return; } VerifySystemPermissions(ConfigManager.AppPermissions.SettingsUser); LtlPageTitle.Text = _userId == 0 ? "添加用户" : "编辑用户"; foreach (var groupInfo in UserGroupManager.GetUserGroupInfoList()) { DdlGroupId.Items.Add(new ListItem(groupInfo.GroupName, groupInfo.Id.ToString())); } if (_userId > 0) { var userInfo = UserManager.GetUserInfoByUserId(_userId); if (userInfo != null) { TbUserName.Text = userInfo.UserName; ControlUtils.SelectSingleItem(DdlGroupId, userInfo.GroupId.ToString()); TbUserName.Enabled = false; TbDisplayName.Text = userInfo.DisplayName; PhPassword.Visible = false; TbEmail.Text = userInfo.Email; TbMobile.Text = userInfo.Mobile; } } if (!EUserPasswordRestrictionUtils.Equals(ConfigManager.SystemConfigInfo.UserPasswordRestriction, EUserPasswordRestriction.None)) { LtlPasswordTips.Text = $"请包含{EUserPasswordRestrictionUtils.GetText(EUserPasswordRestrictionUtils.GetEnumType(ConfigManager.SystemConfigInfo.UserPasswordRestriction))}"; } if (!string.IsNullOrEmpty(_returnUrl)) { BtnReturn.Attributes.Add("onclick", $"window.location.href='{_returnUrl}';return false;"); } else { BtnReturn.Visible = false; } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageType = AuthRequest.GetQueryInt("pageType"); if (AuthRequest.IsQueryExists("delete")) { var pluginId = AuthRequest.GetQueryString("pluginId"); PluginManager.Delete(pluginId); AuthRequest.AddAdminLog("删除插件", $"插件:{pluginId}"); CacheUtils.ClearAll(); CacheDbUtils.Clear(); AddScript(AlertUtils.Success("插件删除成功", "插件删除成功,系统需要重载页面", "重新载入", "window.top.location.reload(true);")); } if (AuthRequest.IsQueryExists("enable")) { var pluginId = AuthRequest.GetQueryString("pluginId"); PluginManager.UpdateDisabled(pluginId, false); AuthRequest.AddAdminLog("启用插件", $"插件:{pluginId}"); CacheUtils.ClearAll(); CacheDbUtils.Clear(); AddScript(AlertUtils.Success("插件启用成功", "插件启用成功,系统需要重载页面", "重新载入", "window.top.location.reload(true);")); } else if (AuthRequest.IsQueryExists("disable")) { var pluginId = AuthRequest.GetQueryString("pluginId"); PluginManager.UpdateDisabled(pluginId, true); AuthRequest.AddAdminLog("禁用插件", $"插件:{pluginId}"); CacheUtils.ClearAll(); CacheDbUtils.Clear(); AddScript(AlertUtils.Success("插件禁用成功", "插件禁用成功,系统需要重载页面", "重新载入", "window.top.location.reload(true);")); } if (Page.IsPostBack) { return; } VerifySystemPermissions(ConfigManager.PluginsPermissions.Management); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId", "channelId", "ReturnUrl", "contentIdCollection"); _channelId = AuthRequest.GetQueryInt("channelId"); _returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("ReturnUrl")); _contentIdList = TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("contentIdCollection")); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId", "channelId"); _channelId = AuthRequest.GetQueryInt("channelId"); _tableName = ChannelManager.GetTableName(SiteInfo, _channelId); _idList = TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("contentIdCollection")); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _id = AuthRequest.GetQueryInt("id"); if (IsPostBack) { return; } VerifySystemPermissions(ConfigManager.SettingsPermissions.Admin); LtlPageTitle.Text = _id > 0 ? "修改API密钥" : "新增API密钥"; if (AuthRequest.AdminPermissions.IsConsoleAdministrator) { var userNameList = DataProvider.AdministratorDao.GetUserNameList(); foreach (var userName in userNameList) { DdlAdministrators.Items.Add(new ListItem(userName, userName)); } ControlUtils.SelectSingleItem(DdlAdministrators, AuthRequest.AdminName); } else { DdlAdministrators.Items.Add(new ListItem(AuthRequest.AdminName, AuthRequest.AdminName)); } foreach (var scope in AccessTokenManager.ScopeList) { CblScopes.Items.Add(new ListItem(scope, scope)); } if (_id > 0) { var tokenInfo = DataProvider.AccessTokenDao.GetAccessTokenInfo(_id); TbTitle.Text = tokenInfo.Title; ControlUtils.SelectSingleItem(DdlAdministrators, tokenInfo.AdminName); var scopes = TranslateUtils.StringCollectionToStringList(tokenInfo.Scopes); ControlUtils.SelectMultiItemsIgnoreCase(CblScopes, scopes); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } var siteId = AuthRequest.GetQueryInt("siteId"); _tag = AuthRequest.GetQueryString("tag"); if (AuthRequest.IsQueryExists("remove")) { var channelId = AuthRequest.GetQueryInt("channelId"); var contentId = AuthRequest.GetQueryInt("contentId"); var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId); var contentInfo = ContentManager.GetContentInfo(SiteInfo, channelInfo, contentId); var tagList = TranslateUtils.StringCollectionToStringList(contentInfo.Tags, ' '); if (tagList.Contains(_tag)) { tagList.Remove(_tag); } contentInfo.Tags = TranslateUtils.ObjectCollectionToString(tagList, " "); DataProvider.ContentDao.Update(SiteInfo, channelInfo, contentInfo); TagUtils.RemoveTags(SiteId, contentId); AuthRequest.AddSiteLog(SiteId, "移除内容", $"内容:{contentInfo.Title}"); SuccessMessage("移除成功"); AddWaitAndRedirectScript(PageUrl); } SpContents.ControlToPaginate = RptContents; RptContents.ItemDataBound += RptContents_ItemDataBound; SpContents.ItemsPerPage = SiteInfo.Additional.PageSize; SpContents.SelectCommand = DataProvider.ContentDao.GetSqlStringByContentTag(SiteInfo.TableName, _tag, siteId); SpContents.SortField = ContentAttribute.AddDate; SpContents.SortMode = SortMode.DESC; if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.SitePermissions.ConfigGroups); LtlContentTag.Text = "标签:" + _tag; SpContents.DataBind(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("siteId"); var specialId = AuthRequest.GetQueryInt("specialId"); var keyword = AuthRequest.GetQueryString("keyword"); if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.WebSitePermissions.Template); TbKeyword.Text = keyword; if (specialId > 0) { if (!string.IsNullOrEmpty(Request.QueryString["delete"])) { var specialInfo = SpecialManager.DeleteSpecialInfo(SiteId, specialId); AuthRequest.AddSiteLog(SiteId, "删除专题", $"专题名称:{specialInfo.Title}"); SuccessDeleteMessage(); } else if (!string.IsNullOrEmpty(Request.QueryString["download"])) { var specialInfo = SpecialManager.GetSpecialInfo(SiteId, specialId); var directoryPath = SpecialManager.GetSpecialDirectoryPath(SiteInfo, specialInfo.Url); var zipFilePath = SpecialManager.GetSpecialZipFilePath(directoryPath); PageUtils.Download(Response, zipFilePath, $"{specialInfo.Title}.zip"); return; } } RptContents.DataSource = string.IsNullOrEmpty(keyword) ? DataProvider.SpecialDao.GetSpecialInfoList(SiteId) : DataProvider.SpecialDao.GetSpecialInfoList(SiteId, keyword); RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); BtnAdd.Attributes.Add("onclick", ModalSpecialAdd.GetOpenWindowString(SiteId)); }