Esempio n. 1
0
        public override void Save()
        {
            if (IsNew && WebSessionHelper.CurrentLicense != null && WebSessionHelper.CurrentLicense.HasMaxNumberExceeded("PageFolder"))
            {
                throw new Exception("Kan niet opslaan: licentie heeft maximale aantal folders (" + WebSessionHelper.CurrentLicense.MaxNumberOfPageFolders + ") overschreden.");
            }
            Validate();
            RelativePath = GetCompletePath();
            //unique check
            //workaraound voor mysql: uniek is combi van naam, site en folder
            //als folder leeg is (NULL), gaat uniqueconstraint niet af in mySql
            //hierom in c# checken
            if (this.ParentFolder == null && ID != Guid.Empty)
            {
                string        sql         = String.Format("FK_Site='{0}' AND FK_Parent_Folder IS NULL AND name = '{1}' AND ID != '{2}'", Site.ID, this.Name, this.ID);
                CmsPageFolder checkFolder = BaseObject.GetFirst <CmsPageFolder>(sql);
                if (checkFolder != null)
                {
                    throw new Exception("Naam is niet uniek.");
                }
            }
            CmsPageFolder currentFolder = BaseObject.GetById <CmsPageFolder>(this.ID);

            if (currentFolder != null)
            {
                currentFolder.DeleteCurrentFolderLocation();
            }
            base.Save();

            //bij naamswijziging, moeten alle paden in subfolders en pagina's worden geupdate
            UpdateRelativePathAndUnpublishedItemsInSubFoldersAndPages();
            UnpublishedItem.Set(this, "Folder");
        }
Esempio n. 2
0
        public override void Delete()
        {
            //template modules verwijderen
            BaseCollection <BaseModule> Modules = this.GetTemplateModules();

            foreach (BaseModule module in Modules)
            {
                module.Delete();
            }
            base.Delete();
            UnpublishedItem.Set(this, "Template", ChangeStatusEnum.Deleted);
        }
Esempio n. 3
0
        public override void Delete()
        {
            if (this.IsSystemValue)
            {
                throw new Exception("Systeem scripts mogen niet worden verwijderd.");
            }
            base.Delete();
            string filename = this.Site.Path + Url.Replace("/", "\\");

            //FileHelper.DeleteFile(filename);


            UnpublishedItem.Set(this, "Script", ChangeStatusEnum.Deleted);
        }
Esempio n. 4
0
        public void UpdateRelativePathAndUnpublishedItemsInSubFoldersAndPages()
        {
            BaseCollection <CmsPageFolder> subFolders = GetSubFolders();

            foreach (CmsPageFolder subfolder in subFolders)
            {
                subfolder.Save();
                UnpublishedItem.Set(subfolder, "Folder");
                subfolder.UpdateRelativePathAndUnpublishedItemsInSubFoldersAndPages();
            }
            BaseCollection <CmsPage> pages = GetPages();

            foreach (CmsPage page in pages)
            {
                page.Save();
                UnpublishedItem.Set(page, "Page");
            }
        }
Esempio n. 5
0
        public override void Delete()
        {
            foreach (BaseModule module in this.Modules)
            {
                //Modules zichtbaar op alle pagina's
                if (module.CrossPagesMode == CrossPagesModeEnum.VisibleOnOnePage ||
                    module.Pages.Count == 1 && module.CrossPagesMode == CrossPagesModeEnum.VisibleOnAllSelectedPages)
                {
                    module.Delete();
                }

                //if (module.CrossPagesMode == CrossPagesModeEnum.VisibleOnAllPages && (module.CrossPagesMode != CrossPagesModeEnum.VisibleOnAllPagesInTemplate || module.Template == null) && module.Pages.Count == 1)
                //{
                //    module.Delete();
                //}
                //else if (module.CrossPagesMode != CrossPagesModeEnum.VisibleOnAllPages && module.CrossPagesMode != CrossPagesModeEnum.VisibleOnAllPagesInTemplate)
                //{
                //    module.Delete();
                //}
            }
            base.Delete();
            UnpublishedItem.Set(this, "Page", ChangeStatusEnum.Deleted);
        }
Esempio n. 6
0
 public override void Delete()
 {
     base.Delete();
     UnpublishedItem.Set(this, "Folder", ChangeStatusEnum.Deleted);
 }