diff --git a/README.md b/README.md index 2f9352ea..bc23087e 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * updates es translation * custom headers/footers are now optional and disabled by default * fixes problems with folder recognition in the JS version +* fixes include problems in PHP version +* fixes path problems on servers running on Windows in PHP version ### v0.17 - *2011-11-28* diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index d0b7035e..ba29658f 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -106,6 +106,7 @@ var H5AI_CONFIG = { * Show thumbnails for image files. */ "showThumbs": true, + "thumbTypes": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"], /* * Requires PHP on the server. diff --git a/src/_h5ai/config.php b/src/_h5ai/config.php index f901fa31..8096a5b2 100644 --- a/src/_h5ai/config.php +++ b/src/_h5ai/config.php @@ -12,9 +12,8 @@ $H5AI_CONFIG = array(); /* * This configuration assumes that h5ai is installed * in the webroot directory of the Apache server. - * Assumed to end with a slash. */ -$H5AI_CONFIG["ROOT_ABS_PATH"] = dirname(dirname(str_replace('\\', '/', __FILE__))); +$H5AI_CONFIG["ROOT_ABS_PATH"] = safe_dirname(safe_dirname(__FILE__)); /* * Files/folders that should not be listed. Specified diff --git a/src/_h5ai/php/inc/Crumb.php b/src/_h5ai/php/inc/Crumb.php index 9d10ab00..76ac81b8 100644 --- a/src/_h5ai/php/inc/Crumb.php +++ b/src/_h5ai/php/inc/Crumb.php @@ -11,7 +11,7 @@ class Crumb { $this->parts = array(); $href = $h5ai->getAbsHref(); - while ($href !== "/" && $href !== "//") { + while ($href !== "/") { $this->parts[] = $href; $href = safe_dirname($href, true); } diff --git a/src/_h5ai/php/inc/Extended.php b/src/_h5ai/php/inc/Extended.php index f2b8ee7c..e8a47878 100644 --- a/src/_h5ai/php/inc/Extended.php +++ b/src/_h5ai/php/inc/Extended.php @@ -5,7 +5,7 @@ require_h5ai("/php/inc/Thumbnail.php"); class Entry { - private $h5ai, $label, $absPath, $absHref, $date, $isFolder, $type, $size, $thumbTypes; + private $h5ai, $label, $absPath, $absHref, $date, $isFolder, $type, $size; public function __construct($h5ai, $absPath, $absHref, $type = null, $label = null) { @@ -25,8 +25,6 @@ class Entry { $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"); } @@ -59,7 +57,7 @@ class Entry { } } } - if ($this->h5ai->showThumbs() && in_array($this->type, $this->thumbTypes)) { + if ($this->h5ai->showThumbs() && in_array($this->type, $this->h5ai->getThumbTypes())) { $imgClass = " class='thumb' "; $thumbnail = new Thumbnail($this->h5ai, $this->absHref, "square", 16, 16); $thumbnail->create(); @@ -138,7 +136,7 @@ class Extended { } - public function generateHeaders() { + private function generateHeaders() { $html = "\t