
META-INF.resources.wiki.change_page_parent.jspf 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.
*/
--%>
<%
String parentText = StringPool.BLANK;
WikiPage parentPage = wikiPage.getViewableParentPage();
if (parentPage == null) {
parentText = StringPool.OPEN_PARENTHESIS + LanguageUtil.get(request, "none") + StringPool.CLOSE_PARENTHESIS;
}
else {
parentText = parentPage.getTitle();
parentPage = parentPage.getViewableParentPage();
while (parentPage != null) {
parentText = parentPage.getTitle() + " » " + parentText;
parentPage = parentPage.getViewableParentPage();
}
}
List childPages = WikiPageLocalServiceUtil.getChildren(node.getNodeId(), true, StringPool.BLANK);
childPages = ListUtil.sort(childPages);
childPages.remove(wikiPage);
%>
<%
boolean newParentAvailable = true;
if (childPages.isEmpty()) {
newParentAvailable = false;
%>
<%
}
else {
%>
<%
for (WikiPage childPage : childPages) {
if (Validator.isNull(childPage.getRedirectTitle())) {
request.setAttribute(WikiWebKeys.WIKI_TREE_WALKER_DEPTH, 1);
request.setAttribute(WikiWebKeys.WIKI_TREE_WALKER_PAGE, wikiPage);
request.setAttribute(WikiWebKeys.WIKI_TREE_WALKER_PARENT, childPage);
%>
<%
}
}
%>
<%
}
%>
function changeParent() {
document. fm. <%= Constants.CMD %>.value = '<%= Constants.CHANGE_PARENT %>';
submitForm(document. fm);
}
function publishPage() {
document. fm. workflowAction.value = '<%= WorkflowConstants.ACTION_PUBLISH %>';
changeParent();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy