/** * @see org.opencms.widgets.I_CmsWidget#newInstance() */ @Override public I_CmsWidget newInstance() { return new CmsVfsImageWidget(getConfiguration()); }
/** * @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) { StringBuffer result = new StringBuffer(256); // import the JavaScript for the image widget result.append(getJSIncludeFile(CmsWorkplace.getSkinUri() + "components/widgets/vfsimage.js")); return result.toString(); }
getOpenGalleryCall(cms, widgetDialog, param, idHash), null, getGalleryName() + "gallery", Messages.getButtonName(getGalleryName()), widgetDialog.getButtonStyle())); result.append( widgetDialog.button( getOpenPreviewCall(widgetDialog, PREFIX_IMAGE + param.getId()), null, "preview.png", additional = getAdditionalGalleryInfo( cms, widgetDialog instanceof CmsDialog ? ((CmsDialog)widgetDialog).getParamResource() : null, result.append("</script>"); CmsVfsImageWidgetConfiguration configuration = getWidgetConfiguration(cms, widgetDialog.getMessages(), param); String format = value.getFormat(cms); if (configuration.isShowFormat()) { String selected = getSelectedValue(cms, options, format); int selectedIndex = 0; for (int i = 0; i < options.size(); i++) {
widgetDialog, param, getConfiguration()); String selected = getSelectedValue(cms, options, format); int selectedIndex = 0; for (int i = 0; i < options.size(); i++) {
/** * @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_CmsAdeGalleryWidget#getGalleryOpenParams(org.opencms.file.CmsObject, org.opencms.i18n.CmsMessages, org.opencms.widgets.I_CmsWidgetParameter, java.lang.String, long) */ @Override protected Map<String, String> getGalleryOpenParams( CmsObject cms, CmsMessages widgetDialog, I_CmsWidgetParameter param, String resource, long hashId) { Map<String, String> result = super.getGalleryOpenParams(cms, widgetDialog, param, resource, hashId); // the current element value will be read by java-script including the image input field and the scale input field StringBuffer currentElement = new StringBuffer("'+document.getElementById('"); if (param != null) { currentElement.append(PREFIX_IMAGE).append(param.getId()); } currentElement.append("').getAttribute('value')+'"); // only try reading scale and format info if formats are used if (param != null) { if (getWidgetConfiguration(cms, widgetDialog, param).isShowFormat()) { currentElement.append("%3F__scale%3D'+document.getElementById('"); currentElement.append(PREFIX_SCALE).append(param.getId()).append("').getAttribute('value')+'"); currentElement.append("%26format%3D'+escape(document.getElementById('").append(PREFIX_FORMAT).append( param.getId()).append("')[document.getElementById('").append(PREFIX_FORMAT).append( param.getId()).append("').selectedIndex].value)+'"); } } result.put(I_CmsGalleryProviderConstants.CONFIG_CURRENT_ELEMENT, currentElement.toString()); 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.I_CmsWidget#newInstance() */ public I_CmsWidget newInstance() { return new CmsVfsImageWidget(getConfiguration()); }
/** * @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) { StringBuffer result = new StringBuffer(256); // import the JavaScript for the image widget result.append(getJSIncludeFile(CmsWorkplace.getSkinUri() + "components/widgets/vfsimage.js")); return result.toString(); }