You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yacy_search_server/htroot/interaction_elements/Footer.java

33 lines
979 B

package interaction_elements;
import net.yacy.cora.protocol.RequestHeader;
12 years ago
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
public class Footer {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader requestHeader, @SuppressWarnings("unused") final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects();
prop.put("enabled_color", env.getConfig("color_tableheader", ""));
int count = 0;
prop.put("enabled_userlogonenabled", env.getConfigBool("interaction.userlogon.enabled", false) ? "1" : "0");
if (env.getConfigBool("interaction.userlogon.enabled", false)) count++;
if (count > 0) {
prop.put("enabled", "1");
prop.put("enabled_userlogonenabled_ratio", Math.round(100/count)-1);
} else {
prop.put("enabled", "0");
}
return prop;
}
}