Readonly class added in performreadonly function

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44374 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Romain Louis 2007-11-06 20:33:13 +00:00
parent 6a9e104006
commit eda727dacc

View File

@ -24,11 +24,15 @@ class TextareaField extends FormField {
* Returns a <textarea> tag - used in templates.
*/
function Field() {
if($extraClass = trim($this->extraClass())) {
$classAttr = "class=\"$extraClass\"";
} else {
$classAttr = '';
$classAttr = '';
if( $this->readonly ) {
$classAttr .= 'class="readonly';
if( $extraClass = trim( $this->extraClass() ) )
$classAttr .= " $extraClass";
$classAttr .= '"';
}
else if( $extraClass = trim( $this->extraClass() ) )
$classAttr .= 'class="' . $extraClass . '"';
$disabled = $this->disabled ? " disabled=\"disabled\"" : "";
$readonly = $this->readonly ? " readonly=\"readonly\"" : "";