Ticket #1550: NavHelper.patch

File NavHelper.patch, 2.4 KB (added by cacapo, 4 years ago)
  • apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java

    old new  
    1212public class NavHelper {
    1313    private static Map<String, String> _apps = new ConcurrentHashMap<String, String>(4);
    1414    private static Map<String, String> _tooltips = new ConcurrentHashMap<String, String>(4);
    15     private static Map<String, String> _icons = new ConcurrentHashMap<String, String>(4);
    1615   
    1716    /**
    1817     * To register a new client application so that it shows up on the router
     
    2221     * @param path full path pointing to the application's root
    2322     *             (e.g. /i2ptunnel/index.jsp)
    2423     */
    25     //public static void registerApp(String name, String path) {
    26     //    _apps.put(name, path);
    27     //}
     24    public static void registerApp(String name, String path) {
     25        _apps.put(name, path);
     26    }
    2827
    29     //public static void registerApp(String name, String path, String tooltip) {
    30     //    _apps.put(name, path);
    31     //    _tooltips.put(name, tooltip);
    32     //}
    33     ///Addendum new method for console-icon Use of method without tooltip uncertain.
    34     public static void registerApp(String name, String path, String tooltip, String iconpath) {
     28    public static void registerApp(String name, String path, String tooltip) {
    3529        _apps.put(name, path);
    3630        _tooltips.put(name, tooltip);
    37         _icons.put(name, iconpath);
    38 
    3931    }
    4032
    4133    public static void unregisterApp(String name) {
     
    8476            String tip = _tooltips.get(name);
    8577            if (tip == null)
    8678                tip = "";
    87             ///Addendum If registerApp was called with icon it returns the path to it
    88             /// last selection if() is superseeded by pluginStarter
    8979            // hardcoded hack
    90             String icon = null;
     80            String icon;
    9181            if (path.equals("/i2pbote/index.jsp"))
    9282                icon = "/themes/console/images/email.png";
    93             else if(_icons.containsKey(name))
    94                 icon = _icons.get(name);
    95             //      else
    96             //  icon = "/themes/console/images/plugin.png";
    97    
     83            else
     84                icon = "/themes/console/images/plugin.png";
    9885            HomeHelper.App app = new HomeHelper.App(name, tip, path, icon);
    9986            rv.add(app);
    100    
    101         }
    102 
     87        }
    10388        return rv;
    10489    }
    105 
    10690}