2009-07-12 03:21:20 +00:00
|
|
|
package net.i2p.router.web;
|
|
|
|
|
|
|
|
public class ConfigUIHelper extends HelperBase {
|
|
|
|
public ConfigUIHelper() {}
|
|
|
|
|
2009-10-22 22:25:53 +00:00
|
|
|
private static final String themes[] = {_x("classic"), _x("dark"), _x("light")};
|
2009-07-12 03:21:20 +00:00
|
|
|
|
|
|
|
public String getSettings() {
|
|
|
|
StringBuilder buf = new StringBuilder(512);
|
2009-07-15 22:56:53 +00:00
|
|
|
String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
|
2009-07-12 03:21:20 +00:00
|
|
|
for (String theme : themes) {
|
2009-07-30 23:10:48 +00:00
|
|
|
buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
|
2009-07-12 03:21:20 +00:00
|
|
|
if (theme.equals(current))
|
|
|
|
buf.append("checked=\"true\" ");
|
2009-10-22 22:25:53 +00:00
|
|
|
buf.append("value=\"").append(theme).append("\">").append(_(theme)).append("<br>\n");
|
|
|
|
}
|
|
|
|
return buf.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final String langs[] = {"de", "en", "fr", "nl", "se", "zh"};
|
|
|
|
private static final String xlangs[] = {_x("German"), _x("English"), _x("French"),
|
|
|
|
_x("Dutch"), _x("Swedish"), _x("Chinese")};
|
|
|
|
|
|
|
|
public String getLangSettings() {
|
|
|
|
StringBuilder buf = new StringBuilder(512);
|
|
|
|
String current = Messages.getLanguage(_context);
|
|
|
|
for (int i = 0; i < langs.length; i++) {
|
|
|
|
// we use "lang" so it is set automagically in CSSHelper
|
|
|
|
buf.append("<input type=\"radio\" class=\"optbox\" name=\"lang\" ");
|
|
|
|
if (langs[i].equals(current))
|
|
|
|
buf.append("checked=\"true\" ");
|
|
|
|
buf.append("value=\"").append(langs[i]).append("\">").append(_(xlangs[i])).append("<br>\n");
|
2009-07-12 03:21:20 +00:00
|
|
|
}
|
|
|
|
return buf.toString();
|
|
|
|
}
|
|
|
|
}
|