public IService AddContentMenu(Menu link) { if (ContentMenus == null) { ContentMenus = new List <Menu>(); } ContentMenus.Add(link); return(this); }
public override void Startup(IService service) { service .AddSiteMenu(siteId => { var formInfoList = FormManager.GetFormInfoList(siteId, 0); var menus = formInfoList.Where(formInfo => !string.IsNullOrEmpty(formInfo.Title)).Select(formInfo => new Menu { Text = FormManager.GetFormTitle(formInfo), Href = $"pages/logs.html?formId={formInfo.Id}" }).ToList(); menus.Add(new Menu { Text = "表单管理", Href = "pages/forms.html" }); menus.Add(new Menu { Text = "表单模板", Href = "pages/templates.html" }); return(new Menu { Text = "表单", IconClass = "ion-android-list", Menus = menus }); }) .AddContentMenu(contentInfo => { var formInfo = FormManager.GetFormInfoByContentId(contentInfo.SiteId, contentInfo.ChannelId, contentInfo.Id); var menu = new Menu { Text = FormManager.GetFormTitle(formInfo), Href = "pages/logs.html" }; return(menu); }) .AddDatabaseTable(FormDao.TableName, FormDao.Columns) .AddDatabaseTable(LogDao.TableName, LogDao.Columns) .AddDatabaseTable(FieldDao.TableName, FieldDao.Columns) .AddDatabaseTable(FieldItemDao.TableName, FieldItemDao.Columns) .AddStlElementParser(StlForm.ElementName, StlForm.Parse) ; service.ContentDeleteCompleted += Service_ContentDeleteCompleted; }
public IService AddPluginMenu(Menu menu) { PluginMenu = menu; return(this); }