Refactor admin page

This commit is contained in:
2026-01-13 09:37:24 +01:00
parent 77fcae3450
commit 7c9e289740
9 changed files with 294 additions and 26 deletions

View File

@@ -163,26 +163,31 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
{
// Base defaults shared by all handlers
$baseDefaults = [
'sort' => 'name',
'order' => 'asc',
'style' => 'list',
'tableheader' => 0,
'foldersfirst' => 0,
'recursive' => 0,
'titlefile' => '_title.txt',
'cache' => 0,
'randlinks' => 0,
'showsize' => 0,
'showdate' => 0,
'listsep' => ', ',
'maxheight' => 500,
'sort' => (string)$this->getConf('default_sort'),
'order' => (string)$this->getConf('default_order'),
'style' => (string)$this->getConf('default_style'),
'tableheader' => (int)$this->getConf('default_tableheader'),
'foldersfirst' => (int)$this->getConf('default_foldersfirst'),
'recursive' => (int)$this->getConf('default_recursive'),
'titlefile' => (string)$this->getConf('default_titlefile'),
'cache' => (int)$this->getConf('default_cache'),
'randlinks' => (int)$this->getConf('default_randlinks'),
'showsize' => (int)$this->getConf('default_showsize'),
'showdate' => (int)$this->getConf('default_showdate'),
'listsep' => (string)$this->getConf('default_listsep'),
'maxheight' => (int)$this->getConf('default_maxheight'),
];
// Merge with handler-specific defaults
$params = array_merge($baseDefaults, $this->getDefaultParams());
// Load default config options and combine with provided flags
$flags = $this->getConf('defaults') . '&' . $flags;
// Legacy (advanced): allow additional default flags in the old combined string.
// This is not exposed in the admin UI anymore, but existing installs may
// still have it in conf/local.php.
$legacyDefaults = trim((string)$this->getConf('defaults'));
// Combine default flags and provided flags.
$flags = ($legacyDefaults !== '' ? ($legacyDefaults . '&') : '') . $flags;
$flagList = explode('&', $flags);
foreach ($flagList as $flag) {