예제 #1
0
        /// <summary>
        /// Loads the content configuration.
        /// </summary>
        /// <param name="currentWiki">The wiki.</param>
        private void LoadContentConfig(string currentWiki)
        {
            string[] theme = Settings.GetTheme(currentWiki, null).Split(new char[] { '|' });
            ThemeRootSelector.SelectedProvider = theme[0];
            ThemeRootSelector.SelectedThemes   = theme[1];
            PopulateMainPages(Settings.GetDefaultPage(currentWiki));
            txtDateTimeFormat.Text = Settings.GetDateTimeFormat(currentWiki);
            PopulateDateTimeFormats();
            PopulateLanguages(Settings.GetDefaultLanguage(currentWiki));
            PopulateTimeZones(Settings.GetDefaultTimezone(currentWiki));
            txtMaxRecentChangesToDisplay.Text = Settings.GetMaxRecentChangesToDisplay(currentWiki).ToString();

            lstRssFeedsMode.SelectedIndex = -1;
            switch (Settings.GetRssFeedsMode(currentWiki))
            {
            case RssFeedsMode.FullText:
                lstRssFeedsMode.SelectedIndex = 0;
                break;

            case RssFeedsMode.Summary:
                lstRssFeedsMode.SelectedIndex = 1;
                break;

            case RssFeedsMode.Disabled:
                lstRssFeedsMode.SelectedIndex = 2;
                break;
            }

            chkEnableDoubleClickEditing.Checked = Settings.GetEnableDoubleClickEditing(currentWiki);
            chkEnableSectionEditing.Checked     = Settings.GetEnableSectionEditing(currentWiki);
            chkEnableSectionAnchors.Checked     = Settings.GetEnableSectionAnchors(currentWiki);
            chkEnablePageToolbar.Checked        = Settings.GetEnablePageToolbar(currentWiki);
            chkEnableViewPageCode.Checked       = Settings.GetEnableViewPageCodeFeature(currentWiki);
            chkEnablePageInfoDiv.Checked        = Settings.GetEnablePageInfoDiv(currentWiki);
            chkEnableBreadcrumbsTrail.Checked   = !Settings.GetDisableBreadcrumbsTrail(currentWiki);
            chkAutoGeneratePageNames.Checked    = Settings.GetAutoGeneratePageNames(currentWiki);
            chkProcessSingleLineBreaks.Checked  = Settings.GetProcessSingleLineBreaks(currentWiki);
            chkUseVisualEditorAsDefault.Checked = Settings.GetUseVisualEditorAsDefault(currentWiki);
            if (Settings.GetKeptBackupNumber(currentWiki) == -1)
            {
                txtKeptBackupNumber.Text = "";
            }
            else
            {
                txtKeptBackupNumber.Text = Settings.GetKeptBackupNumber(currentWiki).ToString();
            }
            chkDisplayGravatars.Checked = Settings.GetDisplayGravatars(currentWiki);
            txtListSize.Text            = Settings.GetListSize(currentWiki).ToString();
        }
예제 #2
0
        /// <summary>
        /// Displays the recent activity.
        /// </summary>
        private void DisplayRecentActivity()
        {
            RecentChange[] changes = RecentChanges.GetAllChanges(currentWiki);

            List <RecentChange> result = new List <RecentChange>(Settings.GetMaxRecentChangesToDisplay(currentWiki));

            foreach (RecentChange c in changes)
            {
                if (c.User == currentUser.Username)
                {
                    result.Add(c);
                }
            }

            // Sort by date/time descending
            result.Reverse();

            lblNoActivity.Visible = result.Count == 0;

            lblRecentActivity.Text = Formatter.BuildRecentChangesTable(currentWiki, result, FormattingContext.Other, null);
        }