Exemple #1
0
        protected virtual ThemeManifestModel PrepareThemeManifestModel(ThemeManifest manifest, ThemeSettings themeSettings)
        {
            var model = new ThemeManifestModel
            {
                Name            = manifest.ThemeName,
                BaseTheme       = manifest.BaseThemeName,
                Title           = manifest.ThemeTitle,
                Description     = manifest.PreviewText,
                Author          = manifest.Author,
                Url             = manifest.Url,
                Version         = manifest.Version,
                IsMobileTheme   = manifest.MobileTheme,
                SupportsRtl     = manifest.SupportRtl,
                PreviewImageUrl = manifest.PreviewImageUrl.HasValue() ? manifest.PreviewImageUrl : "{0}/{1}/preview.png".FormatInvariant(manifest.Location, manifest.ThemeName),
                IsActive        = manifest.MobileTheme ? themeSettings.DefaultMobileTheme == manifest.ThemeName : themeSettings.DefaultDesktopTheme == manifest.ThemeName,
                State           = manifest.State
            };

            if (HostingEnvironment.VirtualPathProvider.FileExists("{0}/{1}/Views/Shared/ConfigureTheme.cshtml".FormatInvariant(manifest.Location, manifest.ThemeName)))
            {
                model.IsConfigurable = true;
            }

            return(model);
        }
Exemple #2
0
        protected virtual ThemeManifestModel PrepareThemeManifestModel(ThemeManifest manifest, ThemeSettings themeSettings)
        {
            var model = new ThemeManifestModel
            {
                Name            = manifest.ThemeName,
                BaseTheme       = manifest.BaseThemeName,
                Title           = manifest.ThemeTitle,
                Description     = manifest.PreviewText,
                Author          = manifest.Author,
                Url             = manifest.Url,
                Version         = manifest.Version,
                PreviewImageUrl = manifest.PreviewImageUrl.HasValue() ? manifest.PreviewImageUrl : "{0}{1}/preview.png".FormatInvariant(manifest.Location.EnsureEndsWith("/"), manifest.ThemeName),
                IsActive        = themeSettings.DefaultTheme == manifest.ThemeName,
                State           = manifest.State,
            };

            model.IsConfigurable = HostingEnvironment.VirtualPathProvider.FileExists("{0}{1}/Views/Shared/ConfigureTheme.cshtml".FormatInvariant(manifest.Location.EnsureEndsWith("/"), manifest.ThemeName));

            return(model);
        }
        protected virtual ThemeManifestModel PrepareThemeManifestModel(ThemeManifest manifest, ThemeSettings themeSettings)
        {
            var model = new ThemeManifestModel
            {
                Name            = manifest.ThemeName,
                Title           = manifest.ThemeTitle,
                Description     = manifest.PreviewText,
                Author          = manifest.Author,
                Version         = manifest.Version,
                IsMobileTheme   = manifest.MobileTheme,
                SupportsRtl     = manifest.SupportRtl,
                PreviewImageUrl = manifest.PreviewImageUrl.HasValue() ? manifest.PreviewImageUrl : "{0}/{1}/preview.png".FormatInvariant(manifest.Location, manifest.ThemeName),
                IsActive        = manifest.MobileTheme ? themeSettings.DefaultMobileTheme == manifest.ThemeName : themeSettings.DefaultDesktopTheme == manifest.ThemeName
            };

            if (System.IO.File.Exists(System.IO.Path.Combine(manifest.Path, "Views\\Shared\\ConfigureTheme.cshtml")))
            {
                model.IsConfigurable = true;
            }

            return(model);
        }