Example usage for com.liferay.portal.util PropsValues LAYOUT_GUEST_SHOW_MAX_ICON

List of usage examples for com.liferay.portal.util PropsValues LAYOUT_GUEST_SHOW_MAX_ICON

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues LAYOUT_GUEST_SHOW_MAX_ICON.

Prototype

boolean LAYOUT_GUEST_SHOW_MAX_ICON

To view the source code for com.liferay.portal.util PropsValues LAYOUT_GUEST_SHOW_MAX_ICON.

Click Source Link

Usage

From source file:com.liferay.portlet.configuration.icon.maximize.internal.MaximizePortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    if (!GetterUtil.getBoolean(themeDisplay.getThemeSetting("show-maximize-minimize-application-links"))) {

        return false;
    }/*from  w ww  .jav a2  s.co m*/

    Layout layout = themeDisplay.getLayout();

    if (!layout.isTypePortlet()) {
        return false;
    }

    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();

    LayoutTypeController layoutTypeController = layoutTypePortlet.getLayoutTypeController();

    if (layoutTypeController.isFullPageDisplayable()) {
        return false;
    }

    Portlet portlet = (Portlet) portletRequest.getAttribute(WebKeys.RENDER_PORTLET);

    if (!portlet.hasWindowState(portletRequest.getResponseContentType(), WindowState.MAXIMIZED)) {

        return false;
    }

    Group group = themeDisplay.getScopeGroup();

    if (!themeDisplay.isSignedIn() || (group.hasStagingGroup() && !group.isStagingGroup())
            || !hasUpdateLayoutPermission(themeDisplay)) {

        if (!PropsValues.LAYOUT_GUEST_SHOW_MAX_ICON) {
            return false;
        }
    }

    return true;
}