Author: toad
Date: 2009-02-26 19:07:54 +0000 (Thu, 26 Feb 2009)
New Revision: 25840

Modified:
   trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
Log:
Fix directory name lagging behind chosen dir. Ugly. :|


Modified: trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java  
2009-02-26 18:34:35 UTC (rev 25839)
+++ trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java  
2009-02-26 19:07:54 UTC (rev 25840)
@@ -71,10 +71,9 @@
                
                PageMaker pageMaker = toadletContext.getPageMaker();
 
-               HTMLNode pageNode = pageMaker.getPageNode(l10n("listingTitle", 
"path", currentPath.getAbsolutePath()), toadletContext);
-               HTMLNode contentNode = pageMaker.getContentNode(pageNode);
-
                if(!core.allowUploadFrom(thisPath)) {
+                       HTMLNode pageNode = 
pageMaker.getPageNode(l10n("listingTitle", "path", thisPath.getAbsolutePath()), 
toadletContext);
+                       HTMLNode contentNode = 
pageMaker.getContentNode(pageNode);
                        HTMLNode infoboxE = 
contentNode.addChild(pageMaker.getInfobox("infobox-error",  "Forbidden"));
                        HTMLNode infoboxEContent = 
pageMaker.getContentNode(infoboxE);
                        infoboxEContent.addChild("#", l10n("dirAccessDenied"));
@@ -90,18 +89,24 @@
                                }
                        }
                }
-
-               if(toadletContext.isAllowedFullAccess())
-                       contentNode.addChild(core.alerts.createSummary());
                
-               HTMLNode infoboxDiv = contentNode.addChild("div", "class", 
"infobox");
-               infoboxDiv.addChild("div", "class", "infobox-header", 
l10n("listing", "path",  currentPath.getAbsolutePath()));
-               HTMLNode listingDiv = infoboxDiv.addChild("div", "class", 
"infobox-content");
+               HTMLNode pageNode;
 
                if (currentPath.exists() && currentPath.isDirectory() && 
currentPath.canRead()) {
                        // Known safe at this point
                        currentPath = thisPath;
 
+                       pageNode = pageMaker.getPageNode(l10n("listingTitle", 
"path", currentPath.getAbsolutePath()), toadletContext);
+                       HTMLNode contentNode = 
pageMaker.getContentNode(pageNode);
+                       if(toadletContext.isAllowedFullAccess())
+                               
contentNode.addChild(core.alerts.createSummary());
+                       
+                       HTMLNode infoboxDiv = contentNode.addChild("div", 
"class", "infobox");
+                       infoboxDiv.addChild("div", "class", "infobox-header", 
l10n("listing", "path",  currentPath.getAbsolutePath()));
+                       HTMLNode listingDiv = infoboxDiv.addChild("div", 
"class", "infobox-content");
+
+
+                       
                        File[] files = currentPath.listFiles();
                        Arrays.sort(files, new Comparator<File>() {
                                public int compare(File firstFile, File 
secondFile) {
@@ -173,6 +178,15 @@
                                }
                        }
                } else {
+                       pageNode = pageMaker.getPageNode(l10n("listingTitle", 
"path", currentPath.getAbsolutePath()), toadletContext);
+                       HTMLNode contentNode = 
pageMaker.getContentNode(pageNode);
+                       if(toadletContext.isAllowedFullAccess())
+                               
contentNode.addChild(core.alerts.createSummary());
+                       
+                       HTMLNode infoboxDiv = contentNode.addChild("div", 
"class", "infobox");
+                       infoboxDiv.addChild("div", "class", "infobox-header", 
l10n("listing", "path",  currentPath.getAbsolutePath()));
+                       HTMLNode listingDiv = infoboxDiv.addChild("div", 
"class", "infobox-content");
+
                        listingDiv.addChild("#", l10n("dirCannotBeRead", 
"path", currentPath.getAbsolutePath()));
                        HTMLNode ulNode = listingDiv.addChild("ul");
                        ulNode.addChild("li", l10n("checkPathExist"));

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to