Skip to content
Snippets Groups Projects
Commit 4f32716e authored by Andreas Gohr's avatar Andreas Gohr
Browse files

plugin tweaks, info plugin fixes

darcs-hash:20050803180226-7ad00-7bce1982ed6589511ce38e2e4e5e4cdf8640a0ae.gz
parent 6446f486
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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>';
......
......@@ -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 :
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment