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 From 9b3b9e8e02000edb4c6359d9ad50fbeeab0a4612 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 15 Oct 2013 10:30:54 +0200 Subject: Fix PHP strict messages --- lib/plugins/info/syntax.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/plugins/info') diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index da32a6f32..5d969d7a2 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -48,7 +48,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { /** * Handle the match */ - function handle($match, $state, $pos, &$handler){ + function handle($match, $state, $pos, Doku_Handler &$handler){ $match = substr($match,7,-2); //strip ~~INFO: from start and ~~ from end return array(strtolower($match)); } @@ -56,7 +56,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { /** * Create output */ - function render($format, &$renderer, $data) { + function render($format, Doku_Renderer &$renderer, $data) { if($format == 'xhtml'){ //handle various info stuff switch ($data[0]){ @@ -112,7 +112,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { // remove subparts foreach($plugins as $p){ - if (!$po =& plugin_load($type,$p)) continue; + if (!$po = plugin_load($type,$p)) continue; list($name,$part) = explode('_',$p,2); $plginfo[$name] = $po->getInfo(); } @@ -146,7 +146,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { $plugins = plugin_list('helper'); foreach($plugins as $p){ - if (!$po =& plugin_load('helper',$p)) continue; + if (!$po = plugin_load('helper',$p)) continue; if (!method_exists($po, 'getMethods')) continue; $methods = $po->getMethods(); @@ -156,7 +156,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { $doc = '

'.hsc($info['name']).'

'; $doc .= '
'; $doc .= '

'.strtr(hsc($info['desc']), array("\n"=>"
")).'

'; - $doc .= '
$'.$p." =& plugin_load('helper', '".$p."');
"; + $doc .= '
$'.$p." = plugin_load('helper', '".$p."');
"; $doc .= '
'; foreach ($methods as $method){ $title = '$'.$p.'->'.$method['name'].'()'; -- cgit v1.2.3 From 74ed54d4f9a7c9796916f33f649ef94619a31704 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 16 Oct 2013 11:29:27 +0200 Subject: fix signature mail unittest, and improve some signatures info plugin --- lib/plugins/info/syntax.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/plugins/info') diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index 5d969d7a2..e68061e5d 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -58,6 +58,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { */ function render($format, Doku_Renderer &$renderer, $data) { if($format == 'xhtml'){ + /** @var Doku_Renderer_xhtml $renderer */ //handle various info stuff switch ($data[0]){ case 'syntaxmodes': @@ -103,7 +104,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { * * uses some of the original renderer methods */ - function _plugins_xhtml($type, Doku_Renderer &$renderer){ + function _plugins_xhtml($type, Doku_Renderer_xhtml &$renderer){ global $lang; $renderer->doc .= '
    '; @@ -141,9 +142,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { * * uses some of the original renderer methods */ - function _helpermethods_xhtml(Doku_Renderer &$renderer){ - global $lang; - + function _helpermethods_xhtml(Doku_Renderer_xhtml &$renderer){ $plugins = plugin_list('helper'); foreach($plugins as $p){ if (!$po = plugin_load('helper',$p)) continue; -- cgit v1.2.3 From e07886c01389351f28a254ef6f7c9611453508fb Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 20 Oct 2013 20:21:42 +0200 Subject: Info plugin: allow xhtml renders to not to be an xhtml renderer Renderers that set the format to xhtml don't necessarily inherit from Doku_Renderer_xhtml, this reverts a prior change that introduced the stricter parameter type. --- lib/plugins/info/syntax.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/plugins/info') diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index e68061e5d..f8c6eb484 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -104,7 +104,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { * * uses some of the original renderer methods */ - function _plugins_xhtml($type, Doku_Renderer_xhtml &$renderer){ + function _plugins_xhtml($type, Doku_Renderer &$renderer){ global $lang; $renderer->doc .= '
      '; @@ -142,7 +142,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { * * uses some of the original renderer methods */ - function _helpermethods_xhtml(Doku_Renderer_xhtml &$renderer){ + function _helpermethods_xhtml(Doku_Renderer &$renderer){ $plugins = plugin_list('helper'); foreach($plugins as $p){ if (!$po = plugin_load('helper',$p)) continue; @@ -250,10 +250,11 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { /** * Adds a TOC item */ - function _addToTOC($text, $level, Doku_Renderer_xhtml &$renderer){ + function _addToTOC($text, $level, Doku_Renderer &$renderer){ global $conf; if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){ + /** @var $renderer Doku_Renderer_xhtml */ $hid = $renderer->_headerToLink($text, 'true'); $renderer->toc[] = array( 'hid' => $hid, -- cgit v1.2.3