public static String GetAppPath(long appId) { ContentApp app = ContentApp.findById(appId); if (app == null) { throw new Exception("app not found: Content.AppId=" + appId); } return(HtmlLink.ToApp(app)); }
private static String getAppDirName(long appId) { ContentApp app = ContentApp.findById(appId); if (app == null) { throw new Exception("app not found: Content.AppId=" + appId); } return(HtmlLink.GetStaticDir(app)); }
private bool isAutoMakeHtml(int appId) { ContentApp app = ContentApp.findById(appId); if (app == null) { return(false); } ContentSetting setting = app.GetSettingsObj(); return(setting.IsAutoHtml == 1); }
// 初始化当前app private ContentApp initApp(MvcContext ctx, IMemberApp mapp) { IAppContext context = new AppContext(); int appId = mapp.AppOid; context.Id = appId; ContentApp app = ContentApp.findById(appId); context.obj = app; context.setAppType(app.GetType()); ctx.utils.setAppContext(context); return(app); }
//--------------------------------- /// <summary> /// 安装app /// </summary> /// <returns></returns> protected IMemberApp createApp() { int installerId = 4; AppInstaller installer = installerService.GetById(installerId); IMember owner = this.owner; User creator = this.user; String name = appName; IMemberApp mapp = appService.Add(creator, owner, name, installer.Id, AccessStatus.Public); String appUrl = UrlConverter.clearUrl(mapp, ctx, this.owner); IMenu menu = menuService.AddMenuByApp(mapp, name, "", appUrl); ContentApp newApp = ContentApp.findById(mapp.AppOid); this.app = newApp; return(mapp); }
private IMemberApp createApp() { int appInfoId = 4; AppInstaller info = appinfoService.GetById(appInfoId); IMember owner = this.user; User creator = this.user; String name = lang.get("homepage"); IMemberApp myuserApp = appService.Add(creator, owner, name, info.Id, AccessStatus.Public); //String appUrl = UrlConverter.clearUrl( myuserApp, ctx ); String appUrl = UrlConverter.clearUrl(myuserApp, ctx, owner); IMenu menu = menuService.AddMenuByApp(myuserApp, name, "", appUrl); menu.Url = "default"; menu.OrderId = 99; menuService.Update(menu); this.app = ContentApp.findById(myuserApp.AppOid); return(myuserApp); }
public static String GetlAppDirName( int appId ) { ContentApp app = ContentApp.findById( appId ); if (app == null) throw new Exception( "app not found: Content.AppId=" + appId ); return HtmlLink.GetStaticDir( app ); }
private static ContentApp getApp(ContentSection section) { return(ContentApp.findById(section.AppId)); }