From c459bb82985cd671a26d3696e68f96cd1bd67196 Mon Sep 17 00:00:00 2001 From: Ozan Kurt Date: Fri, 22 Apr 2016 16:00:14 +0300 Subject: [PATCH 1/3] 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 c038008..df1f64e 100644 --- a/resources/DirectoryLister.php +++ b/resources/DirectoryLister.php @@ -297,7 +297,19 @@ class DirectoryLister { 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 @@ class DirectoryLister { } 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( From 14a3b2967d8ddf4ab0d458e1715a4292401eea16 Mon Sep 17 00:00:00 2001 From: Ozan Kurt Date: Fri, 22 Apr 2016 16:00:34 +0300 Subject: [PATCH 2/3] Update default.config.php --- resources/default.config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/default.config.php b/resources/default.config.php index 4cf51d6..36c6eb0 100644 --- a/resources/default.config.php +++ b/resources/default.config.php @@ -8,6 +8,7 @@ return array( 'list_sort_order' => 'natcasesort', 'theme_name' => 'bootstrap', 'external_links_new_window' => true, + 'links_for_dirs_with_index' => false, // Hidden files 'hidden_files' => array( From a288b822c3a1d143d58123e0df45c62b6171f708 Mon Sep 17 00:00:00 2001 From: Ozan Kurt Date: Fri, 22 Apr 2016 16:01:03 +0300 Subject: [PATCH 3/3] Update index.php --- resources/themes/bootstrap/index.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/themes/bootstrap/index.php b/resources/themes/bootstrap/index.php index 07ff178..b9ac018 100644 --- a/resources/themes/bootstrap/index.php +++ b/resources/themes/bootstrap/index.php @@ -124,11 +124,15 @@ - containsIndex($fileInfo['file_path'])): ?> + linksForDirsWithIndex()): ?> - externalLinksNewWindow()): ?>target="_blank"> - - + containsIndex($fileInfo['file_path'])): ?> + + externalLinksNewWindow()): ?>target="_blank"> + + + +