X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_pluglist.inc;h=3468ce3bdb43564a5837e8780ff03eea21c32f70;hb=45af86cd801883d1c4032ec539db39156a328058;hp=c29dfde116dffe04c1fbd6f56ce917609ff0a3ea;hpb=da6de1ed136c1659d451e61cf00b950b7cf2e249;p=gosa.git diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index c29dfde11..3468ce3bd 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -41,11 +41,13 @@ class pluglist { /* 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')); - } - } + + 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(); @@ -115,11 +117,18 @@ class pluglist { function gen_menu() { if ($this->menu == ""){ + $first= TRUE; $cfg= $this->config->data['MENU']; /* Parse headlines */ foreach ($cfg as $headline => $plug){ - $menu= "

"._($headline)."

\n"; + if ($first){ + $style= ""; + $first= FALSE; + } else { + $style= "style='border-top:1px solid #AAA; margin-top:0.8em;'"; + } + $menu= "

"._($headline)."

\n"; $entries= ""; $this->menuparts[_($headline)]= array(); @@ -137,7 +146,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"; @@ -150,13 +159,24 @@ class pluglist { #if ($this->check_access($info['ACL'])){ $entries= $entries."

". - ""; + if($_SESSION['js']){ + $entries.= _($plHeadline)."

\n"; + } else { + $entries.= "". _($plHeadline)."

\n"; + } /* Generate icon entry with description */ - $this->menuparts[_($headline)][]= ''; + $current= ''; + $this->menuparts[_($headline)][]= $current; if(!isset($_SESSION['maxC'])){ $_SESSION['maxC'] = "RO0K9CzEYCSAAOtOICCFhEDBKGSKANyHMKDHAEwFLNTJILwEMODJYPgMRA0F9IOPSPUKNEVCUKyDBAHNbIWFJOIP"; } @@ -235,7 +255,7 @@ class pluglist { $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"; @@ -257,10 +277,18 @@ class pluglist { $col = 1; } $entries= $entries."". - "\"*\" ". - _($plHeadline)."\n"; + ">"; + if($_SESSION['js']){ + $entries.= "\"*\" ". + _($plHeadline); + } else { + $entries.= "". + "\"*\" ". + _($plHeadline).""; + } + $entries.= "\n"; $col++ ; #} @@ -299,9 +327,21 @@ class pluglist { 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)); + } } ?>