예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.theme = GetTheme();
     if (!Page.IsPostBack)
     {
     }
 }
예제 #2
0
 protected override void OnPageLoad(object sender, EventArgs e)
 {
     this.theme = ThemeManager.Instance.GetByGuid(Data.Guid.New(Request.QueryString["tid"]));
     if (!Page.IsPostBack)
     {
         this.ThemeName.Text = theme.Name;
         LoadAvailableTemplates(theme);
     }
 }
예제 #3
0
        /// <summary>
        /// Gets the templates which still need to be added to this theme
        /// </summary>
        /// <param name="theme"></param>
        /// <returns></returns>
        public IList<String> GetAvailableGlobalTemplateTypeNames(CmsTheme theme)
        {
            IList<CmsTemplate> associated = GetTemplates(theme);

            CmsTemplateDao dao = new CmsTemplateDao();
            IList<CmsGlobalTemplateType> globals = dao.FindGlobalTemplateTypes();

            IList<String> temp1 = new List<String>();
            IList<String> temp2 = new List<String>();

            foreach (CmsTemplate item in associated)
                temp1.Add(item.Name);

            foreach (CmsGlobalTemplateType global in globals)
                temp2.Add(global.Name);

            IEnumerable<String> available = temp2.Except<String>(temp1);

            return new List<String>(available);
        }
예제 #4
0
 /// <summary>
 /// Gets the templates which are currently associated with the specified theme.
 /// </summary>
 /// <param name="theme"></param>
 /// <returns></returns>
 public IList<CmsTemplate> GetTemplates(CmsTheme theme)
 {
     CmsTemplateDao dao = new CmsTemplateDao();
     return dao.FindByThemeId(theme.Id);
 }
예제 #5
0
        private void LoadAvailableTemplates(CmsTheme theme)
        {
            this.TemplateType.Items.Clear();

            IList<String> names = TemplateManager.Instance.GetAvailableGlobalTemplateTypeNames(theme);
            foreach (String name in names)
            {
                ListItem item = new ListItem(name, name);
                this.TemplateType.Items.Add(item);
            }

            IList<CmsTemplate> existings = TemplateManager.Instance.GetTemplates(this.theme);
            this.LstExistingTemplates.Items.Clear();
            foreach (CmsTemplate template in existings)
            {
                ListItem item = new ListItem(template.Name, TextEncryption.Encode(template.Id.ToString()));
                this.LstExistingTemplates.Items.Add(item);
            }
        }