1 31 32 package org.opencms.widgets; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.i18n.CmsEncoder; 36 37 46 public class CmsInputWidget extends A_CmsWidget { 47 48 51 public CmsInputWidget() { 52 53 this(""); 55 } 56 57 62 public CmsInputWidget(String configuration) { 63 64 super(configuration); 65 } 66 67 70 public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { 71 72 String id = param.getId(); 73 74 StringBuffer result = new StringBuffer (16); 75 76 result.append("<td class=\"xmlTd\">"); 77 result.append("<input class=\"xmlInput textInput"); 78 if (param.hasError()) { 79 result.append(" xmlInputError"); 80 } 81 result.append("\""); 82 result.append(" name=\""); 83 result.append(id); 84 result.append("\" id=\""); 85 result.append(id); 86 result.append("\" value=\""); 87 result.append(CmsEncoder.escapeXml(param.getStringValue(cms))); 88 result.append("\">"); 89 result.append("</td>"); 90 91 return result.toString(); 92 } 93 94 97 public I_CmsWidget newInstance() { 98 99 return new CmsInputWidget(getConfiguration()); 100 } 101 } | Popular Tags |