From ab0503fe2228587186bc6c5a7a0ab7d6dcb22e09 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Thu, 16 Oct 2008 00:43:00 +0000 Subject: [PATCH] Feature: attach extraClasses to a FormField when it is transform to readonly git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64324 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/FormField.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forms/FormField.php b/forms/FormField.php index 293eef758..53d403a54 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -299,7 +299,7 @@ class FormField extends RequestHandlingData { if($this->value) $val = $this->dontEscape ? ($this->reserveNL?Convert::raw2xml($this->value):$this->value) : Convert::raw2xml($this->value); else $val = '('._t('FormField.NONE', 'none').')'; $valforInput = $this->value ? Convert::raw2att($val) : ""; - return "id() . "\">$val\nname."\" value=\"".$valforInput."\"" . $this->getTabIndexHTML() . " />"; + return "extraClass()."\" id=\"" . $this->id() . "\">$val\nname."\" value=\"".$valforInput."\"" . $this->getTabIndexHTML() . " />"; } /** * Returns a "Field Holder" for this field - used by templates. @@ -405,6 +405,7 @@ HTML; */ function performReadonlyTransformation() { $field = new ReadonlyField($this->name, $this->title, $this->value); + $field->addExtraClass($this->extraClass()); $field->setForm($this->form); return $field; }