Readonly work

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44405 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Romain Louis 2007-11-07 02:03:48 +00:00
parent 5b08367d5b
commit 70d41d5dc9

View File

@ -37,6 +37,9 @@ class TextareaField extends FormField {
$disabled = $this->disabled ? " disabled=\"disabled\"" : "";
$readonly = $this->readonly ? " readonly=\"readonly\"" : "";
if( $this->readonly )
return "<span $disabled$readonly $classAttr id=\"" . $this->id() . "\" name=\"{$this->name}\" rows=\"{$this->rows}\" cols=\"{$this->cols}\">" . ( $this->value ? Convert::raw2att( $this->value ) : '<i>(not set)</i>' ) . "</span>";
else
return "<textarea $disabled$readonly $classAttr id=\"" . $this->id() . "\" name=\"{$this->name}\" rows=\"{$this->rows}\" cols=\"{$this->cols}\">".Convert::raw2att($this->value)."</textarea>";
}
@ -63,5 +66,9 @@ class TextareaField extends FormField {
$this->readonly = false;
return $this;
}
function Type() {
return parent::Type() . ( $this->readonly ? ' readonly' : '' );
}
}
?>