X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_pluglist.inc;h=f6267beb2fdf5cce01e29f6cb9de856a5a4b4343;hb=f1714ac56cc41319519c97c1ab7749d4d8a637c3;hp=2c816bd2e56ffe1f9bac809affb0892918aafc05;hpb=a7f8e21d60625b9b66bbd2b29e9b44f524aa78a7;p=gosa.git diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 2c816bd2e..f6267beb2 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -28,6 +28,7 @@ class pluglist { var $dirlist= array(); var $ui= NULL; var $current= ""; + var $info= array(); var $headlines = array(); function pluglist($config, $ui) @@ -37,12 +38,25 @@ class pluglist { /* 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 (get_declared_classes() as $cname){ + if (method_exists($cname, 'plInfo')){ + $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){ @@ -52,9 +66,11 @@ class pluglist { } else { if (isset ($config['PATH']) && is_array($config)){ $list[$this->index++]= $config['PATH']; + if (isset($config['CLASS'])){ + $class= $config['CLASS']; + } } } - error_reporting(E_ALL); return ($list); } @@ -70,9 +86,9 @@ class pluglist { foreach($this->ui->subtreeACL as $arr){ foreach($arr as $value){ if ($value == ':all' || preg_match("/[,:]$modname#/", $value)){ - // if (!preg_match('/^!/', $value)){ + if (!preg_match('/^!/', $value)){ return (TRUE); - // } + } } } } @@ -121,7 +137,7 @@ class pluglist { $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"; @@ -131,7 +147,7 @@ class pluglist { $href= "main.php?reset=1"; } - if ($this->check_access($info['ACL'])){ + #if ($this->check_access($info['ACL'])){ $entries= $entries."