Explicitly specify server base for img.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / util / CmsUiUtils.java
index 6db26296375b1a31b3b92c9ef5832bcfd2957ddf..428c910e54133dee353aa8d034ffc388fb8f30a5 100644 (file)
@@ -281,7 +281,11 @@ public class CmsUiUtils implements CmsConstants {
 
        // IMAGES
        public static String img(Node fileNode, String width, String height) {
-               String src = NodeUtils.getDataPath(fileNode);
+               return img(null, fileNode, width, height);
+       }
+
+       public static String img(String serverBase, Node fileNode, String width, String height) {
+               String src = (serverBase != null ? serverBase : "") + NodeUtils.getDataPath(fileNode);
                return imgBuilder(src, width, height).append("/>").toString();
        }