From c459bb82985cd671a26d3696e68f96cd1bd67196 Mon Sep 17 00:00:00 2001 From: Ozan Kurt Date: Fri, 22 Apr 2016 16:00:14 +0300 Subject: [PATCH] Update DirectoryLister.php --- resources/DirectoryLister.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/resources/DirectoryLister.php b/resources/DirectoryLister.php index c038008d8..df1f64e7f 100644 --- a/resources/DirectoryLister.php +++ b/resources/DirectoryLister.php @@ -297,7 +297,19 @@ public function getThemeName() { public function externalLinksNewWindow() { return $this->_config['external_links_new_window']; } - + + + /** + * Returns use real url for indexed directories + * + * @return boolean Returns true if in config is enabled links for directories with index, false if not + * @access public + */ + public function linksForDirsWithIndex() + { + return $this->_config['links_for_dirs_with_index']; + } + /** * Returns the path to the chosen theme directory @@ -619,6 +631,12 @@ protected function _readDirectory($directory, $sort = 'natcase') { } else { $urlPath = $urlPath; } + + if ($this->linksForDirsWithIndex()) { + if ($this->containsIndex($relativePath)) { + $urlPath = $relativePath; + } + } // Add the info to the main array $directoryArray[pathinfo($relativePath, PATHINFO_BASENAME)] = array(