From 4f32716ed3cd44b3827d2a778211d2516344f77b Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Wed, 3 Aug 2005 20:02:26 +0200 Subject: [PATCH] plugin tweaks, info plugin fixes darcs-hash:20050803180226-7ad00-7bce1982ed6589511ce38e2e4e5e4cdf8640a0ae.gz --- inc/pluginutils.php | 17 ++++++++++------- lib/plugins/info/syntax.php | 33 +++++++++++++++++---------------- lib/plugins/syntax.php | 5 +---- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/inc/pluginutils.php b/inc/pluginutils.php index 7ed229947..89d0c9f44 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -68,28 +68,31 @@ function plugin_list($type=''){ * * @param $type string type of plugin to load * @param $name string name of the plugin to load - * @return object the plugin object or null on failure + * @return objectreference the plugin object or null on failure */ function &plugin_load($type,$name){ //we keep all loaded plugins available in global scope for reuse global $DOKU_PLUGINS; - //plugin already loaded? - if($DOKU_PLUGINS[$type][$name] != null){ - return $DOKU_PLUGINS[$type][$name]; - } + + //plugin already loaded? + if($DOKU_PLUGINS[$type][$name] != null){ + return $DOKU_PLUGINS[$type][$name]; + } //try to load the wanted plugin file - if(!@include_once(DOKU_PLUGIN."$name/$type.php")){ + if(!include_once(DOKU_PLUGIN."$name/$type.php")){ list($plugin, $component) = preg_split("/_/",$name, 2); - if (!$component || !@include_once(DOKU_PLUGIN."$plugin/$type/$component.php")) { + if (!$component || !include_once(DOKU_PLUGIN."$plugin/$type/$component.php")) { return null; } } +/* FIXME: chris: what's this for? global $plugin_investigate_pluginorder; if (!isset($plugin_investigate_pluginorder)) $plugin_investigate_pluginorder = array(); $plugin_investigate_pluginorder[] = $name; +*/ //construct class and instanciate $class = $type.'_plugin_'.$name; diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index 34acd98b7..ed555b65d 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -6,6 +6,7 @@ * @author Andreas Gohr <andi@splitbrain.org> */ + if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); @@ -23,7 +24,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { return array( 'author' => 'Andreas Gohr', 'email' => 'andi@splitbrain.org', - 'date' => '2005-06-26', + 'date' => '2005-08-03', 'name' => 'Info Plugin', 'desc' => 'Displays information about various DokuWiki internals', 'url' => 'http://wiki.splitbrain.org/plugin:info', @@ -106,21 +107,21 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { $plugins = plugin_list('syntax'); foreach($plugins as $p){ - if(plugin_load('syntax',$p,$po)){ - $info = $po->getInfo(); - - $renderer->doc .= '<li>'; - $renderer->externallink($info['url'],$info['name']); - $renderer->doc .= ' '; - $renderer->doc .= '<i>'.$info['date'].'</i>'; - $renderer->doc .= ' '; - $renderer->doc .= $lang['by']; - $renderer->doc .= ' '; - $renderer->emaillink($info['email'],$info['author']); - $renderer->doc .= '<br />'; - $renderer->doc .= htmlspecialchars($info['desc']); - $renderer->doc .= '</li>'; - } + $po =& plugin_load('syntax',$p); + $info = $po->getInfo(); + + $renderer->doc .= '<li>'; + $renderer->externallink($info['url'],$info['name']); + $renderer->doc .= ' '; + $renderer->doc .= '<i>'.$info['date'].'</i>'; + $renderer->doc .= ' '; + $renderer->doc .= $lang['by']; + $renderer->doc .= ' '; + $renderer->emaillink($info['email'],$info['author']); + $renderer->doc .= '<br />'; + $renderer->doc .= htmlspecialchars($info['desc']); + $renderer->doc .= '</li>'; + unset($po); } $renderer->doc .= '</ul>'; diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php index d42169a45..f5a2ee90e 100644 --- a/lib/plugins/syntax.php +++ b/lib/plugins/syntax.php @@ -61,9 +61,6 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * for correct XHTML nesting. Should return one of the following: * * 'normal' - The plugin can be used inside paragraphs - - - * 'block' - Open paragraphs need to be closed before plugin output * 'stack' - Special case. Plugin wraps other paragraphs. * @@ -140,4 +137,4 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { } } -//Setup VIM: ex: et ts=4 enc=utf-8 : \ No newline at end of file +//Setup VIM: ex: et ts=4 enc=utf-8 : -- GitLab