From 510bf07b7af9d2ff6bfda9cbbc817a2da483da23 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 26 Feb 2010 10:47:52 +0000 Subject: [PATCH] Updated pluglist to use new styles for iconmenu. - Not yet cleanly integrated. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15737 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_pluglist.inc | 105 +++++++++------------------ 1 file changed, 34 insertions(+), 71 deletions(-) diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 0e37c5daa..989a54338 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -176,7 +176,6 @@ class pluglist { function gen_menu() { if ($this->menu == ""){ - $cfg= $this->config->data['MENU']; $this->checkMenu(); $cfg= $this->config->data['MENU']; $menu = "\n"; $this->menu = $menu; - } - // Add javascript method to print out warning messages while leaving an unsaved form. - // We do it in here to get the string translated. - $this->menu .= " - - "; + "; + } // Return the generated/cached gosa menu. return ($this->menu); @@ -240,29 +239,20 @@ class pluglist { function show_iconmenu() { global $class_mapping; + + $this->iconmenu = ""; if ($this->iconmenu == ""){ $cfg= $this->config->data['MENU']; - if (isset($this->config->current['ICONSIZE'])){ - list($x, $y)= explode("x", $this->config->get_cfg_value("iconsize")); - $isize= "width=\"$x\" height=\"$y\""; - } else { - $isize= ""; - } - /* Parse headlines */ foreach ($cfg as $headline => $plug){ $col= 1; - $menu= "

". - _($headline)."

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

". _($headline)."

\n"; foreach ($plug as $info){ - if (!plugin_available($info['CLASS'])){ - continue; - } /* Read information from class variable */ $vars= get_class_vars($info['CLASS']); @@ -276,8 +266,6 @@ class pluglist { $index= $this->get_index($info['CLASS']); - $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){ @@ -287,59 +275,34 @@ class pluglist { } - if ($this->check_access($info['ACL'])){ - - /* 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; - } - } - if ($col > 5){ - $entries= $entries.""; - $col = 1; - } - $entries= $entries."\n"; - $col++ ; - } - } - - /* Append to menu */ - if ($entries != ""){ - $this->iconmenu.= $menu.$entries; - - /* Fill up remaining columns */ - if ($col != 1){ - $col--; - while ($col % 5){ - $this->iconmenu= $this->iconmenu. - "\n"; - $col++; - } + if (($col % 5) == 0){ + $this->iconmenu .= "\n
\n"; + $col = 1; } - /* close table */ - $this->iconmenu= $this->iconmenu."\n
"; - if(session::global_get('js')){ - $entries.= "\"*\" ". - _($plHeadline); - } else { - $entries.= "". - "\"*\" ". - _($plHeadline).""; + /* 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; } - $entries.= " 
\n"; + + $this->iconmenu.= +" +
+
+

".$plHeadline."

+

".$plDescription."

+
+
+"; + $col++ ; } } - } /* Write menu output */ -- 2.30.2