This commit is contained in:
@@ -165,6 +165,7 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
|
||||
'order' => 'asc',
|
||||
'style' => 'list',
|
||||
'tableheader' => 0,
|
||||
'foldersfirst' => 0,
|
||||
'recursive' => 0,
|
||||
'titlefile' => '_title.txt',
|
||||
'cache' => 0,
|
||||
@@ -222,6 +223,7 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
|
||||
$crawler = new Crawler($this->getConf('extensions'));
|
||||
$crawler->setSortBy($params['sort']);
|
||||
$crawler->setSortReverse($params['order'] === 'desc');
|
||||
$crawler->setFoldersFirst(($params['foldersfirst'] ?? 0) != 0);
|
||||
return $crawler;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,15 @@ require_once(__DIR__ . '/AbstractSyntax.php');
|
||||
*/
|
||||
class syntax_plugin_luxtools_directory extends syntax_plugin_luxtools_abstract
|
||||
{
|
||||
/** @inheritdoc */
|
||||
protected function getDefaultParams(): array
|
||||
{
|
||||
return [
|
||||
// Directory listings should group folders before files by default.
|
||||
'foldersfirst' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
protected function getSyntaxKeyword(): string
|
||||
{
|
||||
@@ -35,6 +44,9 @@ class syntax_plugin_luxtools_directory extends syntax_plugin_luxtools_abstract
|
||||
return true;
|
||||
}
|
||||
|
||||
// Provide the current directory path so Output can render the "Open Location" link.
|
||||
$params['openlocation'] = $pathInfo['root'] . $pathInfo['local'];
|
||||
|
||||
$crawler = $this->createCrawler($params);
|
||||
$items = $crawler->listDirectory(
|
||||
$pathInfo['root'],
|
||||
|
||||
Reference in New Issue
Block a user