Merged revisions 47500 via svnmerge from

svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r47500 | ischommer | 2007-12-22 17:25:34 +1300 (Sat, 22 Dec 2007) | 1 line
  
  changed field-rendering to use createTag()
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52188 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-04-06 04:02:05 +00:00
parent aa13b78838
commit f737d52138

View File

@ -22,15 +22,18 @@ class TextField extends FormField {
}
function Field() {
$extraClass = $this->extraClass();
$attributes = array(
'type' => 'text',
'class' => $this->extraClass() . " maxlength",
'id' => $this->id(),
'name' => $this->attrName(),
'value' => $this->attrValue(),
'tabindex' => $this->getTabIndexHTML(),
'maxlength' => ($this->maxLength) ? $this->maxLength : null,
'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : 30
);
$fieldSize = $this->maxLength ? min( $this->maxLength, 30 ) : 30;
if($this->maxLength) {
return "<input class=\"text maxlength$extraClass\" type=\"text\" id=\"" . $this->id() . "\" name=\"{$this->name}\" value=\"" . $this->attrValue() . "\" maxlength=\"$this->maxLength\" size=\"$fieldSize\" />";
} else {
return "<input class=\"text$extraClass\" type=\"text\" id=\"" . $this->id() . "\" name=\"{$this->name}\" value=\"" . $this->attrValue() . "\" />";
}
return $this->createTag('input', $attributes);
}
function InternallyLabelledField() {