/** * @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; }
if (configuration.isShowFormat()) {
if (configuration.isShowFormat()) {
if (configuration.isShowFormat()) {
if (configuration.isShowFormat()) {
/** * @see org.opencms.widgets.A_CmsAdeGalleryWidget#getAdditionalGalleryInfo(org.opencms.file.CmsObject, java.lang.String, org.opencms.i18n.CmsMessages, org.opencms.widgets.I_CmsWidgetParameter) */ @Override protected JSONObject getAdditionalGalleryInfo( CmsObject cms, String resource, CmsMessages messages, I_CmsWidgetParameter param) throws JSONException { CmsVfsImageWidgetConfiguration config = getWidgetConfiguration(cms, messages, param); JSONObject result = new JSONObject(); result.put(I_CmsGalleryProviderConstants.CONFIG_USE_FORMATS, config.isShowFormat()); result.put(I_CmsGalleryProviderConstants.CONFIG_IMAGE_FORMATS, new JSONArray(config.getFormatValues())); String temp = config.getSelectFormatString(); String[] formatNames = new String[0]; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(temp)) { formatNames = config.getSelectFormatString().split("\\|"); } result.put(I_CmsGalleryProviderConstants.CONFIG_IMAGE_FORMAT_NAMES, new JSONArray(formatNames)); result.put(I_CmsGalleryProviderConstants.CONFIG_TAB_CONFIG, "selectDoc"); String uploadFolder = OpenCms.getWorkplaceManager().getRepositoryFolderHandler().getRepositoryFolder( cms, resource, GALLERY_NAME + "gallery"); if (uploadFolder != null) { result.put(I_CmsGalleryProviderConstants.CONFIG_UPLOAD_FOLDER, uploadFolder); } return result; }