From 7c9e2897406b4fd018469fc6dc8cf1689f113b1f Mon Sep 17 00:00:00 2001 From: luxick Date: Tue, 13 Jan 2026 09:37:24 +0100 Subject: [PATCH] Refactor admin page --- admin.svg | 3 + admin/main.php | 127 +++++++++++++++++++++++++++++++++++--- conf/default.php | 16 +++++ lang/de/lang.php | 18 +++++- lang/de/settings.php | 18 +++++- lang/en/lang.php | 18 +++++- lang/en/settings.php | 18 +++++- style.css | 67 ++++++++++++++++++++ syntax/AbstractSyntax.php | 35 ++++++----- 9 files changed, 294 insertions(+), 26 deletions(-) create mode 100644 admin.svg diff --git a/admin.svg b/admin.svg new file mode 100644 index 0000000..3e1ff18 --- /dev/null +++ b/admin.svg @@ -0,0 +1,3 @@ + + + diff --git a/admin/main.php b/admin/main.php index a3b3dd9..cf1ef2c 100644 --- a/admin/main.php +++ b/admin/main.php @@ -13,8 +13,20 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin 'paths', 'scratchpad_paths', 'allow_in_comments', - 'defaults', 'extensions', + 'default_sort', + 'default_order', + 'default_style', + 'default_tableheader', + 'default_foldersfirst', + 'default_recursive', + 'default_titlefile', + 'default_cache', + 'default_randlinks', + 'default_showsize', + 'default_showdate', + 'default_listsep', + 'default_maxheight', 'thumb_placeholder', 'gallery_thumb_scale', 'open_service_url', @@ -58,8 +70,22 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin $newConf['scratchpad_paths'] = $scratchpadPaths; $newConf['allow_in_comments'] = (int)$INPUT->bool('allow_in_comments'); - $newConf['defaults'] = $INPUT->str('defaults'); $newConf['extensions'] = $INPUT->str('extensions'); + + $newConf['default_sort'] = $INPUT->str('default_sort'); + $newConf['default_order'] = $INPUT->str('default_order'); + $newConf['default_style'] = $INPUT->str('default_style'); + $newConf['default_tableheader'] = (int)$INPUT->bool('default_tableheader'); + $newConf['default_foldersfirst'] = (int)$INPUT->bool('default_foldersfirst'); + $newConf['default_recursive'] = (int)$INPUT->bool('default_recursive'); + $newConf['default_titlefile'] = $INPUT->str('default_titlefile'); + $newConf['default_cache'] = (int)$INPUT->bool('default_cache'); + $newConf['default_randlinks'] = (int)$INPUT->bool('default_randlinks'); + $newConf['default_showsize'] = (int)$INPUT->bool('default_showsize'); + $newConf['default_showdate'] = (int)$INPUT->bool('default_showdate'); + $newConf['default_listsep'] = $INPUT->str('default_listsep'); + $newConf['default_maxheight'] = $INPUT->str('default_maxheight'); + $newConf['thumb_placeholder'] = $INPUT->str('thumb_placeholder'); $newConf['gallery_thumb_scale'] = $INPUT->str('gallery_thumb_scale'); $newConf['open_service_url'] = $INPUT->str('open_service_url'); @@ -106,16 +132,103 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin echo ''; echo '
'; - // defaults - echo '
'; - // extensions echo '
'; + echo '

' . hsc($this->getLang('listing_defaults')) . '

'; + + // default_sort + $defaultSort = (string)$this->getConf('default_sort'); + echo '
'; + + // default_order + $defaultOrder = (string)$this->getConf('default_order'); + echo '
'; + + // default_style + $defaultStyle = (string)$this->getConf('default_style'); + echo '
'; + + // default_tableheader + $checked = $this->getConf('default_tableheader') ? ' checked="checked"' : ''; + echo '
'; + + // default_foldersfirst + $checked = $this->getConf('default_foldersfirst') ? ' checked="checked"' : ''; + echo '
'; + + // default_recursive + $checked = $this->getConf('default_recursive') ? ' checked="checked"' : ''; + echo '
'; + + // default_titlefile + echo '
'; + + // default_cache + $checked = $this->getConf('default_cache') ? ' checked="checked"' : ''; + echo '
'; + + // default_randlinks + $checked = $this->getConf('default_randlinks') ? ' checked="checked"' : ''; + echo '
'; + + // default_showsize + $checked = $this->getConf('default_showsize') ? ' checked="checked"' : ''; + echo '
'; + + // default_showdate + $checked = $this->getConf('default_showdate') ? ' checked="checked"' : ''; + echo '
'; + + // default_listsep + echo '
'; + + // default_maxheight + echo '
'; + // thumb_placeholder echo '