Add single image display.

This commit is contained in:
2026-01-19 09:16:02 +01:00
parent 95a0e94b4a
commit 8aa022feff
14 changed files with 390 additions and 59 deletions

View File

@@ -82,13 +82,6 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
/** @inheritdoc */
public function handle($match, $state, $pos, Doku_Handler $handler)
{
global $INPUT;
// Do not allow the syntax in discussion plugin comments
if (!$this->getConf('allow_in_comments') && $INPUT->has('comment')) {
return false;
}
$keyword = $this->getSyntaxKeyword();
$match = substr($match, strlen('{{' . $keyword . '>'), -2);
[$path, $flags] = array_pad(explode('&', $match, 2), 2, '');
@@ -161,6 +154,12 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
*/
protected function parseFlags(string $flags): array
{
// Parse default table columns setting.
// Format: comma-separated list of column names (name, size, date).
$tableColumns = strtolower(trim((string)$this->getConf('default_tablecolumns')));
$defaultShowSize = str_contains($tableColumns, 'size') ? 1 : (int)$this->getConf('default_showsize');
$defaultShowDate = str_contains($tableColumns, 'date') ? 1 : (int)$this->getConf('default_showdate');
// Base defaults shared by all handlers
$baseDefaults = [
'sort' => (string)$this->getConf('default_sort'),
@@ -172,8 +171,8 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
'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'),
'showsize' => $defaultShowSize,
'showdate' => $defaultShowDate,
'listsep' => (string)$this->getConf('default_listsep'),
'maxheight' => (int)$this->getConf('default_maxheight'),
];