From 5f5f3ddc1ef5e7d6c78250d38008f42b508a720a Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 12 Sep 2008 23:07:21 +0200 Subject: info plugin: don't list plugins multiple times FS#1470 darcs-hash:20080912210721-7ad00-a8ddb61582f61d28bbed706ff65b8b5d605f501c.gz --- lib/plugins/info/syntax.php | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'lib/plugins/info') diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index acbdf7924..dc0a7d2fc 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -1,7 +1,7 @@ * @author Esther Brunner @@ -25,7 +25,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { return array( 'author' => 'Andreas Gohr', 'email' => 'andi@splitbrain.org', - 'date' => '2006-12-09', + 'date' => '2008-09-12', 'name' => 'Info Plugin', 'desc' => 'Displays information about various DokuWiki internals', 'url' => 'http://dokuwiki.org/plugin:info', @@ -38,7 +38,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { function getType(){ return 'substition'; } - + /** * What about paragraphs? */ @@ -48,7 +48,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { /** * Where to sort in? - */ + */ function getSort(){ return 155; } @@ -122,10 +122,17 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { $renderer->doc .= ''; } - + /** * list all installed plugins * @@ -150,15 +157,15 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { */ function _helpermethods_xhtml(&$renderer){ global $lang; - + $plugins = plugin_list('helper'); foreach($plugins as $p){ if (!$po =& plugin_load('helper',$p)) continue; - + if (!method_exists($po, 'getMethods')) continue; $methods = $po->getMethods(); $info = $po->getInfo(); - + $hid = $this->_addToTOC($info['name'], 2, $renderer); $doc = '

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

'; $doc .= '
'; @@ -190,7 +197,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { $doc .= '
'; } unset($po); - + $renderer->doc .= $doc; } } @@ -229,20 +236,20 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { } return $doc; } - + /** * Adds a TOC item */ function _addToTOC($text, $level, &$renderer){ global $conf; - - if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){ - $hid = $renderer->_headerToLink($text, 'true'); - $renderer->toc[] = array( - 'hid' => $hid, - 'title' => $text, - 'type' => 'ul', - 'level' => $level - $conf['toptoclevel'] + 1 + + if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){ + $hid = $renderer->_headerToLink($text, 'true'); + $renderer->toc[] = array( + 'hid' => $hid, + 'title' => $text, + 'type' => 'ul', + 'level' => $level - $conf['toptoclevel'] + 1 ); } return $hid; -- cgit v1.2.3