tra('Definition List'), 'documentation' => 'PluginDL', 'description' => tra('Create a definition list'), 'prefs' => ['wikiplugin_dl'], 'body' => tr('One entry per line. Each line is in %0Term: Definition%1 format.', '', ''), 'iconname' => 'list', 'tags' => [ 'basic' ], 'introduced' => 1, 'params' => [ 'type' => [ 'required' => false, 'name' => tra('List Type'), 'description' => tra('Type of definition list (left-aligned or horizontal).'), 'since' => '16.0', 'filter' => 'text', 'safe' => true, 'advanced' => false, 'options' => [ ['text' => '', 'value' => ''], ['text' => tra('Standard (left-aligned)'), 'value' => 's'], ['text' => tra('Horizontal (inline) '), 'value' => 'h'], ], 'default' => '', ], ], ]; } function wikiplugin_dl($data, $params) { global $tikilib; global $replacement; if (isset($param)) { extract($params, EXTR_SKIP); } if (isset($params["type"])) { $dlt = $params["type"]; if ($dlt == "horizontal" or $dlt == "dl-horizontal" or $dlt == "horiz" or $dlt == "h" or $dlt == "inline") { $result = '
'; } if ($dlt == "left" or $dlt == "vertical" or $dlt == "standard" or $dlt == "s") { $result = '
'; } } else { $result = '
'; } $lines = explode("\n", $data); foreach ($lines as $line) { $parts = explode(":", $line, 2); if (isset($parts[0]) && isset($parts[1])) { $result .= '
' . $parts[0] . '
' . $parts[1] . '
'; } else { $result .= '
' . $line . '
'; } } $result .= '
'; return $result; }