Exemplo n.º 1
0
 public int SaveSite(SiteDto site)
 {
     if (site.SiteId!=0 && _resp.GetSites().SingleOrDefault(a => a.SiteId == site.SiteId)==null)
     {
         site.SiteId = 0;
     }
     ISite _site = _resp.CreateSite(site.SiteId, site.Name);
     _site.CloneData(site);
     return _site.Save();
 }
Exemplo n.º 2
0
 public void Create_GET()
 {
     var site = new SiteDto();
     var sites=SiteCacheManager.GetAllSites();
     if (sites.Count > 0)
     {
         site.SiteId = sites[sites.Count - 1].SiteId + 1;
         //site.Name = "未命名站点"+site.SiteId.ToString();
     }
     string html=EntityForm.Build<SiteDto>(site,true,"创建");
     base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Site_Edit), new
     {
         form=html,
         tpls=Helper.GetTemplateOptions("")
     });
 }
Exemplo n.º 3
0
        public CmsTemplateCore()
        {
            this.site = Cms.Context.CurrentSite;
            this.siteId = this.site.SiteId;

            //缓存=》模板设置
            string settingCacheKey = String.Format("{0}_{1}_settings", CacheSign.Template.ToString(), this.site.Tpl);
            object settings = Cms.Cache.Get(settingCacheKey);
            if (settings == null)
            {
                this.TplSetting = new TemplateSetting(this.site.Tpl);
                Cms.Cache.Insert(settingCacheKey, this.TplSetting, String.Format("{0}templates/{1}/tpl.conf", Cms.PyhicPath, this.site.Tpl));
            }
            else
            {
                this.TplSetting = settings as TemplateSetting;
            }
        }
Exemplo n.º 4
0
 public PageGeneratorObject(CmsContext context)
 {
     //this.context=context;
     this.site = context.CurrentSite;
 }
Exemplo n.º 5
0
Arquivo: Cms.cs Projeto: AntonWong/cms
		/// <summary>
		/// 重新注册设置站点
		/// </summary>
		/// <param name="sites"></param>
        public static void RegSites(SiteDto[] sites)
        {
            Cms.sites = sites;
        }