META-INF.resources.message_boards.edit_category.jsp Maven / Gradle / Ivy
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ include file="/message_boards/init.jsp" %>
<%
String redirect = ParamUtil.getString(request, "redirect");
MBRequestHelper mbRequestHelper = new MBRequestHelper(request);
MBCategory category = mbRequestHelper.getCategory();
long categoryId = MBUtil.getCategoryId(request, category);
long parentCategoryId = mbRequestHelper.getParentCategoryId();
String defaultDisplayStyle = MBCategoryConstants.DEFAULT_DISPLAY_STYLE;
if ((category == null) && (parentCategoryId > 0)) {
MBCategory parentCategory = MBCategoryLocalServiceUtil.getCategory(parentCategoryId);
defaultDisplayStyle = parentCategory.getDisplayStyle();
}
String displayStyle = BeanParamUtil.getString(category, request, "displayStyle", defaultDisplayStyle);
MBMailingList mailingList = null;
if (categoryId > 0) {
mailingList = MBMailingListLocalServiceUtil.fetchCategoryMailingList(scopeGroupId, categoryId);
}
if ((category == null) && (mailingList == null)) {
if (parentCategoryId > 0) {
mailingList = MBMailingListLocalServiceUtil.fetchCategoryMailingList(scopeGroupId, parentCategoryId);
}
}
if (category != null) {
MBBreadcrumbUtil.addPortletBreadcrumbEntries(category, request, renderResponse);
if (!layout.isTypeControlPanel()) {
PortalUtil.addPortletBreadcrumbEntry(request, LanguageUtil.get(request, "edit"), currentURL);
}
}
else {
MBBreadcrumbUtil.addPortletBreadcrumbEntries(parentCategoryId, request, renderResponse);
if (!layout.isTypeControlPanel()) {
PortalUtil.addPortletBreadcrumbEntry(request, LanguageUtil.get(request, "add-category[message-board]"), currentURL);
}
}
boolean portletTitleBasedNavigation = GetterUtil.getBoolean(portletConfig.getInitParameter("portlet-title-based-navigation"));
MBHomeDisplayContext mbHomeDisplayContext = mbDisplayContextProvider.getMBHomeDisplayContext(request, response);
if (portletTitleBasedNavigation) {
portletDisplay.setShowBackIcon(true);
portletDisplay.setURLBack(redirect);
renderResponse.setTitle(LanguageUtil.get(request, mbHomeDisplayContext.getTitle()));
}
%>
>
<%
String parentCategoryName = StringPool.BLANK;
try {
MBCategory parentCategory = MBCategoryLocalServiceUtil.getCategory(parentCategoryId);
parentCategoryName = parentCategory.getName();
}
catch (NoSuchCategoryException nsce) {
}
%>
<%
for (int i = 0; i < MBCategoryConstants.DISPLAY_STYLES.length; i++) {
%>
<%
}
%>
<%
String protocol = BeanParamUtil.getString(mailingList, request, "inProtocol", "pop3");
%>
function saveCategory() {
document. fm. <%= Constants.CMD %>.value = '<%= (category == null) ? Constants.ADD : Constants.UPDATE %>';
submitForm(document. fm);
}
Liferay.Util.toggleBoxes(' mailingListActive', ' mailingListSettings');
Liferay.Util.toggleBoxes(' outCustom', ' outCustomSettings');
© 2015 - 2025 Weber Informatics LLC | Privacy Policy