summaryrefslogtreecommitdiff
path: root/lib/plugins/info
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2013-10-14 20:35:17 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2013-10-14 20:35:17 +0200
commita27c9d6f6c03a5b93871dd414021317c2bb9eac8 (patch)
treec89a15c8f1bb9be32a559d3210e41f9b7de33496 /lib/plugins/info
parent850f3dda33f85c3279ca47b77b1a34add823cac0 (diff)
downloadrpg-a27c9d6f6c03a5b93871dd414021317c2bb9eac8.tar.gz
rpg-a27c9d6f6c03a5b93871dd414021317c2bb9eac8.tar.bz2
Put syntax modes in a table layout, sort numbers in rowspans. Implements FS#2516
Diffstat (limited to 'lib/plugins/info')
-rw-r--r--lib/plugins/info/syntax.php29
1 files changed, 27 insertions, 2 deletions
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 .= '<div class="table"><table class="inline"><tbody>';
+
+ 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 .= '<tr>';
+ $doc .= '<td class="leftalign">';
+ $doc .= $mode;
+ $doc .= '</td>';
+
+ if($index === 0) {
+ $doc .= '<td class="rightalign" '.$rowspan.'>';
+ $doc .= $sort;
+ $doc .= '</td>';
+ }
+ $doc .= '</tr>';
+ }
}
+
+ $doc .= '</tbody></table></div>';
return $doc;
}