META-INF.resources.edit_scope.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.portlet.configuration.web
Show all versions of com.liferay.portlet.configuration.web
Liferay Portlet Configuration Web
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%@ include file="/init.jsp" %>
<%
String scopeType = GetterUtil.getString(portletPreferences.getValue("lfrScopeType", null));
String scopeLayoutUuid = GetterUtil.getString(portletPreferences.getValue("lfrScopeLayoutUuid", null));
Group group = null;
if (Validator.isNull(scopeType)) {
group = themeDisplay.getSiteGroup();
}
else if (scopeType.equals("company")) {
group = GroupLocalServiceUtil.getGroup(themeDisplay.getCompanyGroupId());
}
else if (scopeType.equals("layout")) {
for (Layout scopeGroupLayout : LayoutLocalServiceUtil.getScopeGroupLayouts(layout.getGroupId(), layout.isPrivateLayout())) {
if (scopeLayoutUuid.equals(scopeGroupLayout.getUuid())) {
group = GroupLocalServiceUtil.getLayoutGroup(scopeGroupLayout.getCompanyId(), scopeGroupLayout.getPlid());
break;
}
}
if (group == null) {
group = themeDisplay.getSiteGroup();
}
}
Set availableGroups = new LinkedHashSet();
availableGroups.add(group);
availableGroups.add(themeDisplay.getSiteGroup());
availableGroups.add(company.getGroup());
for (Layout scopeGroupLayout : LayoutLocalServiceUtil.getScopeGroupLayouts(layout.getGroupId(), layout.isPrivateLayout())) {
availableGroups.add(scopeGroupLayout.getScopeGroup());
}
%>
<%
for (Group availableGroup : availableGroups) {
String availableGroupScopeType = StringPool.BLANK;
String availableGroupScopeLayoutUuid = StringPool.BLANK;
if (availableGroup.isCompany()) {
availableGroupScopeType = "company";
}
else if (availableGroup.isLayout()) {
availableGroupScopeType = "layout";
Layout availableGroupLayout = LayoutLocalServiceUtil.getLayout(availableGroup.getClassPK());
availableGroupScopeLayoutUuid = availableGroupLayout.getUuid();
}
%>
<%
}
%>