From: hickert Date: Fri, 26 Feb 2010 10:54:57 +0000 (+0000) Subject: Some pliglist iconmenu updates X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4e8ed7cc1a30917ae00d41058c1906dff3e6a248;p=gosa.git Some pliglist iconmenu updates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15738 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 989a54338..a0e13d4fd 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -243,57 +243,46 @@ class pluglist { $this->iconmenu = ""; if ($this->iconmenu == ""){ $cfg= $this->config->data['MENU']; - - foreach ($cfg as $headline => $plug){ - $col= 1; + $col= 0; - $this->iconmenu .= "\n
\n"; - $this->iconmenu .= "\n

". _($headline)."

\n"; + $this->iconmenu .= "\n
\n"; + $this->iconmenu .= "\n

". _($headline)."

\n"; foreach ($plug as $info){ - - /* Read information from class variable */ + // Get Plugin info $vars= get_class_vars($info['CLASS']); $plHeadline= $vars['plHeadline']; $plDescription= $vars['plDescription']; - if (isset($vars['plIcon'])){ - $plIcon= $vars['plIcon']; - } else { - $plIcon= "plugin.png"; - } - + $plIcon = (isset($vars['plIcon'])) ? $vars['plIcon']: "plugin.png"; $index= $this->get_index($info['CLASS']); /* 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 */ + * 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"; + $index = ''; } - - /* Load icon */ - if (isset($info['ICON'])){ - $image= get_template_path('images/'.$info['ICON']); - } else { - if(!preg_match("/\//",$plIcon)){ - $image= get_template_path("plugins/".preg_replace('%^.*/([^/]+)/[^/]+$%', '\1', $class_mapping[$info['CLASS']])."/images/$plIcon"); - }else{ - $image = $plIcon; - } + // Detect the correct position of the plugin icon + if(!preg_match("/\//",$plIcon)){ + $image= get_template_path("plugins/".preg_replace('%^.*/([^/]+)/[^/]+$%', '\1', + $class_mapping[$info['CLASS']])."/images/$plIcon"); + }else{ + $image = $plIcon; } - if (($col % 5) == 0){ + + // Add a seperating row + if (($col % 4) == 0){ $this->iconmenu .= "\n
\n"; - $col = 1; } - $this->iconmenu.= " -
+

".$plHeadline."

".$plDescription."

@@ -304,8 +293,6 @@ class pluglist { } } } - - /* Write menu output */ return ($this->iconmenu); }