Foros de discusión

how to remove clickable link

Rohit Chaudhari, modificado hace 12 años.

how to remove clickable link

Junior Member Mensajes: 29 Fecha de incorporación: 8/09/11 Mensajes recientes
Hi All,

After login user name display in Dockbar as link. i want to make user name as non-clickable if user is not admin.

Looking froward for you response.

Thanks,
Rohit
thumbnail
Leo Pratlong, modificado hace 12 años.

RE: how to remove clickable link

Expert Mensajes: 363 Fecha de incorporación: 6/07/10 Mensajes recientes
Hi,
you can use a Hook and override the JSP file which contains this link.

Take a look on: portal-web/docroot/html/portlet/dockbar/view.jsp

On Liferay 6.1 (maybe 6.0.x too), look for these lines:
<aui:a cssclass="user-portrait use-dialog" href="<%= themeDisplay.getURLMyAccount().toString() %>" title="manage-my-account">
					<img alt="<%= HtmlUtil.escape(user.getFullName()) %>" src="<%= HtmlUtil.escape(user.getPortraitURL(themeDisplay)) %>">
				</aui:a>


Change the <aui:a element: add a condition to display this link only if user is admin (by checking the user role).