📄 newresource_folder.jsp
字号:
<%@ page import="org.opencms.workplace.explorer.*,org.opencms.main.OpenCms"%>
<%!String getCheckBoxValue(Boolean b) {
boolean bool = b.booleanValue();
return (bool) ? "checked=\"checked\"" : "";
}%>
<%
// initialize the workplace class
CmsNewResourceFolder wp = new CmsNewResourceFolder(pageContext, request, response);
CmsDefaultUserSettings userSettings = OpenCms.getWorkplaceManager().getDefaultUserSettings();
Boolean editPropsChecked = userSettings.getNewFolderEditProperties() ;
Boolean createIndexPageChecked = userSettings.getNewFolderCreateIndexPage();
//////////////////// start of switch statement
switch (wp.getAction()) {
case CmsNewResourceFolder.ACTION_CANCEL:
//////////////////// ACTION: cancel button pressed
wp.actionCloseDialog();
break;
case CmsNewResourceFolder.ACTION_OK:
//////////////////// ACTION: resource name specified and form submitted
wp.actionCreateResource();
if (wp.isResourceCreated()) {
wp.actionEditProperties(); // redirects only if the edit properties option was checked
}
break;
case CmsNewResourceFolder.ACTION_NEWFORM:
case CmsNewResourceFolder.ACTION_DEFAULT:
default:
//////////////////// ACTION: show the form to specify the folder name, edit properties option and create index file option
wp.setParamAction(wp.DIALOG_OK);
%>
<%=wp.htmlStart("help.explorer.new.file")%>
<%@page import="org.opencms.configuration.CmsDefaultUserSettings"%>
<script type="text/javascript">
<!--
var labelFinish = "<%= wp.key(Messages.GUI_BUTTON_ENDWIZARD_0) %>";
var labelNext = "<%= wp.key(Messages.GUI_BUTTON_CONTINUE_0) %>";
function checkValue() {
var resName = document.getElementById("newresfield").value;
var theButton = document.getElementById("nextButton");
if (resName.length == 0) {
if (theButton.disabled == false) {
theButton.disabled =true;
}
} else {
if (theButton.disabled == true) {
theButton.disabled = false;
}
}
}
function toggleButtonLabel() {
var theCheckBox = document.getElementById("newresedit");
var theButton = document.getElementById("nextButton");
if (theCheckBox.checked == true) {
theButton.value = labelNext;
} else {
theButton.value = labelFinish;
}
}
//-->
</script>
<%=wp.bodyStart("dialog")%>
<%=wp.dialogStart()%>
<%=wp.dialogContentStart(wp.getParamTitle())%>
<form name="main" action="<%= wp.getDialogUri() %>" method="post"
class="nomargin"
onsubmit="return submitAction('<%= wp.DIALOG_OK %>', null, 'main');">
<%=wp.paramsAsHidden()%> <input type="hidden"
name="<%= wp.PARAM_FRAMENAME %>" value="">
<table border="0" width="100%">
<tr>
<td style="white-space: nowrap;" unselectable="on"><%=wp.key(Messages.GUI_RESOURCE_NAME_0)%></td>
<td class="maxwidth"><input name="<%= wp.PARAM_RESOURCE %>"
id="newresfield" type="text" value="" class="maxwidth"
onkeyup="checkValue();"></td>
</tr>
<tr>
<td> </td>
<td style="white-space: nowrap;" unselectable="on" class="maxwidth"><input
name="<%= wp.PARAM_NEWRESOURCEEDITPROPS %>" id="newresedit"
type="checkbox" value="<%= editPropsChecked %>"
<%= this.getCheckBoxValue(editPropsChecked)%>
onclick="toggleButtonLabel();"> <%=wp.key(Messages.GUI_NEWFILE_EDITPROPERTIES_0)%></td>
</tr>
<tr>
<td> </td>
<td style="white-space: nowrap;" unselectable="on" class="maxwidth"><input
name="<%= wp.PARAM_CREATEINDEX %>" id="<%= wp.PARAM_CREATEINDEX %>"
type="checkbox" value="<%= createIndexPageChecked%>"
<%= this.getCheckBoxValue(createIndexPageChecked) %>> <%=wp.key(Messages.GUI_NEWFOLDER_CREATEINDEX_0)%></td>
</tr>
</table>
<%=wp.dialogContentEnd()%> <%=wp.dialogButtonsNextCancel("id=\"nextButton\" disabled=\"disabled\"", null)%>
</form>
<%=wp.dialogEnd()%>
<%=wp.bodyEnd()%>
<%=wp.htmlEnd()%>
<%
}
//////////////////// end of switch statement
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -