Esempio n. 1
0
        /// <summary>
        /// Gets the page change moderation mode for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static ChangeModerationMode GetModerationMode(string wiki)
        {
            string value = SettingsTools.GetString(GetProvider(wiki).GetSetting("ChangeModerationMode"),
                                                   ChangeModerationMode.None.ToString());

            return((ChangeModerationMode)Enum.Parse(typeof(ChangeModerationMode), value, true));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets or sets the main URL of the Wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        /// <returns>The main URL associated with the given wiki.</returns>
        public static string GetMainUrl(string wiki)
        {
            string s = SettingsTools.GetString(GetProvider(wiki).GetSetting("MainUrl"), "http://www.server.com/");

            if (!s.EndsWith("/"))
            {
                s += "/";
            }
            return(s);
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the name of the theme for the given wiki for the given namespace.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        /// <param name="nspace">The namespace (<c>null</c> for the root).</param>
        /// <returns>The name of the theme.</returns>
        public static string GetTheme(string wiki, string nspace)
        {
            if (!string.IsNullOrEmpty(nspace))
            {
                nspace = Pages.FindNamespace(wiki, nspace).Name;
            }
            string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : "");

            return(SettingsTools.GetString(GetProvider(wiki).GetSetting(propertyName), "standard|Default"));
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the Account Activation Mode for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static AccountActivationMode GetAccountActivationMode(string wiki)
        {
            string value = SettingsTools.GetString(GetProvider(wiki).GetSetting("AccountActivationMode"), "EMAIL");

            switch (value.ToLowerInvariant())
            {
            case "email":
                return(AccountActivationMode.Email);

            case "admin":
                return(AccountActivationMode.Administrator);

            case "auto":
                return(AccountActivationMode.Auto);

            default:
                return(AccountActivationMode.Email);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Gets the Discussion Permissions for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetDiscussionPermissions(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DiscussionPermissions"), "PAGE"));
 }
Esempio n. 6
0
 /// <summary>
 /// Sets if to disable or not the Breadcrumbs Trail in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <param name="disableBreadcrumbsTrail">If set to <c>true</c> disables breadcrumbs trail.</param>
 public static void SetDisableBreadcrumbsTrail(string wiki, bool disableBreadcrumbsTrail)
 {
     GetProvider(wiki).SetSetting("DisableBreadcrumbsTrail", SettingsTools.PrintBool(disableBreadcrumbsTrail));
 }
Esempio n. 7
0
 /// <summary>
 /// Gets the max number of recent changes to log for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static int GetMaxRecentChanges(string wiki)
 {
     return(SettingsTools.GetInt(GetProvider(wiki).GetSetting("MaxRecentChanges"), 100));
 }
Esempio n. 8
0
 /// <summary>
 /// Gets a value indicating whether to display gravatars or not for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static bool GetDisplayGravatars(string wiki)
 {
     return(SettingsTools.GetBool(GetProvider(wiki).GetSetting("DisplayGravatars"), true));
 }
Esempio n. 9
0
 /// <summary>
 /// Gets the Master Password of the given wiki, used to encrypt the Users data.
 /// </summary>
 public static string GetMasterPassword()
 {
     return((string)Cache.GetCachedItem("MasterPassword", () => SettingsTools.GetString(Provider.GetSetting("MasterPassword"), "")));
 }
Esempio n. 10
0
 /// <summary>
 /// Gets the name of the default Administrators group in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetAdministratorsGroup(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("AdministratorsGroup"), "Administrators"));
 }
Esempio n. 11
0
 /// <summary>
 /// Gets the name of the default Users group in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetUsersGroup(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("UsersGroup"), "Users"));
 }
Esempio n. 12
0
 /// <summary>
 /// Gets a value specifying whether or not to disable concurrent editing of Pages for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static bool GetDisableConcurrentEditing(string wiki)
 {
     return(SettingsTools.GetBool(GetProvider(wiki).GetSetting("DisableConcurrentEditing"), false));
 }
Esempio n. 13
0
 /// <summary>
 /// Gets a value indicating whether to use the Visual editor as default for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static bool GetUseVisualEditorAsDefault(string wiki)
 {
     return(SettingsTools.GetBool(GetProvider(wiki).GetSetting("UseVisualEditorAsDefault"), false));
 }
Esempio n. 14
0
 /// <summary>
 /// Gets the # of Backups that are kept in the specified wiki. Older backups are deleted after Page editing.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <remarks>-1 indicates that no backups are deleted.</remarks>
 public static int GetKeptBackupNumber(string wiki)
 {
     return(SettingsTools.GetInt(GetProvider(wiki).GetSetting("KeptBackupNumber"), -1));
 }
Esempio n. 15
0
 /// <summary>
 /// Sets if to process single line breaks in WikiMarkup for the given wiki or not.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <param name="processSingleLineBreacks">If set to <c>true</c> processes single line breacks.</param>
 public static void SetProcessSingleLineBreaks(string wiki, bool processSingleLineBreacks)
 {
     GetProvider(wiki).SetSetting("ProcessSingleLineBreaks", SettingsTools.PrintBool(processSingleLineBreacks));
 }
Esempio n. 16
0
 /// <summary>
 /// Gets a value indicating whether or not to process single line breaks in WikiMarkup for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static bool GetProcessSingleLineBreaks(string wiki)
 {
     return(SettingsTools.GetBool(GetProvider(wiki).GetSetting("ProcessSingleLineBreaks"), false));
 }
Esempio n. 17
0
 /// <summary>
 /// Sets if the editor should auto-generate page names from the title for the given wiki or not.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <param name="autoGeneratePageNames">If set to <c>true</c> auto generates page names.</param>
 public static void SetAutoGeneratePageNames(string wiki, bool autoGeneratePageNames)
 {
     GetProvider(wiki).SetSetting("AutoGeneratePageNames", SettingsTools.PrintBool(autoGeneratePageNames));
 }
Esempio n. 18
0
 /// <summary>
 /// Gets a value indicating whether the editor should auto-generate page names from the title for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static bool GetAutoGeneratePageNames(string wiki)
 {
     return(SettingsTools.GetBool(GetProvider(wiki).GetSetting("AutoGeneratePageNames"), true));
 }
Esempio n. 19
0
 /// <summary>
 /// Sets if to disable or not concurrent editing of Pages for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <param name="disableConcurrentEditing">If set to <c>true</c> disable concurrent editing.</param>
 public static void SetDisableConcurrentEditing(string wiki, bool disableConcurrentEditing)
 {
     GetProvider(wiki).SetSetting("DisableConcurrentEditing", SettingsTools.PrintBool(disableConcurrentEditing));
 }
Esempio n. 20
0
        /// <summary>
        /// Gets the list of allowed file types for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static string[] GetAllowedFileTypes(string wiki)
        {
            string raw = SettingsTools.GetString(GetProvider(wiki).GetSetting("AllowedFileTypes"), "jpg|jpeg|gif|png|tif|tiff|bmp|svg|htm|html|zip|rar|pdf|txt|doc|xls|ppt|docx|xlsx|pptx");

            return(raw.ToLowerInvariant().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
        }
Esempio n. 21
0
 /// <summary>
 /// Sets if to use or not the Visual editor as default for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <param name="useVisualEditorAsDefault">If set to <c>true</c> use visual editor as default.</param>
 public static void SetUseVisualEditorAsDefault(string wiki, bool useVisualEditorAsDefault)
 {
     GetProvider(wiki).SetSetting("UseVisualEditorAsDefault", SettingsTools.PrintBool(useVisualEditorAsDefault));
 }
Esempio n. 22
0
        /// <summary>
        /// Gets the file download count filter mode for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static FileDownloadCountFilterMode GetFileDownloadCountFilterMode(string wiki)
        {
            string raw = SettingsTools.GetString(GetProvider(wiki).GetSetting("FileDownloadCountFilterMode"), FileDownloadCountFilterMode.CountAll.ToString());

            return((FileDownloadCountFilterMode)Enum.Parse(typeof(FileDownloadCountFilterMode), raw));
        }
Esempio n. 23
0
 /// <summary>
 /// Gets or sets the Title of the Wiki.
 /// </summary>
 public static string GetWikiTitle(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("WikiTitle"), "ScrewTurn Wiki"));
 }
Esempio n. 24
0
        /// <summary>
        /// Gets the file download count extension filter for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static string[] GetFileDownloadCountFilter(string wiki)
        {
            string raw = SettingsTools.GetString(GetProvider(wiki).GetSetting("FileDownloadCountFilter"), "");

            return(raw.ToLowerInvariant().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
        }
Esempio n. 25
0
 /// <summary>
 /// Gets the name of the default Anonymous users group in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetAnonymousGroup(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("AnonymousGroup"), "Anonymous"));
 }
Esempio n. 26
0
 /// <summary>
 /// Gets a value specifying whether script tags are allowed or not in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static bool GetScriptTagsAllowed(string wiki)
 {
     return(SettingsTools.GetBool(GetProvider(wiki).GetSetting("ScriptTagsAllowed"), false));
 }
Esempio n. 27
0
 /// <summary>
 /// Gets the Master Password of the given wiki, used to encrypt the Users data.
 /// </summary>
 public static string GetMasterPassword()
 {
     return(SettingsTools.GetString(Provider.GetSetting("MasterPassword"), ""));
 }
Esempio n. 28
0
 /// <summary>
 /// Sets if script tags are allowed or not in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <param name="scriptTagAllowed">If set to <c>true</c> script tag are allowed.</param>
 public static void SetScriptTagsAllowed(string wiki, bool scriptTagAllowed)
 {
     GetProvider(wiki).SetSetting("ScriptTagsAllowed", SettingsTools.PrintBool(scriptTagAllowed));
 }
Esempio n. 29
0
 /// <summary>
 /// Gets the Master Password of the given wiki, used to encrypt the Users data.
 /// </summary>
 public static string GetMasterPassword(IGlobalSettingsStorageProviderV60 provider)
 {
     return((string)Cache.GetCachedItem("MasterPassword", () => SettingsTools.GetString(provider.GetSetting("MasterPassword"), "")));
 }
Esempio n. 30
0
 /// <summary>
 /// Gets the IP/Host filter for page editing for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetIpHostFilter(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("IpHostFilter"), ""));
 }