1 package org.cacert.gigi.pages.wot;
3 import java.io.PrintWriter;
6 import javax.servlet.http.HttpServletRequest;
8 import org.cacert.gigi.dbObjects.User;
9 import org.cacert.gigi.localisation.Language;
10 import org.cacert.gigi.output.template.Form;
11 import org.cacert.gigi.output.template.Template;
13 public class MyListingForm extends Form {
15 private static Template template;
18 template = new Template(MyListingForm.class.getResource("MyListingForm.templ"));
23 public MyListingForm(HttpServletRequest hsr, User target) {
29 public boolean submit(PrintWriter out, HttpServletRequest req) {
30 if (req.getParameter("listme") != null && req.getParameter("contactinfo") != null) {
31 boolean on = !req.getParameter("listme").equals("0");
32 target.setDirectoryListing(on);
34 target.setContactInformation(req.getParameter("contactinfo"));
36 target.setContactInformation("");
44 protected void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
45 if (target.wantsDirectoryListing()) {
46 vars.put("selected", "selected");
47 vars.put("notSelected", "");
48 vars.put("activeInfo", target.getContactInformation());
50 vars.put("selected", "");
51 vars.put("notSelected", "selected");
52 vars.put("activeInfo", target.getContactInformation());
54 template.output(out, l, vars);