$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>"; } else { echo $tn->FileList;
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>"; }