Skip to content

Commit 187db19

Browse files
committed
plugins
1 parent 2b9e43b commit 187db19

File tree

146 files changed

+1286
-2859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+1286
-2859
lines changed

SiteServer.BackgroundPages/Cms/ModalCheckState.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void Page_Load(object sender, EventArgs e)
4545
_contentId = AuthRequest.GetQueryInt("contentID");
4646
_returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("returnUrl"));
4747

48-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelId, _contentId);
48+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelId, _contentId);
4949

5050
int checkedLevel;
5151
var isChecked = CheckManager.GetUserCheckLevel(AuthRequest.AdminPermissionsImpl, SiteInfo, SiteId, out checkedLevel);

SiteServer.BackgroundPages/Cms/ModalContentAttributes.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
6363
{
6464
foreach (var contentId in _idList)
6565
{
66-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
66+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
6767
if (contentInfo != null)
6868
{
6969
if (CbIsRecommend.Checked)
@@ -98,7 +98,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
9898
{
9999
foreach (var contentId in _idList)
100100
{
101-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
101+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
102102
if (contentInfo != null)
103103
{
104104
if (CbIsRecommend.Checked)
@@ -133,7 +133,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
133133

134134
foreach (var contentId in _idList)
135135
{
136-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
136+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
137137
if (contentInfo != null)
138138
{
139139
contentInfo.Hits = hits;
@@ -151,7 +151,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
151151

152152
foreach (var contentId in _idList)
153153
{
154-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
154+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
155155
if (contentInfo != null)
156156
{
157157
contentInfo.Downloads = downloads;

SiteServer.BackgroundPages/Cms/ModalContentCheck.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
134134

135135
foreach (var contentId in contentIdList)
136136
{
137-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, channelInfo, contentId);
137+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, channelInfo, contentId);
138138
if (contentInfo != null)
139139
{
140140
if (CheckManager.IsCheckable(contentInfo.IsChecked, contentInfo.CheckedLevel, isCheckedOfUser, checkedLevelOfUser))
@@ -166,9 +166,14 @@ public override void Submit_OnClick(object sender, EventArgs e)
166166
foreach (var channelId in idsDictionaryToCheck.Keys)
167167
{
168168
var tableName = ChannelManager.GetTableName(SiteInfo, channelId);
169-
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
170169
var contentIdList = idsDictionaryToCheck[channelId];
171-
DataProvider.ContentDao.UpdateIsChecked(tableName, SiteInfo, channelInfo, contentIdList, translateChannelId, AuthRequest.AdminName, isChecked, checkedLevel, TbCheckReasons.Text);
170+
DataProvider.ContentDao.UpdateIsChecked(tableName, SiteId, channelId, contentIdList, translateChannelId, AuthRequest.AdminName, isChecked, checkedLevel, TbCheckReasons.Text);
171+
}
172+
173+
if (translateChannelId > 0)
174+
{
175+
var tableName = ChannelManager.GetTableName(SiteInfo, translateChannelId);
176+
ContentManager.RemoveCache(SiteInfo.Id, translateChannelId, tableName);
172177
}
173178

174179
AuthRequest.AddSiteLog(SiteId, SiteId, 0, "设置内容状态为" + DdlCheckType.SelectedItem.Text, TbCheckReasons.Text);

SiteServer.BackgroundPages/Cms/ModalContentCrossSiteTrans.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
6767
var targetTableName = ChannelManager.GetTableName(targetSiteInfo, targetChannelId);
6868
foreach (var contentId in _contentIdList)
6969
{
70-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelId, contentId);
70+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelId, contentId);
7171
FileUtility.MoveFileByContentInfo(SiteInfo, targetSiteInfo, contentInfo);
7272
contentInfo.SiteId = targetSiteId;
7373
contentInfo.SourceId = contentInfo.ChannelId;

SiteServer.BackgroundPages/Cms/ModalContentTaxis.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ public override void Submit_OnClick(object sender, EventArgs e)
7676
{
7777
if (isUp)
7878
{
79-
if (DataProvider.ContentDao.SetTaxisToUp(SiteInfo, _tableName, nodeInfo, contentId, isTop) == false)
79+
if (DataProvider.ContentDao.SetTaxisToUp(SiteId, _tableName, _channelId, contentId, isTop) == false)
8080
{
8181
break;
8282
}
8383
}
8484
else
8585
{
86-
if (DataProvider.ContentDao.SetTaxisToDown(SiteInfo, _tableName, nodeInfo, contentId, isTop) == false)
86+
if (DataProvider.ContentDao.SetTaxisToDown(SiteId, _tableName, _channelId, contentId, isTop) == false)
8787
{
8888
break;
8989
}

SiteServer.BackgroundPages/Cms/ModalContentTidyUp.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
5050
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
5151
_tableName = ChannelManager.GetTableName(SiteInfo, channelInfo);
5252

53-
DataProvider.ContentDao.UpdateArrangeTaxis(SiteInfo, _tableName, channelInfo, DdlAttributeName.SelectedValue, TranslateUtils.ToBool(DdlIsDesc.SelectedValue));
53+
DataProvider.ContentDao.UpdateArrangeTaxis(SiteId, _tableName, channelId, DdlAttributeName.SelectedValue, TranslateUtils.ToBool(DdlIsDesc.SelectedValue));
5454

5555
LayerUtils.CloseAndRedirect(Page, _returnUrl);
5656
}

SiteServer.BackgroundPages/Cms/ModalContentView.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void Page_Load(object sender, EventArgs e)
5555
_contentId = AuthRequest.GetQueryInt("id");
5656
_returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("returnUrl"));
5757

58-
_contentInfo = DataProvider.ContentDao.Get(SiteInfo, channelInfo, _contentId);
58+
_contentInfo = ContentManager.GetContentInfo(SiteInfo, channelInfo, _contentId);
5959

6060
if (IsPostBack) return;
6161

@@ -90,7 +90,7 @@ public void Page_Load(object sender, EventArgs e)
9090
{
9191
var referenceSiteId = DataProvider.ChannelDao.GetSiteId(_contentInfo.SourceId);
9292
var referenceSiteInfo = SiteManager.GetSiteInfo(referenceSiteId);
93-
var referenceContentInfo = DataProvider.ContentDao.Get(referenceSiteInfo, _contentInfo.SourceId, _contentInfo.ReferenceId);
93+
var referenceContentInfo = ContentManager.GetContentInfo(referenceSiteInfo, _contentInfo.SourceId, _contentInfo.ReferenceId);
9494

9595
if (referenceContentInfo != null)
9696
{

SiteServer.BackgroundPages/Cms/PageChannelDelete.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public void Page_Load(object sender, EventArgs e)
4949
if (!HasChannelPermissions(channelId, ConfigManager.ChannelPermissions.ChannelDelete)) continue;
5050

5151
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
52-
//var adminId = AuthRequest.AdminPermissionsImpl.GetAdminId(SiteId, channelId);
52+
var adminId = AuthRequest.AdminPermissionsImpl.GetAdminId(SiteId, channelId);
5353
var displayName = channelInfo.ChannelName;
54-
var count = DataProvider.ContentDao.GetCount(SiteInfo, channelInfo);
54+
var count = ContentManager.GetCount(SiteInfo, channelInfo, adminId);
5555
if (count > 0)
5656
{
5757
displayName += $"({count})";
@@ -119,11 +119,10 @@ public void Delete_OnClick(object sender, EventArgs e)
119119

120120
foreach (var channelId in channelIdListToDelete)
121121
{
122-
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
123-
var tableName = ChannelManager.GetTableName(SiteInfo, channelInfo);
122+
var tableName = ChannelManager.GetTableName(SiteInfo, channelId);
124123
var contentIdList = DataProvider.ContentDao.GetContentIdList(tableName, channelId);
125124
DeleteManager.DeleteContents(SiteInfo, channelId, contentIdList);
126-
DataProvider.ContentDao.UpdateTrashContents(SiteInfo, channelInfo, tableName, contentIdList);
125+
DataProvider.ContentDao.UpdateTrashContents(SiteId, channelId, tableName, contentIdList);
127126
}
128127

129128
AuthRequest.AddSiteLog(SiteId, "清空栏目下的内容", $"栏目:{builder}");
@@ -142,9 +141,8 @@ public void Delete_OnClick(object sender, EventArgs e)
142141

143142
foreach (var channelId in channelIdListToDelete)
144143
{
145-
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
146-
var tableName = ChannelManager.GetTableName(SiteInfo, channelInfo);
147-
DataProvider.ContentDao.UpdateTrashContentsByChannelId(SiteInfo, channelInfo, tableName);
144+
var tableName = ChannelManager.GetTableName(SiteInfo, channelId);
145+
DataProvider.ContentDao.UpdateTrashContentsByChannelId(SiteId, channelId, tableName);
148146
DataProvider.ChannelDao.Delete(SiteId, channelId);
149147
}
150148

SiteServer.BackgroundPages/Cms/PageChannelTranslate.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public string GetTitle(ChannelInfo channelInfo)
140140
}
141141
str = string.Concat(str, channelInfo.IsLastNode ? "└" : "├");
142142
str = string.Concat(str, channelInfo.ChannelName);
143-
//var adminId = AuthRequest.AdminPermissionsImpl.GetAdminId(SiteId, channelInfo.Id);
144-
var count = DataProvider.ContentDao.GetCount(SiteInfo, channelInfo);
143+
var adminId = AuthRequest.AdminPermissionsImpl.GetAdminId(SiteId, channelInfo.Id);
144+
var count = ContentManager.GetCount(SiteInfo, channelInfo, adminId);
145145
if (count != 0)
146146
{
147147
str = $"{str} ({count})";

SiteServer.BackgroundPages/Cms/PageContentAdd.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void Page_Load(object sender, EventArgs e)
9090
if (contentId > 0)
9191
{
9292
//contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
93-
contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
93+
contentInfo = DataProvider.ContentDao.GetCacheContentInfo(_tableName, _channelInfo.Id, contentId);
9494
}
9595

9696
var titleFormat = IsPostBack ? Request.Form[ContentAttribute.GetFormatStringAttributeName(ContentAttribute.Title)] : contentInfo?.GetString(ContentAttribute.GetFormatStringAttributeName(ContentAttribute.Title));
@@ -331,12 +331,11 @@ public override void Submit_OnClick(object sender, EventArgs e)
331331
{
332332
LogUtils.AddErrorLog(ex);
333333
FailMessage($"内容添加失败:{ex.Message}");
334-
return;
335334
}
336335
}
337336
else
338337
{
339-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
338+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
340339
try
341340
{
342341
contentInfo.LastEditUserName = AuthRequest.AdminName;

SiteServer.BackgroundPages/Cms/PageContentDelete.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void Page_Load(object sender, EventArgs e)
9999
var contentIdList = _idsDictionary[channelId];
100100
foreach (var contentId in contentIdList)
101101
{
102-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, channelId, contentId);
102+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, channelId, contentId);
103103
if (contentInfo != null)
104104
{
105105
builder.Append(
@@ -129,8 +129,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
129129
{
130130
foreach (var channelId in _idsDictionary.Keys)
131131
{
132-
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
133-
var tableName = ChannelManager.GetTableName(SiteInfo, channelInfo);
132+
var tableName = ChannelManager.GetTableName(SiteInfo, channelId);
134133
var contentIdList = _idsDictionary[channelId];
135134

136135
if (!_isDeleteFromTrash)
@@ -158,7 +157,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
158157
$"栏目:{ChannelManager.GetChannelNameNavigation(SiteId, channelId)},内容条数:{contentIdList.Count}");
159158
}
160159

161-
DataProvider.ContentDao.UpdateTrashContents(SiteInfo, channelInfo, tableName, contentIdList);
160+
DataProvider.ContentDao.UpdateTrashContents(SiteId, channelId, tableName, contentIdList);
162161

163162
//引用内容,需要删除
164163
//var siteTableNameList = SiteManager.GetTableNameList();
@@ -181,7 +180,7 @@ public override void Submit_OnClick(object sender, EventArgs e)
181180

182181
foreach (var contentId in contentIdList)
183182
{
184-
ContentUtility.Delete(tableName, SiteInfo, channelInfo, contentId);
183+
ContentUtility.Delete(tableName, SiteInfo, channelId, contentId);
185184
}
186185

187186
AuthRequest.AddSiteLog(SiteId, "从回收站清空内容", $"内容条数:{contentIdList.Count}");

SiteServer.BackgroundPages/Cms/PageContentSearch.cs

+14-24
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,17 @@ public void Page_Load(object sender, EventArgs e)
118118
AuthRequest.AdminPermissionsImpl,
119119
allAttributeNameList);
120120

121-
if (_isTrashOnly || _isWritingOnly || !string.IsNullOrEmpty(keyword))
121+
PgContents.Param = new PagerParam
122122
{
123-
PgContents.Param = new PagerParam
124-
{
125-
ControlToPaginate = RptContents,
126-
TableName = tableName,
127-
//PageSize = SiteInfo.Additional.PageSize,
128-
PageSize = 20,
129-
Page = AuthRequest.GetQueryInt(Pager.QueryNamePage, 1),
130-
OrderSqlString = ETaxisTypeUtils.GetContentOrderByString(ETaxisType.OrderByIdDesc),
131-
ReturnColumnNames = TranslateUtils.ObjectCollectionToString(allAttributeNameList),
132-
WhereSqlString = whereString,
133-
TotalCount = DataProvider.DatabaseDao.GetPageTotalCount(tableName, whereString)
134-
};
135-
}
123+
ControlToPaginate = RptContents,
124+
TableName = tableName,
125+
PageSize = SiteInfo.Additional.PageSize,
126+
Page = AuthRequest.GetQueryInt(Pager.QueryNamePage, 1),
127+
OrderSqlString = ETaxisTypeUtils.GetContentOrderByString(ETaxisType.OrderByIdDesc),
128+
ReturnColumnNames = TranslateUtils.ObjectCollectionToString(allAttributeNameList),
129+
WhereSqlString = whereString,
130+
TotalCount = DataProvider.DatabaseDao.GetPageTotalCount(tableName, whereString)
131+
};
136132

137133
if (IsPostBack) return;
138134

@@ -145,8 +141,7 @@ public void Page_Load(object sender, EventArgs e)
145141
var list = DataProvider.ContentDao.GetContentIdListByTrash(SiteId, tableName);
146142
foreach (var (contentChannelId, contentId) in list)
147143
{
148-
var channelInfo = ChannelManager.GetChannelInfo(SiteId, contentChannelId);
149-
ContentUtility.Delete(tableName, SiteInfo, channelInfo, contentId);
144+
ContentUtility.Delete(tableName, SiteInfo, contentChannelId, contentId);
150145
}
151146

152147
AuthRequest.AddSiteLog(SiteId, "清空回收站");
@@ -157,17 +152,15 @@ public void Page_Load(object sender, EventArgs e)
157152
var idsDictionary = ContentUtility.GetIDsDictionary(Request.QueryString);
158153
foreach (var channelId in idsDictionary.Keys)
159154
{
160-
var channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
161-
var channelTableName = ChannelManager.GetTableName(SiteInfo, channelInfo);
162155
var contentIdList = idsDictionary[channelId];
163-
DataProvider.ContentDao.UpdateTrashContents(SiteInfo, channelInfo, channelTableName, contentIdList);
156+
DataProvider.ContentDao.UpdateTrashContents(SiteId, channelId, ChannelManager.GetTableName(SiteInfo, channelId), contentIdList);
164157
}
165158
AuthRequest.AddSiteLog(SiteId, "从回收站还原内容");
166159
SuccessMessage("成功还原内容!");
167160
}
168161
else if (AuthRequest.IsQueryExists("IsRestoreAll"))
169162
{
170-
DataProvider.ContentDao.UpdateRestoreContentsByTrash(SiteInfo, _channelInfo, tableName);
163+
DataProvider.ContentDao.UpdateRestoreContentsByTrash(SiteId, _channelId, tableName);
171164
AuthRequest.AddSiteLog(SiteId, "从回收站还原所有内容");
172165
SuccessMessage("成功还原所有内容!");
173166
}
@@ -206,10 +199,7 @@ public void Page_Load(object sender, EventArgs e)
206199
TbDateFrom.Text = dateFrom;
207200
TbDateTo.Text = dateTo;
208201

209-
if (_isTrashOnly || _isWritingOnly || !string.IsNullOrEmpty(keyword))
210-
{
211-
PgContents.DataBind();
212-
}
202+
PgContents.DataBind();
213203

214204
LtlColumnsHead.Text += TextUtility.GetColumnsHeadHtml(_styleInfoList, _pluginColumns, _attributesOfDisplay);
215205

SiteServer.BackgroundPages/Cms/PageContentTranslate.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void Page_Load(object sender, EventArgs e)
7979
{
8080
foreach (var contentId in contentIdList)
8181
{
82-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, channelId, contentId);
82+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, channelId, contentId);
8383
if (contentInfo != null)
8484
{
8585
builder.Append(

SiteServer.BackgroundPages/Cms/PageContentsGroup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void Page_Load(object sender, EventArgs e)
4545
{
4646
var contentId = AuthRequest.GetQueryInt("contentId");
4747

48-
var contentInfo = DataProvider.ContentDao.Get(SiteInfo, _channelInfo, contentId);
48+
var contentInfo = ContentManager.GetContentInfo(SiteInfo, _channelInfo, contentId);
4949
var groupList = TranslateUtils.StringCollectionToStringList(contentInfo.GroupNameCollection);
5050
if (groupList.Contains(_contentGroupName))
5151
{

0 commit comments

Comments
 (0)