$DirectoryID = ForceIncomingString("did", ""); $tn = new Thumbnailer(); $tn->ConfigFile = "_config.xml"; $tn->ErrorManager =& $ErrorManager; $tn->DefineProperties(); if ($PageAction == "Generate") { $ImagesLeftToThumbnail = $tn->GenerateThumbnails(); if (count($ImagesLeftToThumbnail) == 0) { $PageAction = "Complete"; } } echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-ca\">\r\n<head>\r\n<title>Lussumo Thumbnailer</title>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $tn->StyleUrl . "\" />\r\n<script language=\"Javascript\" type=\"text/javascript\">\r\n\t//<![CDATA[\r\n function CheckController(formName, controller, controlled) {\r\n var frm = document[formName];\r\n var CheckedStatus = controller.checked;\r\n if (frm[controlled]) {\r\n if (frm[controlled].length) {\r\n for (i = 0; i < frm[controlled].length; i++) {\r\n frm[controlled][i].checked = CheckedStatus;\r\n }\r\n } else {\r\n frm[controlled].checked = CheckedStatus;\r\n }\r\n }\r\n }\r\n\t//]]>\r\n</script>\r\n</head>\r\n<body>"; if ($PageAction == "Generate") { $p = new Parameters(); $ExcludeByPrefix = "ImageID"; $p->DefineCollection($_GET, $ExcludeByPrefix, 0, 1); $p->DefineCollection($_POST, $ExcludeByPrefix, 0, 1); $p->Set("PageAction", "Generate"); $p->Remove("btnSubmit"); echo "<form name=\"frmThumbnailer\" method=\"get\" action=\"" . $tn->SelfUrl . "\">" . $p->GetHiddenInputs(); $ImagesLeft = count($ImagesLeftToThumbnail); for ($i = 0; $i < $ImagesLeft; $i++) { echo "<input type=\"hidden\" name=\"ImageID[]\" value=\"" . $ImagesLeftToThumbnail[$i] . "\" />"; } echo "</form><script language=\"Javascript\">\r\n setTimeout(\"document.frmThumbnailer.submit();\",300);\r\n </script>\r\n <h1>Lussumo Thumbnailer</h1>\r\n <a class=\"BackToFilebrowser\" href=\"./index.php\">Back to Filebrowser</a>\r\n <div class=\"Introduction\">\r\n Processing thumbnail batch\r\n <br /><a href=\"#\" onclick=\"document.frmThumbnailer.submit();\">" . FormatPlural($ImagesLeft, "item", "items") . " remaining in batch...</a>\r\n </div>"; } elseif ($PageAction == "Complete") { echo "<h1>Lussumo Thumbnailer</h1>\r\n <a class=\"BackToFilebrowser\" href=\"./index.php\">Back to Filebrowser</a>\r\n <div class=\"Introduction\">\r\n Batch Process Completed Successfully.\r\n <br /><a href=\"" . $tn->SelfUrl . ($DirectoryID != "" ? "?did=" . $DirectoryID : "") . "\">Click here to continue</a>\r\n </div>"; } else { echo "<h1>Lussumo Thumbnailer</h1>\r\n <a class=\"BackToFilebrowser\" href=\"./index.php" . ($DirectoryID != "" ? "?did=" . $DirectoryID : "") . "\">Back to Filebrowser</a>\r\n <div class=\"Introduction\">\r\n <strong>This is the Lussumo Thumbnailer.</strong>\r\n <br />You can use this application to create thumbnail images for your Lussumo Filebrowser.\r\n <br /><br />Choose the images for which you would like to create thumbnails and click the \"Generate Thumbnails\" button.\r\n </div>\r\n <div class=\"Body\">\r\n " . $tn->FolderList; if ($tn->FileList == "") { echo "<div class=\"Container Thumbnailed\">\r\n <h2>No Images Found</h2>\r\n <p>There were no thumbnail candidate images found in the selected folder.</p>\r\n </div>";
$Menu .= FormatMenuItem("NavNextItem", $Params, "Next", "Next", $NextItem); $Params->Add("smf", 1); $Params->Set("fid", $NextItem); $Menu .= FormatMenuItem("NavNextItemGroup", $Params, ">>", "Next " . $Config->FilesPerPage, $NextItem); $Params->Remove("smf"); $Params->Set("fid", $LastItem); $Menu .= FormatMenuItem("NavLastItem", $Params, ">|", "Last", $LastItem); // ---------------------------------- // 7. WRITE THE REMAINDER OF THE PAGE // ---------------------------------- echo "<ul class=\"NavMenu MainMenu\">" . $Menu . "</ul>\r\n"; echo "<div class=\"DisplayContainer\">\r\n"; // If a file has not been requested, write out the introductory paragraph (if there is one) if ($Config->FileID == 0 && $Config->PageIntroduction != "" && ($Config->CurrentWorkingDirectory == $Config->CurrentBrowsingDirectory || $Config->CurrentWorkingDirectory != $Config->CurrentBrowsingDirectory && $Config->UsePageIntroductionInSubFolders)) { echo "<div class=\"Introduction\">" . $Config->PageIntroduction . "</div>\r\n"; } // Write out the selected files echo $FileDisplay; echo "</div>\r\n" . "<ul class=\"NavMenu SubMenu\">\r\n" . $Menu . "</ul>\r\n" . "<div class=\"ListContainer\">\r\n"; // Write out the file/folder listing if (trim($FileList) == "") { echo "<div class=\"ListEmpty\">No files or folders could be found.</div>\r\n"; } else { echo $FileList; } // Write out the page footer echo "</div>\r\n" . "<!-- <div class=\"Foot\">\r\n <form name=\"frmPager\" action=\"" . CurrentUrl() . "\" method=\"get\">"; $p = new Parameters(); $p->DefineCollection($_GET); $p->Remove("fpp"); echo $p->GetHiddenInputs() . "<div class=\"Pager\">\r\n <div class=\"PagerLabel\">Files/Page: </div>\r\n <div class=\"PagerValue\"><input type=\"text\" name=\"fpp\" class=\"PagerInput\" value=\"" . $Config->FilesPerPage . "\" onchange=\"document.frmPager.submit();\" /></div>\r\n </div>\r\n </form>\r\n <div class=\"ApplicationInformation\"><a href=\"http://lussumo.com\">Lussumo</a> <a href=\"http://thefilebrowser.com\">Filebrowser</a> " . $Config->Version . " © " . $Config->Date . "</div>\r\n <div class=\"DeveloperInformation\">Developed by " . $Config->Developer . "</div>\r\n </div>\r\n </div> --!>\r\n </body>\r\n</html>";
function FormatImageList($List, $Title, $Name) { $p = new Parameters(); $ExcludeByPrefix = "ImageID"; $p->DefineCollection($_GET, $ExcludeByPrefix, 0, 1); $p->DefineCollection($_POST, $ExcludeByPrefix, 0, 1); $p->Set("PageAction", "Generate"); $p->Remove("btnSubmit"); return "<div class=\"Container " . $Name . "\">\r\n\t\t\t<form name=\"frm" . $Name . "\" method=\"get\" action=\"" . $this->SelfUrl . "\">" . $p->GetHiddenInputs() . "<h2>" . $Title . "</h2>\r\n\t\t\t<table class=\"FileTable\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t<tr class=\"ListItem\">\r\n\t\t\t\t\t<th class=\"ItemOption\">" . GetBasicCheckBox($Name . "_ItemController", 1, 0, " onclick=\"CheckController('frm" . $Name . "', this, 'ImageID[]')\"") . "</th>\r\n\t\t\t\t\t<th class=\"ItemName\">Image</th>\r\n\t\t\t\t\t<th class=\"ItemSize\">Size</th>\r\n\t\t\t\t\t<th class=\"ItemDate\">Date</th>\r\n\t\t\t\t</tr>" . $List . "</table>\r\n\t\t\t<div class=\"ButtonContainer\">\r\n\t\t\t\t<input type=\"submit\" name=\"btnSubmit\" value=\"Generate Thumbnails\" class=\"Button\" />\r\n\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>"; }