Merged changes from mai trunk up to 2.3.1
[fa-stable.git] / themes / cool / renderer.php
index 9bf46c95fc02cf736960d8cc1ae16b38e3313981..d9d286b265809f3ed0f95ea91f4775d79af529b5 100644 (file)
 ***********************************************************************/
        class renderer
        {
+               function get_icon($category)
+               {
+                       global  $path_to_root, $show_menu_category_icons;
+;
+                       if ($show_menu_category_icons)
+                               $img = $category == '' ? 'right.gif' : $category.'.png';
+                       else    
+                               $img = 'right.gif';
+                       return "<img src='$path_to_root/themes/cool/images/$img' style='vertical-align:middle;' border='0'>&nbsp;&nbsp;";
+               }
+
                function wa_header()
                {
                        page(_($help_context = "Main Menu"), false, true);
                        global $path_to_root;
                        $selected_app = $waapp->get_selected_application();
 
-                       $img = "<img src='$path_to_root/themes/cool/images/right.gif' style='vertical-align:middle;' width='17' height='17' border='0'>&nbsp;&nbsp;";
                        foreach ($selected_app->modules as $module)
                        {
                                // image
 
                                foreach ($module->lappfunctions as $appfunction)
                                {
+                                       $img = $this->get_icon($appfunction->category);
                                        if ($appfunction->label == "")
                                                echo "&nbsp;<br>";
                                        elseif ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) 
                                        echo "<td width='50%' class='menu_group_items'>";
                                        foreach ($module->rappfunctions as $appfunction)
                                        {
+                                               $img = $this->get_icon($appfunction->category);
                                                if ($appfunction->label == "")
                                                        echo "&nbsp;<br>";
                                                elseif ($_SESSION["wa_current_user"]->can_access_page($appfunction->access))