Exemplo n.º 1
0
        public static string InsertStylesheetReferences(Federation federation, FlexWikiWebApplication wikiApplication)
        {
            string answer = MainStylesheetReference();
            QualifiedTopicRevision revision = GetTopicRevision(federation);
            string styleSheet = null;
            if (revision.IsQualified)
            {
                try
                {
                    styleSheet = federation.GetTopicPropertyValue(revision, "Stylesheet");
                }
                catch (FlexWikiAuthorizationException)
                {
                    // We don't want to blow up just because we can't read the topic. Continue as
                    // if there was no stylesheet
                }
            }

            if (!string.IsNullOrEmpty(styleSheet))
            {
                answer += GetStylesheetLink(styleSheet, DefaultStylesheet, false);
            }
            else
            {
                string styleOverride = wikiApplication.ApplicationConfiguration.OverrideStylesheet;
                if (styleOverride != null && styleOverride.Length > 0)
                {
                    answer += GetStylesheetLink(styleOverride, DefaultStylesheet, false);
                }
            }

            foreach(AlternateStylesheetConfiguration altStyle in wikiApplication.ApplicationConfiguration.AlternateStylesheets)
            {
                answer += GetStylesheetLink(altStyle.Href, altStyle.Title, true);
            }
            return answer;
        }