Пример #1
0
        /// <summary>
        /// Returns the specified path with website url
        /// </summary>
        /// <param name="path">Path</param>
        /// <returns>Website url with path appended</returns>
        public static string GetWebsiteUrl(string path)
        {
            // Remove the relative path
            if (path.StartsWith("~/"))
            {
                path = path.Substring(2);
            }

            // Get the website URL for the current brand, ensuring it ends with a forward slash
            string websiteUrl = WebsiteBrandManager.GetBrand().WebsiteUrl.EnsureEndsWith("/");

            // Get the application path
            string applicationPath = WebUtils.GetApplicationPath();

            // Add it to the website URL if required
            if (!websiteUrl.ToLower().EndsWith(applicationPath.ToLower()))
            {
                websiteUrl += applicationPath;
            }

            // Ensure it has a trailing slash
            websiteUrl = VirtualPathUtility.AppendTrailingSlash(websiteUrl);

            // Combine the two and return
            return(websiteUrl + path);
        }
Пример #2
0
        public static string GetIconPath(string filename)
        {
            int brandId = WebsiteBrandManager.GetBrand().BrandId.GetValueOrDefault();

            if (brandId == 0)
            {
                brandId = WebsiteBrandManager.GetMasterBrand().BrandId.GetValueOrDefault();
            }

            string path    = string.Format("~/Brands/Brand_{0}/UI/Images/Icons/{1}", brandId, filename);
            string absPath = HttpContext.Current.Server.MapPath(path);

            if (!File.Exists(absPath))
            {
                path = "~/Images/Icons/" + filename;
            }

            return(path);
        }
Пример #3
0
        /// <summary>
        /// Returns the subject prefixed with application name
        /// </summary>
        public static string GetSubject(string subject)
        {
            Brand brand = WebsiteBrandManager.GetBrand();

            return(GetSubject(subject, brand));
        }
Пример #4
0
 public static Email GetEmailTemplate(string template)
 {
     return(GetEmailTemplate(template, WebsiteBrandManager.GetBrand()));
 }