<%@ page import=" org.opencms.workplace.*, org.opencms.workplace.editors.*, org.opencms.workplace.help.*, org.opencms.jsp.*, java.util.*" %><% CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response); CmsSimplePageEditor wp = new CmsSimplePageEditor(cms); CmsEditorDisplayOptions options = wp.getEditorDisplayOptions(); Properties displayOptions = options.getDisplayOptions(cms); int buttonStyle = wp.getSettings().getUserSettings().getEditorButtonStyle(); //////////////////// start of switch statement switch (wp.getAction()) { case CmsEditor.ACTION_SHOW_ERRORMESSAGE: //////////////////// ACTION: display the common error dialog // do nothing here, only prevents editor content from being displayed! break; case CmsEditor.ACTION_PREVIEW: //////////////////// ACTION: preview the page wp.actionPreview(); break; case CmsEditor.ACTION_EXIT: //////////////////// ACTION: exit the editor wp.actionExit(); break; case CmsEditor.ACTION_SAVEEXIT: //////////////////// ACTION: save the modified content and exit the editor wp.actionSave(); wp.actionExit(); break; case CmsEditor.ACTION_SAVE: //////////////////// ACTION: save the modified content wp.actionSave(); if (wp.getAction() == CmsDialog.ACTION_CANCEL) { // an error occurred during save break; } case CmsDialog.ACTION_DEFAULT: case CmsEditor.ACTION_SHOW: default: //////////////////// ACTION: show editor frame (default) // escape the content and title parameters to display them in a form wp.escapeParams(); wp.setParamAction(null); %> (<%= wp.getSettings().getUser().getName() %>) - <%= wp.getParamResource() %> "> "); out.println(wp.buttonBarSpacer(2)); } else { %><% } if (elementSelection) { out.println(""); out.println(wp.buttonBarSeparator(5, 5)); out.println(wp.button("javascript:buttonAction(4);", null, "elements", org.opencms.workplace.editors.Messages.GUI_EDITOR_DIALOG_ELEMENTS_BUTTON_0, buttonStyle)); } else { %><% } } else { // build hidden input fields that editor works correctly %><% } if (options.showElement("option.properties", displayOptions)) { if (elementLanguage && !elementSelection) { out.println(wp.buttonBarSeparator(5, 5)); } out.println(wp.button("javascript:buttonAction(5);", null, "properties", org.opencms.workplace.editors.Messages.GUI_EDITOR_DIALOG_PROPERTIES_BUTTON_0, buttonStyle)); } %> <%= wp.button("javascript:buttonAction(2);", null, "preview.png", org.opencms.workplace.editors.Messages.GUI_BUTTON_PREVIEW_0, buttonStyle) %> <%= wp.buttonBarSpacer(5) %> <%= wp.buttonBar(CmsWorkplace.HTML_END) %> <%= wp.buttonBarHorizontalLine() %> <%= wp.buttonBar(CmsWorkplace.HTML_START) %> <%= wp.buttonBarStartTab(0, 5) %> <% if (options.showElement("button.customized", displayOptions)) {%> <% } %> <%= wp.button("javascript:buttonAction(7);", null, "save_exit", org.opencms.workplace.editors.Messages.GUI_BUTTON_SAVECLOSE_0, buttonStyle) %> <%= wp.button("javascript:buttonAction(8);", null, "save",org.opencms.workplace.editors.Messages.GUI_BUTTON_SAVE_0, buttonStyle) %> <% if (wp.isHelpEnabled()) {%> <%= wp.buttonBarSeparator(5, 5) %> <%= wp.button("javascript:openOnlineHelp('/editors/simplehtml');", null, "help.png", org.opencms.workplace.editors.Messages.GUI_BUTTON_HELP_0, buttonStyle) %><% } %> <%= wp.button("javascript:confirmExit();", null, "exit", org.opencms.workplace.editors.Messages.GUI_BUTTON_CLOSE_0, buttonStyle) %> <%= wp.buttonBarSpacer(5) %> <%= wp.buttonBar(CmsWorkplace.HTML_END) %>
<%= wp.buttonBar(CmsWorkplace.HTML_START) %> <%= wp.buttonBarStartTab(0, 5) %> <% boolean elementSelection = options.showElement("option.element.selection", displayOptions); boolean elementLanguage = options.showElement("option.element.language", displayOptions); if (elementSelection || elementLanguage) { out.println(wp.buttonBarLabel(org.opencms.workplace.editors.Messages.GUI_INPUT_ELEMENT_0)); if (elementLanguage) { out.println("" + wp.buildSelectElementLanguage("name=\"" + CmsEditor.PARAM_ELEMENTLANGUAGE + "\" width=\"150\" onchange=\"buttonAction(3);\"") + "" + wp.buildSelectElementName("name=\"" + CmsDefaultPageEditor.PARAM_ELEMENTNAME + "\" width=\"150\" onchange=\"buttonAction(3);\"") + " <%= wp.buttonActionDirectEdit("buttonAction(9);", buttonStyle) %> 
<% } %>