Index: portal-impl/src/com/liferay/portal/util/PropsUtil.java
===================================================================
--- portal-impl/src/com/liferay/portal/util/PropsUtil.java (revisión: 13939)
+++ portal-impl/src/com/liferay/portal/util/PropsUtil.java (copia de trabajo)
@@ -663,6 +663,10 @@
public static final String IMAGE_DEFAULT_USER_PORTRAIT = "image.default.user.portrait";
+ public static final String IMAGE_DEFAULT_MALE_USER_PORTRAIT = "image.default.male.user.portrait";
+
+ public static final String IMAGE_DEFAULT_FEMALE_USER_PORTRAIT = "image.default.female.user.portrait";
+
// Editors
public static final String EDITOR_WYSIWYG_DEFAULT = "editor.wysiwyg.default";
Index: portal-impl/src/com/liferay/portal/service/impl/ImageLocalUtil.java
===================================================================
--- portal-impl/src/com/liferay/portal/service/impl/ImageLocalUtil.java (revisión: 13939)
+++ portal-impl/src/com/liferay/portal/service/impl/ImageLocalUtil.java (copia de trabajo)
@@ -89,6 +89,14 @@
return _instance._defaultUserPortrait;
}
+ public static Image getDefaultMaleUserPortrait() {
+ return _instance._defaultMaleUserPortrait;
+ }
+
+ public static Image getDefaultFemaleUserPortrait() {
+ return _instance._defaultFemaleUserPortrait;
+ }
+
public static Image getImage(long imageId) {
try {
if (imageId > 0) {
@@ -245,6 +253,27 @@
"Unable to configure the default use portrait: " +
ioe.getMessage());
}
+
+ // Set default male portrait if defined and exists, else value is default portrait
+ try {
+
+ InputStream is = classLoader.getResourceAsStream(PropsUtil.get(PropsUtil.IMAGE_DEFAULT_MALE_USER_PORTRAIT));
+ _defaultMaleUserPortrait = ImageLocalUtil.getImage(is);
+ }
+ catch (IOException ioe) {
+ _defaultMaleUserPortrait = ImageLocalUtil.getDefaultUserPortrait();
+ }
+
+ // Set default female portrait if defined and exists, else value is default portrait
+ try {
+
+ InputStream is = classLoader.getResourceAsStream(PropsUtil.get(PropsUtil.IMAGE_DEFAULT_FEMALE_USER_PORTRAIT));
+ _defaultFemaleUserPortrait = ImageLocalUtil.getImage(is);
+ }
+ catch (IOException ioe) {
+ _defaultFemaleUserPortrait = ImageLocalUtil.getDefaultUserPortrait();
+ }
+
}
private Image _getImage(byte[] bytes) throws IOException {
@@ -311,5 +340,7 @@
private Image _defaultSpacer;
private Image _defaultCompanyLogo;
private Image _defaultUserPortrait;
+ private Image _defaultMaleUserPortrait;
+ private Image _defaultFemaleUserPortrait;
}
\ Sin fin-de-línea al final del archivo
Index: portal-impl/src/com/liferay/portal/servlet/ImageServlet.java
===================================================================
--- portal-impl/src/com/liferay/portal/servlet/ImageServlet.java (revisión: 13939)
+++ portal-impl/src/com/liferay/portal/servlet/ImageServlet.java (copia de trabajo)
@@ -97,6 +97,12 @@
else if (path.startsWith("/user_portrait")) {
return ImageLocalUtil.getDefaultUserPortrait();
}
+ else if (path.startsWith("/male_user_portrait")) {
+ return ImageLocalUtil.getDefaultMaleUserPortrait();
+ }
+ else if (path.startsWith("/female_user_portrait")) {
+ return ImageLocalUtil.getDefaultFemaleUserPortrait();
+ }
else {
throw new NoSuchImageException(
"No default image exists for " + imageId);
Index: portal-impl/classes/portal.properties
===================================================================
--- portal-impl/classes/portal.properties (revisión: 13939)
+++ portal-impl/classes/portal.properties (copia de trabajo)
@@ -2348,6 +2348,14 @@
# missing user portrait images. This image must be found in the class path.
#
image.default.user.portrait=com/liferay/portal/dependencies/user_portrait.gif
+
+ #
+ # Set the location of the default user portrait image that is used for
+ # missing male and female user portrait images. This image must be found in the
+ # class path. If not specified, image.default.user.portrait is used.
+ #
+ image.default.male.user.portrait=
+ image.default.female.user.portrait=
##
## Editors
Index: portal-web/docroot/html/taglib/ui/user_display/start.jsp
===================================================================
--- portal-web/docroot/html/taglib/ui/user_display/start.jsp (revisión: 13939)
+++ portal-web/docroot/html/taglib/ui/user_display/start.jsp (copia de trabajo)
@@ -52,7 +52,12 @@