예제 #1
0
        private async Task <HtmlElementSettings> GetElementSettingsAsync(long tenantId, long elementId)
        {
            // Get element settings
            HtmlElementSettings settings = await _elementRepository.ReadElementSettingsAsync(tenantId, elementId);

            if (settings == null)
            {
                return(null);
            }

            // Convert old format URLs into new format URLs
            IDictionary <long, HtmlPreviewImage> previewImagesByHtmlBlobId = await GetPreviewImagesByHtmlBlobId(tenantId, settings);

            HtmlTransformer transformer = new HtmlTransformer(elementId, previewImagesByHtmlBlobId, null, _stringUtilities);

            settings.Html = ReplaceKeywords(settings.Html);
            settings.Html = _stringUtilities.BlockReplace(settings.Html, "<img src=\"/elements/", ">", transformer.TransformUrl);
            settings.Html = _stringUtilities.BlockReplace(settings.Html, "<img src=\"/elementtypes/", ">", transformer.CheckUrl);

            // Return the result
            return(settings);
        }
예제 #2
0
 public Task <ShareElementSettings> ReadElementSettingsAsync(long tenantId, long elementId)
 {
     return(_elementRepository.ReadElementSettingsAsync(tenantId, elementId));
 }
 public Task <NavigationBarElementSettings> ReadElementSettingsAsync(long tenantId, long elementId)
 {
     return(_elementRepository.ReadElementSettingsAsync(tenantId, elementId));
 }