/// <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)); }
/// <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); }
/// <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")); }
/// <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); } }
/// <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")); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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"), ""))); }
/// <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")); }
/// <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")); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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")); }
/// <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)); }
/// <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")); }
/// <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)); }
/// <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"), "")); }
/// <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)); }
/// <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"), ""))); }
/// <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"), "")); }