forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppManager.cs
346 lines (313 loc) · 13.8 KB
/
AppManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
using System;
using System.Text;
using System.Collections.Generic;
namespace BaiRong.Core
{
public class AppManager
{
private AppManager() { }
public const string Version = "5.1";
public static string GetFullVersion()
{
return GetFullVersion(Version);
}
public static string GetFullVersion(string version)
{
var retval = version;
return retval;
}
public static double GetVersionDouble(string version)
{
version = version.Replace("_", ".").ToLower().Trim();
version = version.Replace(" ", string.Empty);
if (StringUtils.GetCount(".", version) == 2)
{
var theVersion = version;
version = theVersion.Substring(0, theVersion.LastIndexOf(".", StringComparison.Ordinal));
version += theVersion.Substring(theVersion.LastIndexOf(".", StringComparison.Ordinal) + 1);
}
return TranslateUtils.ToDouble(version);
}
public const string IdSite = "Site";
public const string IdPlugins = "Plugins";
public const string IdSettings = "Settings";
public class Permissions
{
public class Plugins
{
public const string Add = "plugins_add";
public const string Management = "plugins_management";
}
public class Settings
{
public const string SiteAdd = "settings_site_add";
public const string Config = "settings_config";
public const string SiteManagement = "settings_site_management";
public const string AdminManagement = "settings_admin_management";
public const string UserManagement = "settings_user_management";
public const string Integration = "settings_integration";
public const string Service = "settings_service";
public const string Chart = "settings_chart";
public const string Log = "settings_log";
public const string Utility = "settings_utility";
}
public class WebSite
{
private WebSite() { }
public const string ContentTrash = "cms_contentTrash"; //内容回收站
public const string Template = "cms_template"; //显示管理
public const string Configration = "cms_configration"; //设置管理
public const string Create = "cms_create"; //生成管理
}
public class Channel
{
private Channel() { }
public const string ContentView = "cms_contentView";
public const string ContentAdd = "cms_contentAdd";
public const string ContentEdit = "cms_contentEdit";
public const string ContentDelete = "cms_contentDelete";
public const string ContentTranslate = "cms_contentTranslate";
public const string ContentArchive = "cms_contentArchive";
public const string ContentOrder = "cms_contentOrder";
public const string ChannelAdd = "cms_channelAdd";
public const string ChannelEdit = "cms_channelEdit";
public const string ChannelDelete = "cms_channelDelete";
public const string ChannelTranslate = "cms_channelTranslate";
public const string CommentCheck = "cms_commentCheck";
public const string CommentDelete = "cms_commentDelete";
public const string CreatePage = "cms_createPage";
public const string ContentCheck = "cms_contentCheck";
public const string ContentCheckLevel1 = "cms_contentCheckLevel1";
public const string ContentCheckLevel2 = "cms_contentCheckLevel2";
public const string ContentCheckLevel3 = "cms_contentCheckLevel3";
public const string ContentCheckLevel4 = "cms_contentCheckLevel4";
public const string ContentCheckLevel5 = "cms_contentCheckLevel5";
}
}
public static string GetTopMenuName(string menuId)
{
var retval = string.Empty;
if (menuId == IdSite)
{
retval = "站点管理";
}
else if (menuId == IdPlugins)
{
retval = "插件管理";
}
else if (menuId == IdSettings)
{
retval = "系统管理";
}
return retval;
}
public static string GetLeftMenuName(string menuId)
{
var retval = string.Empty;
if (menuId == Cms.LeftMenu.IdContent)
{
retval = "信息管理";
}
else if (menuId == Cms.LeftMenu.IdTemplate)
{
retval = "显示管理";
}
else if (menuId == Cms.LeftMenu.IdConfigration)
{
retval = "设置管理";
}
else if (menuId == Cms.LeftMenu.IdCreate)
{
retval = "生成管理";
}
return retval;
}
public class Cms
{
public const string AppId = "cms";
public class LeftMenu
{
public const string IdContent = "Content";
public const string IdTemplate = "Template";
public const string IdConfigration = "Configration";
public const string IdCreate = "Create";
}
}
public class WeiXin
{
public const string AppId = "weixin";
public class TopMenu
{
public const string IdSiteManagement = "SiteManagement";
public const string IdSiteConfiguration = "SiteConfiguration";
public static string GetText(string menuId)
{
var retval = string.Empty;
if (menuId == IdSiteManagement)
{
retval = "微信管理";
}
else if (menuId == IdSiteConfiguration)
{
retval = "微信设置";
}
return retval;
}
}
public class LeftMenu
{
public const string IdAccounts = "Accounts";
public const string IdConfiguration = "Configuration";
public class Function
{
//Function
public const string IdCoupon = "Coupon";
public const string IdScratch = "Scratch";
public const string IdBigWheel = "BigWheel";
public const string IdGoldEgg = "GoldEgg";
public const string IdFlap = "Flap";
public const string IdYaoYao = "YaoYao";
public const string IdVote = "Vote";
public const string IdMessage = "Message";
public const string IdAppointment = "Appointment";
public const string IdConference = "Conference";
public const string IdMap = "Map";
public const string IdView360 = "View360";
public const string IdAlbum = "Album";
public const string IdSearch = "Search";
public const string IdStore = "Store";
public const string IdWifi = "Wifi";
public const string IdCard = "Card";
public const string IdCollect = "Collect";
}
public static string GetText(string menuId)
{
string retval = string.Empty;
if (menuId == IdAccounts)
{
retval = "公共账号";
}
return retval;
}
public static string GetSubText(string menuId)
{
string retval = string.Empty;
//Accounts
//Function
if (menuId == Function.IdCoupon)
{
retval = "优惠券";
}
else if (menuId == Function.IdScratch)
{
retval = "刮刮卡";
}
else if (menuId == Function.IdBigWheel)
{
retval = "大转盘";
}
else if (menuId == Function.IdGoldEgg)
{
retval = "砸金蛋";
}
else if (menuId == Function.IdFlap)
{
retval = "大翻牌";
}
else if (menuId == Function.IdYaoYao)
{
retval = "摇摇乐";
}
else if (menuId == Function.IdVote)
{
retval = "微投票";
}
else if (menuId == Function.IdMessage)
{
retval = "微留言";
}
else if (menuId == Function.IdAppointment)
{
retval = "微预约";
}
else if (menuId == Function.IdConference)
{
retval = "微会议";
}
else if (menuId == Function.IdMap)
{
retval = "微导航";
}
else if (menuId == Function.IdView360)
{
retval = "360全景";
}
else if (menuId == Function.IdAlbum)
{
retval = "微相册";
}
else if (menuId == Function.IdSearch)
{
retval = "微搜索";
}
else if (menuId == Function.IdStore)
{
retval = "微门店";
}
else if (menuId == Function.IdWifi)
{
retval = "微Wifi";
}
else if (menuId == Function.IdCard)
{
retval = "会员卡";
}
else if (menuId == Function.IdCollect)
{
retval = "微收集";
}
return retval;
}
}
public class Permission
{
public class WebSite
{
private WebSite() { }
public const string Info = "weixin_info"; //账户信息
public const string Chart = "weixin_chart"; //运营图表
public const string Menu = "weixin_menu"; //菜单
public const string TextReply = "weixin_textReply"; //文本回复
public const string ImageReply = "weixin_imageReply"; //图文回复
public const string SetReply = "weixin_setReply"; //回复设置
public const string Coupon = "weixin_coupon"; //优惠券管理
public const string Scratch = "weixin_scratch"; //刮刮卡管理
public const string BigWheel = "weixin_bigWheel"; //大转盘管理
public const string GoldEgg = "weixin_goldEgg"; //砸金蛋管理
public const string Flap = "weixin_flap"; //大翻牌管理
public const string YaoYao = "weixin_yaoYao"; //摇摇乐管理
public const string Vote = "weixin_vote"; //微投票管理
public const string Message = "weixin_message"; //微留言管理
public const string Appointment = "weixin_appointment"; //微预约管理
public const string Conference = "weixin_conference"; //微会议管理
public const string Map = "weixin_map"; //微导航管理
public const string View360 = "weixin_view360"; //全景管理
public const string Album = "weixin_album"; //微相册管理
public const string Search = "weixin_search"; //微搜索管理
public const string Store = "weixin_store"; //微门店管理
public const string Wifi = "weixin_wifi"; //微wifi管理
public const string Card = "weixin_card"; //微会员管理
public const string Collect = "weixin_collect"; //微征集管理
}
}
}
public static List<string> GetAppIdList()
{
return new List<string> { Cms.AppId, WeiXin.AppId };
}
public static bool IsWeiXin()
{
return FileUtils.IsFileExists(PathUtils.GetMenusPath(WeiXin.AppId, "Management.config"));
}
}
}