result.append(id); result.append("\"></td>"); result.append(widgetDialog.dialogHorizontalSpacer(10)); result.append("<td>"); result.append("<table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\""); result.append(".calendar\"><tr>"); result.append( widgetDialog.button( "#", null, "calendar", org.opencms.workplace.Messages.GUI_CALENDAR_CHOOSE_DATE_0, widgetDialog.getButtonStyle())); result.append("</tr></table>"); result.append("</td></tr></table>"); calendarInit(widgetDialog.getMessages(), id, id + ".calendar", "cR", false, false, true, null, true));
/** * Returns the start or end HTML for the OpenCms specific button row.<p> * * Use this method to generate the start and end html for the button row.<p> * * Overwrite the method if the integrated editor needs a specific layout for the button row start or end html.<p> * * @param segment the HTML segment (START / END) * @param widgetDialog the dialog where the widget is used on * @return the html String for the OpenCms specific button row */ protected String buildOpenCmsButtonRow(int segment, I_CmsWidgetDialog widgetDialog) { StringBuffer result = new StringBuffer(256); if (segment == CmsWorkplace.HTML_START) { // generate line and start row HTML result.append(widgetDialog.buttonBarHorizontalLine()); result.append(widgetDialog.buttonBar(CmsWorkplace.HTML_START)); result.append(widgetDialog.buttonBarStartTab(0, 0)); } else { // close button row and generate end line result.append(widgetDialog.buttonBar(CmsWorkplace.HTML_END)); result.append(widgetDialog.buttonBarHorizontalLine()); } return result.toString(); } }
Set<String> helpIdsShown = widgetDialog.getHelpMessageIds(); if (helpIdsShown.contains(helpId)) { String locValue = widgetDialog.getMessages().key(helpId, true); if (locValue == null) { if (widgetDialog.useNewStyle()) { StringBuffer result = new StringBuffer(128); result.append("<div class=\"help\" id=\"help");
result.append(id); result.append("\"></td>"); result.append(widgetDialog.dialogHorizontalSpacer(10)); result.append("<td><table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>"); result.append(widgetDialog.button( getButtonJs(id, "EDITOR"), null, "principal", org.opencms.workplace.Messages.GUI_DIALOG_BUTTON_SEARCH_0, widgetDialog.getButtonStyle())); result.append("</tr></table>"); result.append("</td></tr></table>");
/** * @see org.opencms.widgets.A_CmsWidget#getHelpBubble(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public String getHelpBubble(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { StringBuffer result = new StringBuffer(128); String locKey = getDisabledHelpKey(param); String locValue = widgetDialog.getMessages().key(locKey, true); if (locValue == null) { // there was no help message found for this key, so return a spacer cell return widgetDialog.dialogHorizontalSpacer(16); } else { result.append("<td>"); result.append("<img name=\"img"); result.append(locKey); result.append("\" id=\"img"); result.append(locKey); result.append("\" src=\""); result.append(OpenCms.getLinkManager().substituteLink(cms, "/system/workplace/resources/commons/help.png")); result.append("\" alt=\"\" border=\"0\""); if (widgetDialog.useNewStyle()) { result.append(getJsHelpMouseHandler(widgetDialog, locKey, null)); } else { result.append(getJsHelpMouseHandler(widgetDialog, locKey, CmsStringUtil.escapeJavaScript(locValue))); } result.append("></td>"); return result.toString(); } }
/** * @see org.opencms.widgets.A_CmsSelectWidget#parseSelectOptions(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override protected List<CmsSelectWidgetOption> parseSelectOptions( CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { return parseSelectOptions(cms, widgetDialog.getMessages(), param); }
/** * @see org.opencms.widgets.A_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String result = param.getStringValue(cms); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result) && !"0".equals(result)) { try { result = getCalendarLocalizedTime( widgetDialog.getLocale(), widgetDialog.getMessages(), Long.parseLong(result)); } catch (NumberFormatException e) { if (!CmsMacroResolver.isMacro(result, CmsMacroResolver.KEY_CURRENT_TIME)) { // neither long nor macro, show empty value result = ""; } } } else { result = ""; } return result; }
result.append(widgetDialog.button("javascript:setActiveEditor('" + paramId + "');openLinkDialog('" + Messages.get().getBundle(widgetDialog.getLocale()).key(Messages.GUI_BUTTON_LINKTO_0) + "');", null, "link", "button.linkto", widgetDialog.getButtonStyle())); buttonsActive = true; result.append(widgetDialog.button("javascript:setActiveEditor('" + paramId + "');openAnchorDialog('" + Messages.get().getBundle(widgetDialog.getLocale()).key(Messages.ERR_EDITOR_MESSAGE_NOSELECTION_0) + "');", null, "anchor", Messages.GUI_BUTTON_ANCHOR_0, widgetDialog.getButtonStyle())); buttonsActive = true;
/** * @see org.opencms.widgets.I_CmsWidget#getDialogIncludes(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog) */ @Override public String getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog) { return calendarIncludes(widgetDialog.getLocale()); }
widgetDialog.getUserAgent()); boolean foundWidget = true; if (CmsStringUtil.isEmpty(widgetClassName)) {
result.append(";\"></td>"); result.append(widgetDialog.dialogHorizontalSpacer(10)); result.append("<td><table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>"); result.append(widgetDialog.button( "javascript:showColorPicker('" + id + "');", null, "color_fill", Messages.GUI_BUTTON_COLOR_0, widgetDialog.getButtonStyle())); result.append("</tr></table>");
String locValue = widgetDialog.getMessages().key(locKey, true); if (locValue == null) { return widgetDialog.dialogHorizontalSpacer(16); } else { result.append("<td>"); result.append(OpenCms.getLinkManager().substituteLink(cms, "/system/workplace/resources/commons/help.png")); result.append("\" alt=\"\" border=\"0\""); if (widgetDialog.useNewStyle()) { result.append(getJsHelpMouseHandler(widgetDialog, locKey, null)); } else {
/** * @see org.opencms.widgets.A_CmsSelectWidget#parseSelectOptions(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override protected List<CmsSelectWidgetOption> parseSelectOptions( CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { return parseSelectOptions(cms, widgetDialog.getMessages(), param); }
/** * @see org.opencms.widgets.A_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String result = param.getStringValue(cms); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result) && !"0".equals(result)) { try { result = getCalendarLocalizedTime( widgetDialog.getLocale(), widgetDialog.getMessages(), Long.parseLong(result)); } catch (NumberFormatException e) { if (!CmsMacroResolver.isMacro(result, CmsMacroResolver.KEY_CURRENT_TIME)) { // neither long nor macro, show empty value result = ""; } } } else { result = ""; } return result; }
widgetDialog.button( "javascript:setActiveEditor('" + paramId + "');openLinkDialog('" + Messages.get().getBundle(widgetDialog.getLocale()).key(Messages.GUI_BUTTON_LINKTO_0) + "');", null, "link", "button.linkto", widgetDialog.getButtonStyle())); buttonsActive = true; widgetDialog.button( "javascript:setActiveEditor('" + paramId + "');openAnchorDialog('" + Messages.get().getBundle(widgetDialog.getLocale()).key( Messages.ERR_EDITOR_MESSAGE_NOSELECTION_0) + "');", "anchor", Messages.GUI_BUTTON_ANCHOR_0, widgetDialog.getButtonStyle())); buttonsActive = true;
/** * @see org.opencms.widgets.I_CmsWidget#getDialogIncludes(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog) */ @Override public String getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog) { return calendarIncludes(widgetDialog.getLocale()); }
widgetDialog.getUserAgent()); boolean foundWidget = true; if (CmsStringUtil.isEmpty(widgetClassName)) {
result.append(id); result.append("\"></td>"); result.append(widgetDialog.dialogHorizontalSpacer(10)); result.append("<td>"); result.append("<table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\""); result.append(id); result.append(".calendar\"><tr>"); result.append(widgetDialog.button( "#", null, "calendar", org.opencms.workplace.Messages.GUI_CALENDAR_CHOOSE_DATE_0, widgetDialog.getButtonStyle())); result.append("</tr></table>"); result.append("</td></tr></table>"); widgetDialog.getMessages(), id, id + ".calendar",
result.append(";\"></td>"); result.append(widgetDialog.dialogHorizontalSpacer(10)); result.append( "<td><table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>"); result.append( widgetDialog.button( "javascript:showColorPicker('" + id + "');", null, "color_fill", Messages.GUI_BUTTON_COLOR_0, widgetDialog.getButtonStyle())); result.append("</tr></table>");
String locValue = widgetDialog.getMessages().key(locKey, true); if (!widgetDialog.useNewStyle()) { return widgetDialog.dialogHorizontalSpacer(16); } else { result.append("<td>"); result.append(OpenCms.getLinkManager().substituteLink(cms, "/system/workplace/resources/commons/help.png")); result.append("\" alt=\"\" border=\"0\""); if (widgetDialog.useNewStyle()) {