Example usage for com.liferay.portal.kernel.util PortalUtil getLayoutTarget

List of usage examples for com.liferay.portal.kernel.util PortalUtil getLayoutTarget

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PortalUtil getLayoutTarget.

Prototype

public static String getLayoutTarget(Layout layout) 

Source Link

Usage

From source file:com.liferay.site.navigation.site.map.web.internal.display.context.SiteNavigationSiteMapDisplayContext.java

License:Open Source License

private void _buildLayoutView(Layout layout, String cssClass, boolean useHtmlTitle, ThemeDisplay themeDisplay,
        StringBundler sb) throws Exception {

    String layoutURL = PortalUtil.getLayoutURL(layout, themeDisplay);
    String target = PortalUtil.getLayoutTarget(layout);

    sb.append("<a");

    LayoutType layoutType = layout.getLayoutType();

    if (layoutType.isBrowsable()) {
        sb.append(" href=\"");
        sb.append(layoutURL);/*w  ww .  ja va2  s.c  o m*/
        sb.append("\" ");
        sb.append(target);
    }

    if (Validator.isNotNull(cssClass)) {
        sb.append(" class=\"");
        sb.append(cssClass);
        sb.append("\" ");
    }

    sb.append("> ");

    String layoutName = HtmlUtil.escape(layout.getName(themeDisplay.getLocale()));

    if (useHtmlTitle) {
        layoutName = HtmlUtil.escape(layout.getHTMLTitle(themeDisplay.getLocale()));
    }

    sb.append(layoutName);
    sb.append("</a>");
}