index 4cd8786c472a98dc3c6c3368c4cc1a8ef3d445e3..8a354af6a81024f6c8abdec8c96bb8eb43ffac10 100644 (file)
/* Create dirlist for all plugins */
$this->dirlist= $this->get_plugins ($this->dirlist, $this->config->data);
+
+ /* Fill info part of pluglist */
+ $classes= get_declared_classes();
+
+ foreach ($classes as $cname){
+ $cmethods = get_class_methods($cname);
+ if (in_array_ics('plInfo',$cmethods)){
+ $this->info[$cname]= @call_user_func(array($cname, 'plInfo'));
+ }
+ }
+
+ /* Provide field for 'all' */
+ $this->info['all']= array();
+ $this->info['all']['plProvidedAcls']= array();
+ $this->info['all']['plDescription']= _("All objects in this category");
+ $this->info['all']['plSelfModify']= FALSE;
}
function get_plugins($list, $config)
{
/* Error reporting, because I'm getting strange messages in PHP 4.2.x */
- error_reporting(0);
if (!isset($config['PATH']) && !isset($config['CLASS'])){
if (is_array($config)){
foreach ($config as $val){
$list[$this->index++]= $config['PATH'];
if (isset($config['CLASS'])){
$class= $config['CLASS'];
- $this->info[$class]= call_user_func(array($class, 'plInfo'));
}
}
}
- error_reporting(E_ALL);
return ($list);
}
$plDescription= $vars['plDescription'];
- $index= $this->get_index($info['PATH']);
+ $index= $this->get_index($info['PATH'],$info['CLASS']);
$image= get_template_path('images/'.$info['ICON']);
$href= "main.php?plug=$index&reset=1";
$plHeadline= $vars['plHeadline'];
$plDescription= $vars['plDescription'];
- $index= $this->get_index($info['PATH']);
+ $index= $this->get_index($info['PATH'],$info['CLASS']);
$href = "main.php?plug=".$index."&reset=1";
return ("../".$this->dirlist[$index]);
}
- function get_index($path)
+ function get_index($path,$class)
{
- return (array_search($path, $this->dirlist));
+ /* Search for plugin index (id), identify entry by path && class */
+ $data = $this->config->data['MENU'];
+ foreach($data as $section => $plugins){
+ foreach($plugins as $key => $plugin) {
+ if($plugin['CLASS'] == $class && $plugin['PATH'] == $path){
+ return($key);
+ }
+ }
+ }
+
+ /* Indentify by path*/
+ return (array_search($path, $this->dirlist));
+
}
}
?>