if a new pop-up page is set in config portal, then this page applies

also to the default page configuration for the httpd if no path is
given.
pull/1/head
Michael Peter Christen 13 years ago
parent fa7b3481b3
commit 8aba045ba1

@ -229,8 +229,8 @@ public class ConfigBasic {
final boolean properName = (sb.peers.mySeed().getName().length() >= 3) && (!(Seed.isDefaultPeerName(sb.peers.mySeed().getName())));
final boolean properPort = (sb.peers.mySeed().isSenior()) || (sb.peers.mySeed().isPrincipal());
if ((env.getConfig("defaultFiles", "").startsWith("ConfigBasic.html,"))) {
env.setConfig("defaultFiles", env.getConfig("defaultFiles", "").substring(17));
if ((env.getConfig(SwitchboardConstants.BROWSER_DEFAULT, "").startsWith("ConfigBasic.html,"))) {
env.setConfig(SwitchboardConstants.BROWSER_DEFAULT, env.getConfig(SwitchboardConstants.BROWSER_DEFAULT, "").substring(17));
env.setConfig("browserPopUpPage", "Status.html");
HTTPDFileHandler.initDefaultPath();
}

@ -50,14 +50,16 @@ public class ConfigPortal {
if (post.containsKey("popup")) {
final String popup = post.get("popup", "status");
if ("front".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html?display=2");
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html");
} else if ("search".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html?display=2");
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html");
} else if ("interactive".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html?display=2");
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html");
} else {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
}
sb.setConfig(SwitchboardConstants.BROWSER_DEFAULT, sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"));
HTTPDFileHandler.initDefaultPath();
}
if (post.containsKey("searchpage_set")) {
final String newGreeting = post.get(SwitchboardConstants.GREETING, "");

@ -192,7 +192,7 @@ public final class HTTPDFileHandler {
public static final void initDefaultPath() {
// create default files array
defaultFiles = switchboard.getConfig("defaultFiles","index.html").split(",");
defaultFiles = switchboard.getConfig(SwitchboardConstants.BROWSER_DEFAULT,"index.html").split(",");
if (defaultFiles.length == 0) defaultFiles = new String[] {"index.html"};
indexForward = switchboard.getConfig(SwitchboardConstants.INDEX_FORWARD, "");
if (indexForward.startsWith("/")) indexForward = indexForward.substring(1);

@ -426,6 +426,7 @@ public final class SwitchboardConstants {
*/
public static final String BROWSER_POP_UP_TRIGGER = "browserPopUpTrigger";
public static final String BROWSER_POP_UP_PAGE = "browserPopUpPage";
public static final String BROWSER_DEFAULT = "defaultFiles";
/**
* forwarder of the index page

Loading…
Cancel
Save