
META-INF.resources.wiki.configuration.jsp Maven / Gradle / Ivy
The newest version!
<%--
/**
* 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="/wiki/init.jsp" %>
<%
Set currentVisibleNodes = new HashSet(wikiPortletInstanceSettingsHelper.getAllNodeNames());
// Left list
List leftList = new ArrayList();
String[] visibleNodeNames = wikiPortletInstanceSettingsHelper.getVisibleNodeNames();
for (String folderColumn : visibleNodeNames) {
if (currentVisibleNodes.contains(folderColumn)) {
leftList.add(new KeyValuePair(folderColumn, HtmlUtil.escape(LanguageUtil.get(request, folderColumn))));
}
}
Arrays.sort(visibleNodeNames);
String[] hiddenNodes = wikiPortletInstanceSettingsHelper.getHiddenNodes();
Arrays.sort(hiddenNodes);
for (String folderColumn : currentVisibleNodes) {
if ((Arrays.binarySearch(hiddenNodes, folderColumn) < 0) && (Arrays.binarySearch(visibleNodeNames, folderColumn) < 0)) {
leftList.add(new KeyValuePair(folderColumn, HtmlUtil.escape(LanguageUtil.get(request, folderColumn))));
}
}
// Right list
List rightList = new ArrayList();
for (String folderColumn : hiddenNodes) {
if (currentVisibleNodes.contains(folderColumn)) {
if (Arrays.binarySearch(visibleNodeNames, folderColumn) < 0) {
rightList.add(new KeyValuePair(folderColumn, HtmlUtil.escape(LanguageUtil.get(request, folderColumn))));
}
}
}
rightList = ListUtil.sort(rightList, new KeyValuePairComparator(false, true));
%>
function saveConfiguration() {
var Util = Liferay.Util;
var form = AUI.$(document. fm);
form.fm('visibleNodes').val(Util.listSelect(form.fm('currentVisibleNodes')));
form.fm('hiddenNodes').val(Util.listSelect(form.fm('availableVisibleNodes')));
submitForm(form);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy