public ActionResult Gallery(RenderWidgetViewModel request) { var folderIdString = Request.QueryString[ImagesGalleryModuleConstants.GalleryFolderIdQueryParameterName]; if (!string.IsNullOrWhiteSpace(folderIdString) && request.Options != null && request.Options.Any(o => o.Type == OptionType.Custom && o.CustomOption != null && o.CustomOption.Identifier == MediaManagerFolderOptionProvider.Identifier && o.Key == ImagesGalleryModuleConstants.OptionKeys.GalleryFolder)) { Guid folderId; if (Guid.TryParse(folderIdString, out folderId)) { var albumRequest = new GetAlbumCommandRequest { FolderId = folderId, WidgetViewModel = request, RenderBackUrl = true }; var albumViewModel = GetCommand<GetAlbumCommand>().ExecuteCommand(albumRequest); return View("Album", albumViewModel); } } var listViewModel = GetCommand<GetGalleryAlbumsCommand>().ExecuteCommand(request); return View("List", listViewModel); }
public ActionResult Album(RenderWidgetViewModel request) { var albumRequest = new GetAlbumCommandRequest { FolderId = request.GetOptionValue<Guid?>(ImagesGalleryModuleConstants.OptionKeys.AlbumFolder), WidgetViewModel = request, RenderBackUrl = false }; var albumViewModel = GetCommand<GetAlbumCommand>().ExecuteCommand(albumRequest); return View("Album", albumViewModel); }