public IHttpActionResult GetItems([FromUri] string path, int moduleId = -1)
        {
            var gallery = new BetterImageGalleryService(moduleId);
            var items   = gallery.GetImages(path);

            return(Ok(items));
        }
        protected override void RenderContents(HtmlTextWriter output)
        {
            var partialString = string.Empty;

            var gallery = new BetterImageGalleryService(ModuleId);

            gallery.Setup();

            if (gallery.Error != null)
            {
                partialString = RazorBridge.RenderPartialToString(new RazorBridgePartialModel
                {
                    CustomTemplate  = "_BetterImageGallery_Error",
                    DefaultTemplate = "_BetterImageGallery_Error",
                    Controller      = "BetterImageGallery",
                    Data            = gallery.Error,
                    Page            = Page
                });
            }
            else
            {
                var items = gallery.GetImages();

                partialString = RazorBridge.RenderPartialToString(new RazorBridgePartialModel
                {
                    CustomTemplate  = BigConfig.Layout,
                    DefaultTemplate = "_BetterImageGallery",
                    Controller      = "BetterImageGallery",
                    Data            = items,
                    Page            = Page
                });
            }

            output.Write(partialString);
        }