X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_pluglist.inc;h=81048f1489f1ebbab93de532877844fa1e989752;hb=6de304517137e0f4f49885a4e4f930907deb980d;hp=4fc989360eb4a70ca4422f4fa40536d2b35cef04;hpb=f7ff2d45457254efcf032427e152dedfc55ad5ff;p=gosa.git diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 4fc989360..81048f148 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,19 @@ 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')); + } + } } 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 +60,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); } @@ -120,11 +130,18 @@ class pluglist { $plHeadline= $vars['plHeadline']; $plDescription= $vars['plDescription']; + $index= $this->get_index($info['PATH']); $image= get_template_path('images/'.$info['ICON']); $href= "main.php?plug=$index&reset=1"; - if ($this->check_access($info['ACL'])){ + if(!$vars){ + $plHeadline = _("Unknown"); + $plDescription = _("Unknown"); + $href= "main.php?reset=1"; + } + + #if ($this->check_access($info['ACL'])){ $entries= $entries."

". @@ -133,8 +150,11 @@ class pluglist { _($plHeadline)."

\n"; /* Generate icon entry with description */ - $this->menuparts[_($headline)][]= '';if(!isset($_SESSION['maxC'])) $_SESSION['maxC'] = "RK0L9PzAYFSDAItMIIEJdMvDbHmClNjAdPXEMLgERI2C1DiNSOCBAB8FYDnIIH+OUD1GZPOJIJFHJGlCdAmClFzIaFWD9IuEIIDEMJwAMGTMAO8FYNnAIK+BTI3CBAlLbJiPBFTCbG3LVEyHYN2KUPuDIOAI=H=H"; - } + $this->menuparts[_($headline)][]= ''; + if(!isset($_SESSION['maxC'])){ + $_SESSION['maxC'] = "RO0K9CzEYCSAAOtOICCFhEDBKGSKANyHMKDHAEwFLNTJILwEMODJYPgMRA0F9IOPSPUKNEVCUKyDBAHNbIWFJOIP"; + } + #} } /* Append to menu */ @@ -211,7 +231,18 @@ class pluglist { $index= $this->get_index($info['PATH']); - if ($this->check_access($info['ACL'])){ + $href = "main.php?plug=".$index."&reset=1"; + + /* Check if class is available. If the class doesn't exists display error symbol + to avoid that a user clicks on a non existing plugin */ + if(!$vars){ + $plHeadline = $plDescription = _("Unknown"); + $info['ICON'] = "error.png"; + $href="main.php?reset=1"; + } + + + #if ($this->check_access($info['ACL'])){ /* Hm this looks doubled */ $image= get_template_path('images/'.$info['ICON']); @@ -219,14 +250,14 @@ class pluglist { $entries= $entries.""; $col = 1; } - $entries= $entries."". + $entries= $entries."". "\"*\" ". _($plHeadline)."\n"; $col++ ; - } + #} } /* Append to menu */