/// <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 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 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> /// 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"), "")); }
/// <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 last page indexing. /// </summary> /// <param name="wiki">The wiki.</param> /// <returns>The last page indexing DateTime.</returns> public static DateTime GetLastPageIndexing(string wiki) { return(DateTime.ParseExact(SettingsTools.GetString(GetProvider(wiki).GetSetting("LastPageIndexing"), DateTime.Now.AddYears(-10).ToString("yyyyMMddHHmmss")), "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture)); }
/// <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 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 the Defaul Page of the given wiki. /// </summary> /// <param name="wiki">The wiki.</param> public static string GetDefaultPage(string wiki) { return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DefaultPage"), "MainPage")); }
/// <summary> /// Gets the DateTime format for the given wiki. /// </summary> /// <param name="wiki">The wiki.</param> public static string GetDateTimeFormat(string wiki) { return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DateTimeFormat"), "yyyy'/'MM'/'dd' 'HH':'mm")); }
/// <summary> /// Gets the Default Timezone Id for the given wiki. /// </summary> /// <param name="wiki">The wiki.</param> public static string GetDefaultTimezone(string wiki) { return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DefaultTimezone"), null)); }
/// <summary> /// Gets the Default Language for the given wiki. /// </summary> /// <param name="wiki">The wiki.</param> public static string GetDefaultLanguage(string wiki) { return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DefaultLanguage"), "en-US")); }
/// <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 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 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> /// 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> /// 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 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 functioning mode of RSS feeds for the specified wiki. /// </summary> /// <param name="wiki">The wiki.</param> public static RssFeedsMode GetRssFeedsMode(string wiki) { string value = SettingsTools.GetString(GetProvider(wiki).GetSetting("RssFeedsMode"), RssFeedsMode.Summary.ToString()); return((RssFeedsMode)Enum.Parse(typeof(RssFeedsMode), value)); }