Exemplo n.º 1
0
        private void ExportLabels(Site site)
        {
            var labelRepository = _elementRepositoryFactory.CreateRepository(site);

            if (labelRepository.GetType() != typeof(SiteLabelRepository))
            {
                SiteLabelRepository fileRepository = new SiteLabelRepository(site);
                fileRepository.Clear();
                foreach (var item in labelRepository.Elements())
                {
                    fileRepository.Add(item);
                }
            }
        }
Exemplo n.º 2
0
        private void ExportLabels(Site site)
        {
            var labelRepository = Kooboo.CMS.Sites.Globalization.DefaultRepositoryFactory.Instance.CreateRepository(site);

            if (labelRepository.GetType() != typeof(SiteLabelRepository))
            {
                SiteLabelRepository fileRepository = new SiteLabelRepository(site);
                fileRepository.Clear();
                foreach (var item in labelRepository.Elements())
                {
                    fileRepository.Add(item);
                }
            }
        }
Exemplo n.º 3
0
        private void ExportLabels(Site site, bool includeSubSites)
        {
            var labelRepository = _elementRepositoryFactory.CreateRepository(site);

            if (labelRepository.GetType() != typeof(SiteLabelRepository))
            {
                SiteLabelRepository fileRepository = new SiteLabelRepository(site);
                fileRepository.Clear();
                foreach (var item in labelRepository.Elements())
                {
                    fileRepository.Add(item);
                }

                if (includeSubSites)
                {
                    foreach (var sub in Providers.SiteProvider.ChildSites(site))
                    {
                        ExportLabels(sub, includeSubSites);
                    }
                }
            }
        }