Exemple #1
0
        static string HTMLTableForPicturesLibrary(FileBrowseResult fbrs, int numberOfColumns, int pageNumber, int itemsPerPage, bool showThumbnails)
        {
            List <string> content = new List <string>();

            foreach (BrowseItem strFolder in fbrs.Directories)
            {
                string cellContent = "";

                // Link
                string folderPath = Path.Combine(fbrs.BaseDirectory, strFolder.Name);
                folderPath = Functions.EncodeToBase64(folderPath);

                string    folderImageSource = "/static/images/imgFolder150x75.png";
                HTMLImage image             = new HTMLImage(folderImageSource, "folderpic");
                cellContent += image.ToString();
                cellContent += "<br />";
                cellContent += Path.GetFileName(strFolder.Name);


                HTMLLink lnk = new HTMLLink("browsepics?PATH=" + folderPath, cellContent);

                content.Add(lnk.ToString());
            }
            foreach (BrowseItem strFile in fbrs.Files)
            {
                // Assemble path to file
                string filePath = Path.Combine(fbrs.BaseDirectory, strFile.Name);
                filePath = Functions.EncodeToBase64(filePath);

                string    imgSrc = "getfilethumbnail64?filename=" + filePath + "&size=medium";
                HTMLImage image  = new HTMLImage(imgSrc, "thumbnail");


                // Link
                HTMLLink lnk = new HTMLLink("viewpic?FN=" + filePath + "&size=extralarge", image.ToString());

                content.Add(lnk.ToString());
            }

            return(HTMLTable.HTMLTableWithCellContents("picturelibrarytable", numberOfColumns, content));
        }