X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_pluglist.inc;h=7e857efc46c580a783ca33f45d76bf50e6d17f6d;hb=f4dd18b548d735cccdd59adcfb7ed3da2c0d9328;hp=42f729db8992deab90bdb9f049bb8ab3fb9a4fc0;hpb=188aa8bc6ea499cb4d62e17a7ce3dbda1b4fb91c;p=gosa.git diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 42f729db8..7e857efc4 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -29,6 +29,7 @@ class pluglist { var $ui= NULL; var $current= ""; var $headlines = array(); + var $allowed_plug_ids =array(); function pluglist($config, $ui) { @@ -112,7 +113,7 @@ class pluglist { /* Read information from class variable */ if (!isset($info['CLASS'])){ - print_red(_("Your gosa.conf information has changed partly. Please convert it using the contributed script fix_config.sh!")); + print_red(sprintf(_("Your %s information has changed partly. Please convert it using the contributed script fix_config.sh!"),CONFIG_FILE)); echo $_SESSION['errors']; exit; } @@ -121,7 +122,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"; @@ -132,15 +133,26 @@ class pluglist { } if ($this->check_access($info['ACL'])){ - + $this->allowed_plug_ids[$index]=$index; $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"; } @@ -219,7 +231,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"; @@ -241,10 +253,18 @@ class pluglist { $col = 1; } $entries= $entries."". - "\"*\" ". - _($plHeadline)."\n"; + ">"; + if($_SESSION['js']){ + $entries.= "\"*\" ". + _($plHeadline); + } else { + $entries.= "". + "\"*\" ". + _($plHeadline).""; + } + $entries.= "\n"; $col++ ; } @@ -283,9 +303,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)); + } } ?>