IncludeBuffered($formatter.".php", "Impossible de trouver le formateur \"$formatter\"", compact("text"),$this->config['formatter_path']);
}
function IncludeBuffered($filename, $notfoundText = "", $vars = "", $path = "") {
if ($path) $dirs = explode(":", $path);
else $dirs = array("");
$included['before']=array();
$included['new']=array();
$included['after']=array();
foreach($dirs as $dir) {
if ($dir) $dir .= "/";
$fullfilename = $dir.$filename;
if (strstr($filename,'page/')) {
list($file,$extension) = explode("page/", $filename);
$beforefullfilename = $dir.$file.'page/__'.$extension;
}
else {
$beforefullfilename = $dir.'__'.$filename;
}
list($file,$extension) = explode(".", $filename);
$afterfullfilename = $dir.$file.'__.'.$extension;
if (file_exists($beforefullfilename)) {
$included['before'][]=$beforefullfilename;
}
if (file_exists($fullfilename)) {
$included['new'][]=$fullfilename;
}
if (file_exists($afterfullfilename)) {
$included['after'][]=$afterfullfilename;
}
}
$plugin_output_before='';
$plugin_output_new='';
$plugin_output_after='';
$found=0;
if (is_array($vars)) extract($vars);
foreach ($included['before'] as $before) {
$found=1;
ob_start();
include($before);
$plugin_output_before.= ob_get_contents();
ob_end_clean();
}
foreach ($included['new'] as $new) {
$found=1;
ob_start();
require($new);
$plugin_output_new = ob_get_contents();
ob_end_clean();
break;
}
foreach ($included['after'] as $after) {
$found=1;
ob_start();
include($after);
$plugin_output_after.= ob_get_contents();
ob_end_clean();
}
if ($found) return $plugin_output_before.$plugin_output_new.$plugin_output_after;
if ($notfoundText) return $notfoundText;
else return false;
}
}
$plugins_root = 'tools/';
$objPlugins = new plugins($plugins_root);
$objPlugins->getPlugins(true);
$plugins_list = $objPlugins->getPluginsList();
$wakkaConfig['formatter_path']='formatters';
$wikiClasses [] = 'WikiTools';
$wikiClassesContent [] = '';
foreach ($plugins_list as $k => $v) {
if (file_exists($plugins_root.$k.'/wiki.php')) {
include($plugins_root.$k.'/wiki.php');
}
if (file_exists($plugins_root.$k.'/actions')) {
$wakkaConfig['action_path']=$plugins_root.$k.'/actions/'.':'.$wakkaConfig['action_path'];
}
if (file_exists($plugins_root.$k.'/handlers')) {
$wakkaConfig['handler_path']=$plugins_root.$k.'/handlers/'.':'.$wakkaConfig['handler_path'];
}
if (file_exists($plugins_root.$k.'/formatters')) {
$wakkaConfig['formatter_path']=$plugins_root.$k.'/formatters/'.':'.$wakkaConfig['formatter_path'];
}
}
for ($iw=0;$iw