redirects to the current Site friendly URL now also for Profile

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/liferay62-plugins/social-dockbar-hook@130373 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-07-14 13:26:58 +00:00
parent d41683ee2a
commit 567828c3db
1 changed files with 8 additions and 4 deletions

View File

@ -12,8 +12,13 @@
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
/**
* Modified for custom myProfile URL
*/
--%> --%>
<%@page import="org.gcube.common.portal.GCubePortalConstants"%>
<liferay-util:buffer var="userName"> <liferay-util:buffer var="userName">
<c:if test="<%= themeDisplay.isImpersonated() %>"> <c:if test="<%= themeDisplay.isImpersonated() %>">
<b class="alert-icon icon-warning-sign"></b> <b class="alert-icon icon-warning-sign"></b>
@ -130,10 +135,9 @@
myAccountURL = HttpUtil.setParameter(myAccountURL, "controlPanelCategory", PortletCategoryKeys.MY); myAccountURL = HttpUtil.setParameter(myAccountURL, "controlPanelCategory", PortletCategoryKeys.MY);
%> %>
<%//Patch for myProfile URL <%//Patch for myProfile URL
String currentVirtualHost = request.getServerName(); PortalContext context = PortalContext.getConfiguration();
String groupName = currentVirtualHost.split("\\.")[0]; String mySiteURL = context.getSiteLandingPagePath(request);
String myProfileURL = mySiteURL + GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
String myProfileURL = GCubePortalConstants.PREFIX_GROUP_URL + "/" + groupName + "/profile";
%> %>
<li class="my-sites-menu private-site"> <li class="my-sites-menu private-site">
<a href="<%= myProfileURL %>" role="menuitem"> <a href="<%= myProfileURL %>" role="menuitem">