private static void traverser_TraversingPlaceholder(object sender, CmsEventArgs e) { if (ignoreChannels != null && !String.IsNullOrEmpty(ignoreChannels[e.Channel.Guid])) { return; } // Ignore expired postings if (e.Posting.ExpiryDate <= DateTime.Now) { return; } Console.WriteLine(e.Posting.UrlModePublished + ": " + e.Placeholder.Name); var image = e.Placeholder as ImagePlaceholder; if (image != null) { var resource = CmsUtilities.ParseResourceUrl(image.Src, e.Context); var cmsGroups = CmsPermissions.ReadCmsGroupsForChannel(e.Channel); if (cmsGroups[CmsRole.Editor].Count == 0) { return; } IsResourceInTheRightFolder(e, resource, cmsGroups); } else { var resourceLinks = Regex.Matches(e.Placeholder.Datasource.RawContent, CmsUtilities.DownloadLinkPattern, RegexOptions.IgnoreCase); if (resourceLinks.Count == 0) { return; } var cmsGroups = CmsPermissions.ReadCmsGroupsForChannel(e.Channel); if (cmsGroups[CmsRole.Editor].Count == 0) { return; } foreach (Match match in resourceLinks) { var resource = CmsUtilities.ParseResourceUrl(match.Groups["url"].Value, e.Context); IsResourceInTheRightFolder(e, resource, cmsGroups); } } }