1 31 32 package org.opencms.widgets; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.i18n.CmsEncoder; 36 import org.opencms.workplace.galleries.A_CmsGallery; 37 38 48 public abstract class A_CmsHtmlGalleryWidget extends A_CmsGalleryWidget { 49 50 55 public A_CmsHtmlGalleryWidget(String configuration) { 56 57 super(configuration); 58 } 59 60 63 protected A_CmsHtmlGalleryWidget() { 64 65 this(""); 67 } 68 69 72 public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { 73 74 String id = param.getId(); 75 StringBuffer result = new StringBuffer (128); 76 result.append("<td class=\"xmlTd\">"); 77 result.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"maxwidth\">"); 78 result.append("<input type=\"hidden\" value=\""); 79 String fieldValue = param.getStringValue(cms); 80 result.append(CmsEncoder.escapeXml(fieldValue)); 81 result.append("\" name=\""); 82 result.append(id); 83 result.append("\" id=\""); 84 result.append(id); 85 result.append("\">"); 86 result.append("<tr><td style=\"width: 100%;\">"); 87 result.append("<div class=\"xmlHtmlGallery\" unselectable=\"on\" id=\""); 90 result.append(getNameLower()); 91 result.append("."); 92 result.append(id); 93 result.append("\"><div>"); 94 result.append("</td>"); 95 result.append(widgetDialog.dialogHorizontalSpacer(10)); 96 result.append("<td><table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>"); 97 result.append(widgetDialog.button( 98 "javascript:open" + getNameUpper() + "Gallery('" + A_CmsGallery.MODE_WIDGET + "', '" + id + "');", 99 null, 100 getNameLower() + "gallery", 101 Messages.getButtonName(this.getNameLower()), 102 widgetDialog.getButtonStyle())); 103 result.append(widgetDialog.button( 104 "javascript:reset" + getNameUpper() + "Gallery('" + id + "');", 105 null, 106 "erase", 107 Messages.GUI_BUTTON_ERASE_0, 108 widgetDialog.getButtonStyle())); 109 result.append("</tr></table>"); 110 result.append("</td></tr>"); 111 result.append("<script type=\"text/javascript\">check"); 112 result.append(getNameUpper()); 113 result.append("Content('"); 114 result.append(id); 115 result.append("');</script>"); 116 result.append("</table>"); 117 118 result.append("</td>"); 119 120 return result.toString(); 121 } 122 123 126 public boolean showPreview(String value) { 127 128 return false; 130 } 131 } | Popular Tags |