h5ai = $h5ai; $this->label = $label !== null ? $label : $this->h5ai->getLabel($absHref); $this->absPath = $this->h5ai->normalizePath($absPath, false); $this->isFolder = is_dir($this->absPath); $this->absHref = $this->h5ai->normalizePath($absHref, $this->isFolder); $this->date = filemtime($this->absPath); if ($this->isFolder) { $this->type = $type !== null ? $type : "folder"; $this->size = ""; } else { $this->type = $type !== null ? $type : $this->h5ai->getType($this->absPath); $this->size = filesize($this->absPath); } $this->thumbTypes = array("bmp", "gif", "ico", "image", "jpg", "png", "tiff"); } public function isFolder() { return $this->isFolder; } public function toHtml() { $classes = "entry " . ($this->isFolder ? "folder " : "file ") . $this->type; $imgClass = ""; $img = $this->type; $smallImg = $this->h5ai->icon($this->type); $bigImg = $this->h5ai->icon($this->type, true); $hint = ""; if ($this->isFolder && $this->type !== "folder-parent") { $code = $this->h5ai->getHttpCode($this->absHref); $classes .= " checkedHttpCode"; if ($code !== "h5ai") { if ($code === 200) { $img = "folder-page"; $smallImg = $this->h5ai->icon("folder-page"); $bigImg = $this->h5ai->icon("folder-page", true); } else { $classes .= " error"; $hint = " " . $code . " "; } } } if ($this->h5ai->showThumbs() && in_array($this->type, $this->thumbTypes)) { $imgClass = " class='thumb' "; $thumbnail = new Thumbnail($this->h5ai, $this->absHref, "square", 16, 16); $thumbnail->create(); $smallImg = file_exists($thumbnail->getPath()) ? $thumbnail->getHref() : $thumbnail->getLiveHref(); $thumbnail = new Thumbnail($this->h5ai,$this->absHref, "rational", 96, 46); $thumbnail->create(); $bigImg = file_exists($thumbnail->getPath()) ? $thumbnail->getHref() : $thumbnail->getLiveHref(); } $html = "\t