From a27c9d6f6c03a5b93871dd414021317c2bb9eac8 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 14 Oct 2013 20:35:17 +0200 Subject: Put syntax modes in a table layout, sort numbers in rowspans. Implements FS#2516 --- lib/plugins/info/syntax.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'lib/plugins/info') diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index 5e7543603..da32a6f32 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -215,11 +215,36 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { */ function _syntaxmodes_xhtml(){ $modes = p_get_parsermodes(); + + $compactmodes = array(); + foreach($modes as $mode){ + $compactmodes[$mode['sort']][] = $mode['mode']; + } $doc = ''; + $doc .= '
'; + + foreach($compactmodes as $sort => $modes){ + $rowspan = ''; + if(count($modes) > 1) { + $rowspan = ' rowspan="'.count($modes).'"'; + } - foreach ($modes as $mode){ - $doc .= $mode['mode'].' ('.$mode['sort'].'), '; + foreach($modes as $index => $mode) { + $doc .= ''; + $doc .= ''; + + if($index === 0) { + $doc .= ''; + } + $doc .= ''; + } } + + $doc .= '
'; + $doc .= $mode; + $doc .= ''; + $doc .= $sort; + $doc .= '
'; return $doc; } -- cgit v1.2.3