Ejemplo n.º 1
0
        private void PagePreRender(object sender, EventArgs e)
        {
            HttpContext context = HttpContext.Current;

            if (IsValid(context.Request))
            {
                Page page = HttpContext.Current.Handler as Page;

                if (page == null)
                {
                    return;
                }

                // TODO: Get Javascript and CSS from plugin properties
                string js  = EmbeddedResources.GetString(string.Format("{0}console.js", EmbeddedResources.BasePath));
                string css = EmbeddedResources.GetString(string.Format("{0}console.css", EmbeddedResources.BasePath));
                string url =
                    string.Format(
                        "/ControlPanel/Utility/RevertTheme.aspx?ThemeTypeID={0}&ThemeContextID={1}&ThemeName={2}",
                        SiteThemeContext.Instance().ThemeTypeID, Guid.Empty, CSContext.Current.SiteTheme);

                js += string.Format(@"
$(function () {{
    $.fourroads.plugins.themeConsole.register({{
        urls: {{
            modal: '{0}'
        }}
    }});
}})", url);
                Head.AddRawContent(string.Format(@"<style type=""text/css"">{0}</style>", css), HttpContext.Current);
                page.ClientScript.RegisterStartupScript(GetType(), "cacheconsole", js, true);
            }
        }
Ejemplo n.º 2
0
        public void Initialize()
        {
            _utilities =
                Telligent.Evolution.Extensibility.Version1.PluginManager.GetSingleton <IThemeUtilities>();

            if (_utilities == null || !_utilities.EnableThemePageControls)
            {
                return;
            }

            ContentFragmentPageService           = Services.Get <IContentFragmentPageService>();
            ContentFragmentScopedPropertyService = Services.Get <IContentFragmentScopedPropertyService>();
            ThemeTypeService        = Services.Get <IThemeTypeService>();
            _userThemeTypeId        = CSContext.Current.SiteSettings.UserThemeTypeID;
            _siteThemeTypeId        = SiteThemeContext.Instance().ThemeTypeID;
            _groupThemeTypeId       = CSContext.Current.SiteSettings.GroupThemeTypeID;
            _blogThemeTypeId        = CSContext.Current.SiteSettings.BlogThemeTypeID;
            _themeContextId         = Guid.Empty;
            _siteThemeName          = CSContext.Current.SiteTheme;
            _themeConfigurationData = ThemeConfigurationDatas.GetThemeConfigurationData(_siteThemeTypeId,
                                                                                        _themeContextId,
                                                                                        _siteThemeName, false);
            _themeFileFolders = new List <string>
            {
                Constants.ThemeStylesheetFiles,
                Constants.ThemePrintStylesheetFiles,
                Constants.ThemeJavascriptFiles,
                Constants.ThemeGeneralFiles
            };
        }
Ejemplo n.º 3
0
        public void Initialize()
        {
            IThemeUtilities utilites =
                Telligent.Evolution.Extensibility.Version1.PluginManager.GetSingleton <IThemeUtilities>();

            if (utilites == null || !utilites.EnableSourceMap)
            {
                return;
            }

            _siteThemeTypeId = SiteThemeContext.Instance().ThemeTypeID;
            _themeContextId  = Guid.Empty;
            _siteThemeName   = CSContext.Current.SiteTheme;

            CentralizedFileStorage.Events.AfterCreate += AfterCreateStylesheet;
            CentralizedFileStorage.Events.AfterUpdate += AfterUpdateStylesheet;
        }