Skip to content

Commit 8de8463

Browse files
committed
bugfix
1 parent 32a4793 commit 8de8463

File tree

114 files changed

+2378
-1047
lines changed

Some content is hidden

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

114 files changed

+2378
-1047
lines changed

SiteServer.BackgroundPages/Cms/ModalSpecialAdd.cs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
using SiteServer.CMS.DataCache;
1212
using SiteServer.CMS.Model;
1313

14+
//https://github.com/codex-team/editor.js
15+
1416
namespace SiteServer.BackgroundPages.Cms
1517
{
1618
public class ModalSpecialAdd : BasePageCms

SiteServer.BackgroundPages/Cms/PageChannelAdd.cs

+65-55
Original file line numberDiff line numberDiff line change
@@ -193,115 +193,125 @@ public override void Submit_OnClick(object sender, EventArgs e)
193193
try
194194
{
195195
var channelId = AuthRequest.GetQueryInt("ChannelId");
196-
var nodeInfo = new ChannelInfo
196+
197+
var contentModelPluginId = DdlContentModelPluginId.SelectedValue;
198+
var contentRelatedPluginIds =
199+
ControlUtils.GetSelectedListControlValueCollection(CblContentRelatedPluginIds);
200+
var channelName = TbNodeName.Text;
201+
var indexName = TbNodeIndexName.Text;
202+
var filePath = TbFilePath.Text;
203+
var channelFilePathRule = TbChannelFilePathRule.Text;
204+
var contentFilePathRule = TbContentFilePathRule.Text;
205+
var groupNameCollection = TranslateUtils.ObjectCollectionToString(ControlUtils.GetSelectedListControlValueStringList(CblNodeGroupNameCollection));
206+
var imageUrl = TbImageUrl.Text;
207+
var content = ContentUtility.TextEditorContentEncode(SiteInfo, Request.Form[ChannelAttribute.Content]);
208+
var keywords = TbKeywords.Text;
209+
var description = TbDescription.Text;
210+
var isChannelAddable = TranslateUtils.ToBool(RblIsChannelAddable.SelectedValue);
211+
var isContentAddable = TranslateUtils.ToBool(RblIsContentAddable.SelectedValue);
212+
var linkUrl = TbLinkUrl.Text;
213+
var linkType = DdlLinkType.SelectedValue;
214+
var defaultTaxisType = ETaxisTypeUtils.GetValue(ETaxisTypeUtils.GetEnumType(DdlTaxisType.SelectedValue));
215+
var channelTemplateId = DdlChannelTemplateId.Items.Count > 0 ? TranslateUtils.ToInt(DdlChannelTemplateId.SelectedValue) : 0;
216+
var contentTemplateId = DdlContentTemplateId.Items.Count > 0 ? TranslateUtils.ToInt(DdlContentTemplateId.SelectedValue) : 0;
217+
218+
var channelInfo = new ChannelInfo
197219
{
198220
SiteId = SiteId,
199221
ParentId = channelId,
200-
ContentModelPluginId = DdlContentModelPluginId.SelectedValue,
201-
ContentRelatedPluginIds =
202-
ControlUtils.GetSelectedListControlValueCollection(CblContentRelatedPluginIds)
222+
ContentModelPluginId = contentModelPluginId,
223+
ContentRelatedPluginIds = contentRelatedPluginIds
203224
};
204225

205-
if (TbNodeIndexName.Text.Length != 0)
226+
if (!string.IsNullOrEmpty(indexName))
206227
{
207-
var nodeIndexNameArrayList = DataProvider.ChannelDao.GetIndexNameList(SiteId);
208-
if (nodeIndexNameArrayList.IndexOf(TbNodeIndexName.Text) != -1)
228+
var indexNameList = DataProvider.ChannelDao.GetIndexNameList(SiteId);
229+
if (indexNameList.IndexOf(indexName) != -1)
209230
{
210231
FailMessage("栏目添加失败,栏目索引已存在!");
211232
return;
212233
}
213234
}
214235

215-
if (TbFilePath.Text.Length != 0)
236+
if (!string.IsNullOrEmpty(filePath))
216237
{
217-
if (!DirectoryUtils.IsDirectoryNameCompliant(TbFilePath.Text))
238+
if (!DirectoryUtils.IsDirectoryNameCompliant(filePath))
218239
{
219240
FailMessage("栏目页面路径不符合系统要求!");
220241
return;
221242
}
222243

223-
if (PathUtils.IsDirectoryPath(TbFilePath.Text))
244+
if (PathUtils.IsDirectoryPath(filePath))
224245
{
225-
TbFilePath.Text = PageUtils.Combine(TbFilePath.Text, "index.html");
246+
filePath = PageUtils.Combine(filePath, "index.html");
226247
}
227248

228-
var filePathArrayList = DataProvider.ChannelDao.GetAllFilePathBySiteId(SiteId);
229-
if (filePathArrayList.IndexOf(TbFilePath.Text) != -1)
249+
var filePathList = DataProvider.ChannelDao.GetAllFilePathBySiteId(SiteId);
250+
if (filePathList.IndexOf(filePath) != -1)
230251
{
231252
FailMessage("栏目添加失败,栏目页面路径已存在!");
232253
return;
233254
}
234255
}
235256

236-
if (!string.IsNullOrEmpty(TbChannelFilePathRule.Text))
257+
if (!string.IsNullOrEmpty(channelFilePathRule))
237258
{
238-
if (!DirectoryUtils.IsDirectoryNameCompliant(TbChannelFilePathRule.Text))
259+
if (!DirectoryUtils.IsDirectoryNameCompliant(channelFilePathRule))
239260
{
240261
FailMessage("栏目页面命名规则不符合系统要求!");
241262
return;
242263
}
243-
if (PathUtils.IsDirectoryPath(TbChannelFilePathRule.Text))
264+
if (PathUtils.IsDirectoryPath(channelFilePathRule))
244265
{
245266
FailMessage("栏目页面命名规则必须包含生成文件的后缀!");
246267
return;
247268
}
248269
}
249270

250-
if (!string.IsNullOrEmpty(TbContentFilePathRule.Text))
271+
if (!string.IsNullOrEmpty(contentFilePathRule))
251272
{
252-
if (!DirectoryUtils.IsDirectoryNameCompliant(TbContentFilePathRule.Text))
273+
if (!DirectoryUtils.IsDirectoryNameCompliant(contentFilePathRule))
253274
{
254275
FailMessage("内容页面命名规则不符合系统要求!");
255276
return;
256277
}
257-
if (PathUtils.IsDirectoryPath(TbContentFilePathRule.Text))
278+
if (PathUtils.IsDirectoryPath(contentFilePathRule))
258279
{
259280
FailMessage("内容页面命名规则必须包含生成文件的后缀!");
260281
return;
261282
}
262283
}
263284

264-
var parentNodeInfo = ChannelManager.GetChannelInfo(SiteId, _channelId);
265-
var styleInfoList = TableStyleManager.GetChannelStyleInfoList(parentNodeInfo);
285+
var parentChannelInfo = ChannelManager.GetChannelInfo(SiteId, _channelId);
286+
var styleInfoList = TableStyleManager.GetChannelStyleInfoList(parentChannelInfo);
266287
var extendedAttributes = BackgroundInputTypeParser.SaveAttributes(SiteInfo, styleInfoList, Request.Form, null);
267-
nodeInfo.Additional.Load(extendedAttributes);
288+
channelInfo.Additional.Load(extendedAttributes);
268289
//foreach (string key in attributes)
269290
//{
270-
// nodeInfo.Additional.SetExtendedAttribute(key, attributes[key]);
291+
// channelInfo.Additional.SetExtendedAttribute(key, attributes[key]);
271292
//}
272293

273-
nodeInfo.ChannelName = TbNodeName.Text;
274-
nodeInfo.IndexName = TbNodeIndexName.Text;
275-
nodeInfo.FilePath = TbFilePath.Text;
276-
nodeInfo.ChannelFilePathRule = TbChannelFilePathRule.Text;
277-
nodeInfo.ContentFilePathRule = TbContentFilePathRule.Text;
278-
279-
var list = new ArrayList();
280-
foreach (ListItem item in CblNodeGroupNameCollection.Items)
281-
{
282-
if (item.Selected)
283-
{
284-
list.Add(item.Value);
285-
}
286-
}
287-
nodeInfo.GroupNameCollection = TranslateUtils.ObjectCollectionToString(list);
288-
nodeInfo.ImageUrl = TbImageUrl.Text;
289-
nodeInfo.Content = ContentUtility.TextEditorContentEncode(SiteInfo, Request.Form[ChannelAttribute.Content]);
290-
nodeInfo.Keywords = TbKeywords.Text;
291-
nodeInfo.Description = TbDescription.Text;
292-
nodeInfo.Additional.IsChannelAddable = TranslateUtils.ToBool(RblIsChannelAddable.SelectedValue);
293-
nodeInfo.Additional.IsContentAddable = TranslateUtils.ToBool(RblIsContentAddable.SelectedValue);
294-
295-
nodeInfo.LinkUrl = TbLinkUrl.Text;
296-
nodeInfo.LinkType = DdlLinkType.SelectedValue;
297-
298-
nodeInfo.Additional.DefaultTaxisType = ETaxisTypeUtils.GetValue(ETaxisTypeUtils.GetEnumType(DdlTaxisType.SelectedValue));
299-
300-
nodeInfo.ChannelTemplateId = DdlChannelTemplateId.Items.Count > 0 ? TranslateUtils.ToInt(DdlChannelTemplateId.SelectedValue) : 0;
301-
nodeInfo.ContentTemplateId = DdlContentTemplateId.Items.Count > 0 ? TranslateUtils.ToInt(DdlContentTemplateId.SelectedValue) : 0;
302-
303-
nodeInfo.AddDate = DateTime.Now;
304-
insertChannelId = DataProvider.ChannelDao.Insert(nodeInfo);
294+
channelInfo.ChannelName = channelName;
295+
channelInfo.IndexName = indexName;
296+
channelInfo.FilePath = filePath;
297+
channelInfo.ChannelFilePathRule = channelFilePathRule;
298+
channelInfo.ContentFilePathRule = contentFilePathRule;
299+
300+
channelInfo.GroupNameCollection = groupNameCollection;
301+
channelInfo.ImageUrl = imageUrl;
302+
channelInfo.Content = content;
303+
channelInfo.Keywords = keywords;
304+
channelInfo.Description = description;
305+
channelInfo.Additional.IsChannelAddable = isChannelAddable;
306+
channelInfo.Additional.IsContentAddable = isContentAddable;
307+
channelInfo.LinkUrl = linkUrl;
308+
channelInfo.LinkType = linkType;
309+
channelInfo.Additional.DefaultTaxisType = defaultTaxisType;
310+
channelInfo.ChannelTemplateId = channelTemplateId;
311+
channelInfo.ContentTemplateId = contentTemplateId;
312+
313+
channelInfo.AddDate = DateTime.Now;
314+
insertChannelId = DataProvider.ChannelDao.Insert(channelInfo);
305315
//栏目选择投票样式后,内容
306316
}
307317
catch (Exception ex)

0 commit comments

Comments
 (0)