Exemplo n.º 1
0
     $thumbnail->create(1);
     if (file_exists($thumbnail->getPath())) {
         Image::showImage($thumbnail->getPath());
     } else {
         $image = new Image();
         $image->setSource($srcAbsPath);
         $image->thumb($mode, $width, $height);
         $image->showDest();
     }
 } else {
     if ($action === "tree") {
         list($href) = checkKeys(array("href"));
         require_once "inc/Tree.php";
         $absHref = trim($href);
         $absPath = $h5ai->getAbsPath($absHref);
         $tree = new TreeEntry($h5ai, $absPath, $absHref);
         $tree->loadContent();
         echo $tree->contentToHtml();
     } else {
         if ($action === "zip") {
             fail(0, "zipped download is disabled", !$options["zippedDownload"]);
             list($hrefs) = checkKeys(array("hrefs"));
             require_once "inc/ZipIt.php";
             $zipit = new ZipIt($h5ai);
             $hrefs = explode(":", trim($hrefs));
             $zipFile = $zipit->zip($hrefs);
             if ($zipFile === false) {
                 fail(2, "something went wrong while building the zip");
             }
             header("Content-Disposition: attachment; filename=\"h5ai-selection.zip\"");
             header("Content-Type: application/force-download");
Exemplo n.º 2
0
 public function toHtml()
 {
     $options = $this->h5ai->getOptions();
     if ($options["showTree"] === false) {
         return "";
     }
     $tree = new TreeEntry($this->h5ai, $this->h5ai->getAbsPath(), $this->h5ai->getAbsHref());
     $tree->loadContent();
     $root = $tree->getRoot();
     return "<section id='tree'>\n" . $root->toHtml() . "</section>\n";
 }