Skip to content

Commit c87ac90

Browse files
committed
6.14
1 parent c204748 commit c87ac90

File tree

71 files changed

+872
-491
lines changed

Some content is hidden

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

71 files changed

+872
-491
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ SiteServer CMS 基于.NET 平台,能够以最低的成本、最少的人力投
1515

1616
## 迭代计划
1717

18+
[2019 年 9 月/10 月迭代计划](https://mp.weixin.qq.com/s?__biz=MjM5MTE5MzgyNQ==&mid=2257483819&idx=1&sn=5c7872d787dbdc33c20ff07ef62825b3&chksm=a5c397a592b41eb3fa1fb63c81991fca25e8774ecb6aa38c5dde8ee332aa858062459cc7f074&scene=0&xtrack=1&key=79a78721542791212f32b13a1e4813e5de2132c8fffd9a98e2d0b6a8c3c529f38b975ccf4c071d642f8bdee97f4df145374556f6e63ec09ef361632dc37e2e24ee1b7f40dea9c688f947d76acf4a043c&ascene=1&uin=MTUyMjE4MTU2NQ%3D%3D&devicetype=Windows+10&version=62060833&lang=zh_CN&pass_ticket=zEXWDQP%2BAmijF6pKkhJsqtyuWssR%2BYFwJzTqiW0TnwgcoTUqMxJH1Ki%2F0Wdf%2FDKu)
19+
1820
[2019 年 7 月/8 月迭代计划](https://mp.weixin.qq.com/s/c-khP44sahCG1phjl8ZHeg)
1921

2022
[2019 年 5 月/6 月迭代计划](https://github.com/siteserver/cms/issues/1879)

Diff for: SS.CMS.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<copyright>Copyright © SiteServer CMS</copyright>
1313
<tags>SiteServer CMS</tags>
1414
<releaseNotes>
15-
SiteServer CMS V6.13正式版
15+
SiteServer CMS V6.14正式版
1616
</releaseNotes>
1717
</metadata>
1818
</package>

Diff for: SiteServer.BackgroundPages/Cms/PageContentSearch.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
277277

278278
ltlTitle.Text = WebUtils.GetContentTitle(SiteInfo, contentInfo, PageUrl);
279279

280-
var specialHtml = string.Empty;
280+
string specialHtml;
281281

282282
if (_isTrashOnly)
283283
{
@@ -296,8 +296,7 @@ private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
296296
{specialHtml}
297297
</td>";
298298

299-
string nodeName;
300-
if (!_nameValueCacheDict.TryGetValue(contentInfo.ChannelId.ToString(), out nodeName))
299+
if (!_nameValueCacheDict.TryGetValue(contentInfo.ChannelId.ToString(), out var nodeName))
301300
{
302301
nodeName = ChannelManager.GetChannelNameNavigation(SiteId, contentInfo.ChannelId);
303302
_nameValueCacheDict[contentInfo.ChannelId.ToString()] = nodeName;

Diff for: SiteServer.BackgroundPages/Core/WebUtils.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ public static string GetContentTitle(SiteInfo siteInfo, ContentInfo contentInfo,
2929
}
3030
else
3131
{
32+
var layerUrl =
33+
$@"contentsLayerView.cshtml?siteId={siteInfo.Id}&channelId={-contentInfo.ChannelId}&contentId={contentInfo.Id}";
34+
//ModalContentView.GetOpenWindowString(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl)
3235
url =
33-
$@"<a href=""javascript:;"" onclick=""{ModalContentView.GetOpenWindowString(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl)}"">{displayString}</a>";
36+
$@"<a href=""javascript:;"" onclick=""{LayerUtils.GetOpenScript2("查看内容", layerUrl)}"">{displayString}</a>";
3437
}
3538

3639
var image = string.Empty;

Diff for: SiteServer.BackgroundPages/PageInstaller.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ private bool UpdateWebConfig(out string errorMessage)
392392
var databaseType = DatabaseTypeUtils.GetEnumType(DdlSqlDatabaseType.SelectedValue);
393393
var connectionString = GetConnectionString(true);
394394

395-
WebConfigUtils.UpdateWebConfig(isProtectData, databaseType, connectionString, "api", "SiteServer", "Home", StringUtils.GetShortGuid(), false);
395+
WebConfigUtils.UpdateWebConfig(isProtectData, databaseType, connectionString, "SiteServer", "Home", StringUtils.GetShortGuid(), false);
396396

397397
DataProvider.Reset();
398398

+27-22
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
using System;
22
using System.Web.UI.WebControls;
3-
using SiteServer.CMS.Core;
4-
using SiteServer.CMS.DataCache;
53
using SiteServer.Utils;
6-
using SiteServer.Utils.Enumerations;
4+
using SiteServer.CMS.DataCache;
75

86
namespace SiteServer.BackgroundPages.Settings
97
{
10-
public class PageSiteUrlApi : BasePage
8+
public class PageSiteUrlApi : BasePageCms
119
{
12-
public RadioButtonList RblIsSeparatedApi;
13-
public PlaceHolder PhSeparatedApi;
14-
public TextBox TbSeparatedApiUrl;
10+
public Repeater RptContents;
11+
12+
public static string GetRedirectUrl()
13+
{
14+
return PageUtils.GetSettingsUrl(nameof(PageSiteUrlApi), null);
15+
}
1516

1617
public void Page_Load(object sender, EventArgs e)
1718
{
@@ -20,26 +21,30 @@ public void Page_Load(object sender, EventArgs e)
2021

2122
VerifySystemPermissions(ConfigManager.AppPermissions.SettingsSiteUrl);
2223

23-
EBooleanUtils.AddListItems(RblIsSeparatedApi, "API独立部署", "API与CMS部署在一起");
24-
ControlUtils.SelectSingleItem(RblIsSeparatedApi, ConfigManager.SystemConfigInfo.IsSeparatedApi.ToString());
25-
PhSeparatedApi.Visible = ConfigManager.SystemConfigInfo.IsSeparatedApi;
26-
TbSeparatedApiUrl.Text = ConfigManager.SystemConfigInfo.SeparatedApiUrl;
24+
var siteList = SiteManager.GetSiteIdListOrderByLevel();
25+
RptContents.DataSource = siteList;
26+
RptContents.ItemDataBound += DgContents_ItemDataBound;
27+
RptContents.DataBind();
2728
}
2829

29-
public void RblIsSeparatedApi_SelectedIndexChanged(object sender, EventArgs e)
30+
private static void DgContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
3031
{
31-
PhSeparatedApi.Visible = TranslateUtils.ToBool(RblIsSeparatedApi.SelectedValue);
32-
}
32+
if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) return;
3333

34-
public override void Submit_OnClick(object sender, EventArgs e)
35-
{
36-
ConfigManager.SystemConfigInfo.IsSeparatedApi = TranslateUtils.ToBool(RblIsSeparatedApi.SelectedValue);
37-
ConfigManager.SystemConfigInfo.SeparatedApiUrl = TbSeparatedApiUrl.Text;
34+
var siteId = (int)e.Item.DataItem;
35+
var siteInfo = SiteManager.GetSiteInfo(siteId);
36+
37+
var ltlName = (Literal)e.Item.FindControl("ltlName");
38+
var ltlDir = (Literal)e.Item.FindControl("ltlDir");
39+
var ltlApiUrl = (Literal)e.Item.FindControl("ltlApiUrl");
40+
var ltlEditUrl = (Literal)e.Item.FindControl("ltlEditUrl");
41+
42+
ltlName.Text = SiteManager.GetSiteName(siteInfo);
43+
ltlDir.Text = siteInfo.SiteDir;
3844

39-
DataProvider.ConfigDao.Update(ConfigManager.Instance);
45+
ltlApiUrl.Text = $@"<a href=""{siteInfo.Additional.ApiUrl}/v1/ping"" target=""_blank"">{siteInfo.Additional.ApiUrl}</a>";
4046

41-
AuthRequest.AddAdminLog("修改API访问地址");
42-
SuccessUpdateMessage();
47+
ltlEditUrl.Text = $@"<a href=""{PageSiteUrlApiConfig.GetRedirectUrl(siteId)}"">修改</a>";
4348
}
44-
}
49+
}
4550
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using System;
2+
using System.Collections.Specialized;
3+
using System.Web.UI.WebControls;
4+
using SiteServer.CMS.Core;
5+
using SiteServer.CMS.DataCache;
6+
using SiteServer.CMS.Model;
7+
using SiteServer.Utils;
8+
using SiteServer.Utils.Enumerations;
9+
10+
namespace SiteServer.BackgroundPages.Settings
11+
{
12+
public class PageSiteUrlApiConfig : BasePageCms
13+
{
14+
public Literal LtlSiteName;
15+
16+
public RadioButtonList RblIsSeparatedApi;
17+
public PlaceHolder PhSeparatedApi;
18+
public TextBox TbSeparatedApiUrl;
19+
20+
public static string GetRedirectUrl(int siteId)
21+
{
22+
return PageUtils.GetSettingsUrl(nameof(PageSiteUrlApiConfig), new NameValueCollection
23+
{
24+
{
25+
"SiteId", siteId.ToString()
26+
}
27+
});
28+
}
29+
30+
public void Page_Load(object sender, EventArgs e)
31+
{
32+
if (IsForbidden) return;
33+
if (IsPostBack) return;
34+
35+
VerifySystemPermissions(ConfigManager.AppPermissions.SettingsSiteUrl);
36+
37+
LtlSiteName.Text = SiteInfo.SiteName;
38+
39+
EBooleanUtils.AddListItems(RblIsSeparatedApi, "API独立部署", "API与CMS部署在一起");
40+
ControlUtils.SelectSingleItem(RblIsSeparatedApi, SiteInfo.Additional.IsSeparatedApi.ToString());
41+
PhSeparatedApi.Visible = SiteInfo.Additional.IsSeparatedApi;
42+
TbSeparatedApiUrl.Text = SiteInfo.Additional.SeparatedApiUrl;
43+
}
44+
45+
public void RblIsSeparatedApi_SelectedIndexChanged(object sender, EventArgs e)
46+
{
47+
PhSeparatedApi.Visible = TranslateUtils.ToBool(RblIsSeparatedApi.SelectedValue);
48+
}
49+
50+
public override void Submit_OnClick(object sender, EventArgs e)
51+
{
52+
SiteInfo.Additional.IsSeparatedApi = TranslateUtils.ToBool(RblIsSeparatedApi.SelectedValue);
53+
SiteInfo.Additional.SeparatedApiUrl = TbSeparatedApiUrl.Text;
54+
if (!string.IsNullOrEmpty(SiteInfo.Additional.SeparatedApiUrl) && SiteInfo.Additional.SeparatedApiUrl.EndsWith("/"))
55+
{
56+
SiteInfo.Additional.SeparatedApiUrl =
57+
SiteInfo.Additional.SeparatedApiUrl.Substring(0, SiteInfo.Additional.SeparatedApiUrl.Length - 1);
58+
}
59+
60+
DataProvider.SiteDao.Update(SiteInfo);
61+
AuthRequest.AddSiteLog(SiteId, "修改API访问地址");
62+
63+
SuccessMessage("API访问地址修改成功!");
64+
AddWaitAndRedirectScript(PageSiteUrlApi.GetRedirectUrl());
65+
}
66+
}
67+
}

Diff for: SiteServer.BackgroundPages/SiteServer.BackgroundPages.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@
587587
<Compile Include="Settings\PageSiteTemplate.cs">
588588
<SubType>ASPXCodeBehind</SubType>
589589
</Compile>
590-
<Compile Include="Settings\PageSiteUrlApi.cs">
590+
<Compile Include="Settings\PageSiteUrlApiConfig.cs">
591591
<SubType>ASPXCodeBehind</SubType>
592592
</Compile>
593593
<Compile Include="Settings\PageSiteUrlAssets.cs">
@@ -596,6 +596,9 @@
596596
<Compile Include="Settings\PageSiteUrlAssetsConfig.cs">
597597
<SubType>ASPXCodeBehind</SubType>
598598
</Compile>
599+
<Compile Include="Settings\PageSiteUrlApi.cs">
600+
<SubType>ASPXCodeBehind</SubType>
601+
</Compile>
599602
<Compile Include="Settings\PageSiteUrlWeb.cs">
600603
<SubType>ASPXCodeBehind</SubType>
601604
</Compile>

Diff for: SiteServer.CMS/Api/ApiManager.cs

+4-15
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,20 @@ namespace SiteServer.CMS.Api
66
{
77
public static class ApiManager
88
{
9-
public static bool IsSeparatedApi => ConfigManager.SystemConfigInfo.IsSeparatedApi;
10-
11-
public static string ApiUrl => ConfigManager.SystemConfigInfo.ApiUrl;
12-
13-
public static string RootUrl => PageUtils.ApplicationPath;
14-
15-
private static string _innerApiUrl;
9+
private static string innerApiUrl;
1610

1711
public static string InnerApiUrl
1812
{
1913
get
2014
{
21-
if (string.IsNullOrEmpty(_innerApiUrl))
15+
if (string.IsNullOrEmpty(innerApiUrl))
2216
{
23-
_innerApiUrl = PageUtils.ParseNavigationUrl($"~/{WebConfigUtils.ApiPrefix}");
17+
innerApiUrl = PageUtils.ParseNavigationUrl("~/api");
2418
}
25-
return _innerApiUrl;
19+
return innerApiUrl;
2620
}
2721
}
2822

29-
public static string GetApiUrl(string route)
30-
{
31-
return PageUtils.Combine(ApiUrl, route);
32-
}
33-
3423
public static string GetInnerApiUrl(string route)
3524
{
3625
return PageUtils.Combine(InnerApiUrl, route);

Diff for: SiteServer.CMS/Api/ApiRoutePlugin.cs

+26-26
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,31 @@ public static string GetRoute(string routeResource, string routeId, string route
3737
return route;
3838
}
3939

40-
public static string GetUrl(string pluginId, string routeResource = "", string routeId = "", string routeAction = "")
41-
{
42-
var apiUrl = ApiManager.GetApiUrl(Route);
43-
apiUrl = apiUrl.Replace("{pluginId}", pluginId);
44-
if (!string.IsNullOrEmpty(routeResource))
45-
{
46-
apiUrl = PageUtils.Combine(apiUrl, routeResource);
47-
if (!string.IsNullOrEmpty(routeId))
48-
{
49-
apiUrl = PageUtils.Combine(apiUrl, routeId);
50-
if (!string.IsNullOrEmpty(routeAction))
51-
{
52-
apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
53-
}
54-
}
55-
else if (!string.IsNullOrEmpty(routeAction))
56-
{
57-
apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
58-
}
59-
}
60-
else if (!string.IsNullOrEmpty(routeAction))
61-
{
62-
apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
63-
}
64-
return apiUrl;
65-
}
40+
//public static string GetUrl(string pluginId, string routeResource = "", string routeId = "", string routeAction = "")
41+
//{
42+
// var apiUrl = ApiManager.GetApiUrl(Route);
43+
// apiUrl = apiUrl.Replace("{pluginId}", pluginId);
44+
// if (!string.IsNullOrEmpty(routeResource))
45+
// {
46+
// apiUrl = PageUtils.Combine(apiUrl, routeResource);
47+
// if (!string.IsNullOrEmpty(routeId))
48+
// {
49+
// apiUrl = PageUtils.Combine(apiUrl, routeId);
50+
// if (!string.IsNullOrEmpty(routeAction))
51+
// {
52+
// apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
53+
// }
54+
// }
55+
// else if (!string.IsNullOrEmpty(routeAction))
56+
// {
57+
// apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
58+
// }
59+
// }
60+
// else if (!string.IsNullOrEmpty(routeAction))
61+
// {
62+
// apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
63+
// }
64+
// return apiUrl;
65+
//}
6666
}
6767
}

Diff for: SiteServer.CMS/Core/ContentUtility.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,9 @@ public static void Translate(SiteInfo siteInfo, int channelId, int contentId, st
524524

525525
public static void Delete(string tableName, SiteInfo siteInfo, int channelId, int contentId)
526526
{
527-
if (string.IsNullOrEmpty(tableName) || siteInfo == null || channelId <= 0 || contentId <= 0) return;
527+
if (string.IsNullOrEmpty(tableName) || siteInfo == null || contentId <= 0) return;
528528

529-
DataProvider.ContentDao.Delete(tableName, siteInfo.Id, channelId, contentId);
529+
DataProvider.ContentDao.Delete(tableName, siteInfo.Id, contentId);
530530

531531
TagUtils.RemoveTags(siteInfo.Id, contentId);
532532

Diff for: SiteServer.CMS/Core/InputParserUtility.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public static string GetVideoHtml(SiteInfo siteInfo, string videoUrl, NameValueC
311311
else
312312
{
313313
retVal = $@"
314-
<embed src=""{SiteFilesAssets.GetUrl(ApiManager.ApiUrl, SiteFilesAssets.BrPlayer.Swf)}"" allowfullscreen=""true"" flashvars=""controlbar=over&autostart={true
314+
<embed src=""{SiteFilesAssets.GetUrl(siteInfo.Additional.ApiUrl, SiteFilesAssets.BrPlayer.Swf)}"" allowfullscreen=""true"" flashvars=""controlbar=over&autostart={true
315315
.ToString().ToLower()}&image={string.Empty}&file={videoUrl}"" width=""{450}"" height=""{350}""/>
316316
";
317317
}
@@ -332,7 +332,7 @@ public static string GetFileHtmlWithCount(SiteInfo siteInfo, int channelId, int
332332
{
333333
var stlAnchor = new HtmlAnchor();
334334
ControlUtils.AddAttributesIfNotExists(stlAnchor, attributes);
335-
stlAnchor.HRef = ApiRouteActionsDownload.GetUrl(ApiManager.ApiUrl, siteInfo.Id, channelId,
335+
stlAnchor.HRef = ApiRouteActionsDownload.GetUrl(siteInfo.Additional.ApiUrl, siteInfo.Id, channelId,
336336
contentId, fileUrl);
337337
stlAnchor.InnerHtml = string.IsNullOrEmpty(innerHtml)
338338
? PageUtils.GetFileNameFromUrl(fileUrl)
@@ -365,7 +365,7 @@ public static string GetFileHtmlWithoutCount(SiteInfo siteInfo, string fileUrl,
365365
{
366366
var stlAnchor = new HtmlAnchor();
367367
ControlUtils.AddAttributesIfNotExists(stlAnchor, attributes);
368-
stlAnchor.HRef = ApiRouteActionsDownload.GetUrl(ApiManager.ApiUrl, siteInfo.Id, fileUrl);
368+
stlAnchor.HRef = ApiRouteActionsDownload.GetUrl(siteInfo.Additional.ApiUrl, siteInfo.Id, fileUrl);
369369
stlAnchor.InnerHtml = string.IsNullOrEmpty(innerHtml) ? PageUtils.GetFileNameFromUrl(fileUrl) : innerHtml;
370370

371371
if (isLower)

Diff for: SiteServer.CMS/Core/InputTypeUtils.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ public static string ParseString(InputType inputType, string content, string rep
303303

304304
private static string ParseString(string content, string replace, string to, int startIndex, int length, int wordNum, string ellipsis, bool isClearTags, bool isReturnToBr, bool isLower, bool isUpper, string formatString)
305305
{
306+
if (string.IsNullOrEmpty(content)) return string.Empty;
307+
306308
var parsedContent = content;
307309

308310
if (!string.IsNullOrEmpty(replace))
@@ -341,7 +343,9 @@ private static string ParseString(string content, string replace, string to, int
341343

342344
if (!string.IsNullOrEmpty(formatString))
343345
{
344-
parsedContent = string.Format(formatString, parsedContent);
346+
var date = TranslateUtils.ToDateTime(parsedContent);
347+
parsedContent = date.ToString(formatString);
348+
//parsedContent = string.Format(formatString, parsedContent);
345349
}
346350

347351
if (isLower)

0 commit comments

Comments
 (0)