Resolved merge conflict in default.config.php

This commit is contained in:
Chris Kankiewicz
2017-06-10 18:38:05 -07:00
3 changed files with 28 additions and 5 deletions

View File

@@ -290,7 +290,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
@@ -612,6 +624,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(

View File

@@ -9,6 +9,7 @@ return array(
'list_sort_order' => 'natcasesort',
'theme_name' => 'bootstrap',
'external_links_new_window' => true,
'links_for_dirs_with_index' => false,
'date_format' => 'Y-m-d H:i:s', // See: http://php.net/manual/en/function.date.php
// Hidden files

View File

@@ -124,11 +124,15 @@
<?php else: ?>
<?php if ($lister->containsIndex($fileInfo['file_path'])): ?>
<?php if (!$lister->linksForDirsWithIndex()): ?>
<a href="<?php echo $fileInfo['file_path']; ?>" class="web-link-button" <?php if($lister->externalLinksNewWindow()): ?>target="_blank"<?php endif; ?>>
<i class="fa fa-external-link"></i>
</a>
<?php if ($lister->containsIndex($fileInfo['file_path'])): ?>
<a href="<?php echo $fileInfo['file_path']; ?>" class="web-link-button" <?php if($lister->externalLinksNewWindow()): ?>target="_blank"<?php endif; ?>>
<i class="fa fa-external-link"></i>
</a>
<?php endif; ?>
<?php endif; ?>