comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java @ 6230:954dbb0806f3

Add imageLinkHTML function to WikiLinks class
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 07 Jun 2013 11:47:47 +0200
parents cefad5546373
children 24be0cc1c67c
comparison
equal deleted inserted replaced
6229:3fea9701d58d 6230:954dbb0806f3
14 14
15 import org.dive4elements.river.client.client.FLYS; 15 import org.dive4elements.river.client.client.FLYS;
16 16
17 public class WikiLinks 17 public class WikiLinks
18 { 18 {
19 public static String imageLinkHTML(FLYS instance, String url, String imageUrl) {
20 String saml = null;
21 if (instance != null && instance.getCurrentUser() != null) {
22 saml = instance.getCurrentUser().getSamlXMLBase64();
23 }
24 String quotedUrl = SafeHtmlUtils.htmlEscape(url);
25 String quotedImage = SafeHtmlUtils.htmlEscape(imageUrl);
26
27 if (saml != null) {
28 return "<form method=\"POST\" target=\"_blank\" action=\""
29 + quotedUrl + "\">"
30 + "<input type=\"hidden\" name=\"saml\" value=\""
31 + SafeHtmlUtils.htmlEscape(saml) + "\">"
32 + "<input type=\"image\" src=\""+ quotedImage + "\">"
33 + "</form>";
34 }
35 else {
36 return "<a href=\"" + quotedUrl + "\"><img src=\"" + quotedImage + "\"></a>";
37 }
38 }
39
19 public static String linkHTML(FLYS flys, String url, String text) { 40 public static String linkHTML(FLYS flys, String url, String text) {
20 String saml = flys.getCurrentUser().getSamlXMLBase64(); 41 String saml = flys.getCurrentUser().getSamlXMLBase64();
21 String quotedUrl = SafeHtmlUtils.htmlEscape(url); 42 String quotedUrl = SafeHtmlUtils.htmlEscape(url);
22 String quotedText = SafeHtmlUtils.htmlEscape(text); 43 String quotedText = SafeHtmlUtils.htmlEscape(text);
23 if (saml != null) { 44 if (saml != null) {

http://dive4elements.wald.intevation.org