/** * @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_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_CmsAdeGalleryWidget#getOpenPreviewCall(org.opencms.widgets.I_CmsWidgetDialog, java.lang.String) */ @Override protected String getOpenPreviewCall(I_CmsWidgetDialog widgetDialog, String id) { // using the 'cmsOpenImagePreview' function instead of 'cmsOpenPreview' StringBuffer sb = new StringBuffer(64); // using the 'cmsOpenImagePreview' function instead of 'cmsOpenPreview' sb.append("javascript:cmsOpenImagePreview('").append( widgetDialog.getMessages().key(Messages.GUI_BUTTON_PREVIEW_0)); sb.append("', '").append(OpenCms.getSystemInfo().getOpenCmsContext()); sb.append("', '").append(id); sb.append("'); return false;"); return sb.toString(); }
/** * Returns the javascript call to open the preview dialog.<p> * * @param widgetDialog the dialog where the widget is used on * @param id the field id * * @return the javascript call to open the preview dialog */ protected String getOpenPreviewCall(I_CmsWidgetDialog widgetDialog, String id) { StringBuffer sb = new StringBuffer(64); sb.append("javascript:cmsOpenPreview('").append(widgetDialog.getMessages().key(Messages.GUI_BUTTON_PREVIEW_0)); sb.append("', '").append(OpenCms.getSystemInfo().getOpenCmsContext()); sb.append("', '").append(id); sb.append("'); return false;"); return sb.toString(); }
String locValue = widgetDialog.getMessages().key(helpId, true); if (locValue == null) {
String locValue = widgetDialog.getMessages().key(helpId, true); if (locValue == null) {
String locValue = widgetDialog.getMessages().key(helpId, true); if (locValue == null) {
String locValue = widgetDialog.getMessages().key(helpId, true); if (locValue == null) {
String locValue = widgetDialog.getMessages().key(helpId, true); if (locValue == null) {
/** * @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(); } }
String locValue = widgetDialog.getMessages().key(locKey, true); if (locValue == null) {
String locValue = widgetDialog.getMessages().key(locKey, true); if (locValue == null) {
/** * @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; }
/** * @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 = super.getWidgetStringValue(cms, widgetDialog, param); String configuration = CmsMacroResolver.resolveMacros(getConfiguration(), cms, widgetDialog.getMessages()); if (configuration == null) { configuration = param.getDefault(cms); } List<CmsSelectWidgetOption> options = CmsSelectWidgetOption.parseOptions(configuration); for (int m = 0; m < options.size(); m++) { CmsSelectWidgetOption option = options.get(m); if (result.equals(option.getValue())) { result = option.getOption(); break; } } return result; }
/** * @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 = super.getWidgetStringValue(cms, widgetDialog, param); String configuration = CmsMacroResolver.resolveMacros(getConfiguration(), cms, widgetDialog.getMessages()); if (configuration == null) { configuration = param.getDefault(cms); } List options = CmsSelectWidgetOption.parseOptions(configuration); for (int m = 0; m < options.size(); m++) { CmsSelectWidgetOption option = (CmsSelectWidgetOption)options.get(m); if (result.equals(option.getValue())) { result = option.getOption(); break; } } return result; }
/** * @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; }
/** * @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 = super.getWidgetStringValue(cms, widgetDialog, param); String configuration = CmsMacroResolver.resolveMacros(getConfiguration(), cms, widgetDialog.getMessages()); if (configuration == null) { configuration = param.getDefault(cms); } List<CmsSelectWidgetOption> options = CmsSelectWidgetOption.parseOptions(configuration); for (int m = 0; m < options.size(); m++) { CmsSelectWidgetOption option = options.get(m); if (result.equals(option.getValue())) { result = option.getOption(); break; } } return result; }
/** * @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 = super.getWidgetStringValue(cms, widgetDialog, param); String configuration = CmsMacroResolver.resolveMacros(getConfiguration(), cms, widgetDialog.getMessages()); if (configuration == null) { configuration = param.getDefault(cms); } List options = CmsSelectWidgetOption.parseOptions(configuration); for (int m = 0; m < options.size(); m++) { CmsSelectWidgetOption option = (CmsSelectWidgetOption)options.get(m); if (result.equals(option.getValue())) { result = option.getOption(); break; } } return result; }
configuration = CmsMacroResolver.resolveMacros(configuration, cms, widgetDialog.getMessages()); m_selectOptions = CmsSelectWidgetOption.parseOptions(configuration); if (m_selectOptions == Collections.EMPTY_LIST) {
/** * Returns the list of configured select options, parsing the configuration String if required.<p> * * The list elements are of type <code>{@link CmsSelectWidgetOption}</code>. * The configuration String is parsed only once and then stored internally.<p> * * @param cms the current users OpenCms context * @param widgetDialog the dialog of this widget * @param param the widget parameter of this dialog * * @return the list of select options * * @see CmsSelectWidgetOption */ protected List parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { if (m_selectOptions == null) { String configuration = getConfiguration(); if (configuration == null) { // workaround: use the default value to parse the options configuration = param.getDefault(cms); } configuration = CmsMacroResolver.resolveMacros(configuration, cms, widgetDialog.getMessages()); m_selectOptions = CmsSelectWidgetOption.parseOptions(configuration); if (m_selectOptions == Collections.EMPTY_LIST) { m_selectOptions = new ArrayList(); } } return m_selectOptions; }